	// JavaScript Document

function ventana(url,ancho,alto){
	var _top = 0;
	var _left = 0;
	if(ancho==0 && alto == 0){
		ancho = screen.availWidth;
		alto = screen.availHeight;
	}else
	{
	 _top= (screen.availHeight - alto) / 2;
	 _left = (screen.availWidth - ancho) / 2;
	}
	window.open(url,null,"status=no,toolbar=no,location=no,resizable=no,scrollbars=no,width="+ancho+",height="+alto+",top="+_top+",left="+_left);
}

function ventanafull(url){
  window.open(url);
}


function fecha(){
	var mydate=new Date()
	var year=mydate.getYear()
	if (year < 1000)
		year+=1900
	var day=mydate.getDay()
	var month=mydate.getMonth()
	var daym=mydate.getDate()
	if (daym<10)
		daym="0"+daym
	var dayarray=new Array("Domingo","Lunes","Martes","Miércoles","Jueves","Viernes","Sábado")
	var montharray=new Array("Enero","Febrero","Marzo","Abril","Mayo","Junio","Julio","Agosto","Septiembre","Octubre","Noviembre","Diciembre")
	document.write(" "+dayarray[day].toUpperCase()+" "+daym+" DE "+montharray[month].toUpperCase()+" DE "+year)	
}


function actualizarpicture(){
	valor = obtenerP(1);
	fotos = "SEC00000SEC00001SEC00002SEC00003SEC00004SEC00005SEC00006SEC00007SEC00008SEC00009";
	document.picture.src="img/secretarias/"+fotos.substring(valor*8,(valor*8)+8)+'.JPG';
}

function actualizarfoto(archivo,leyenda){
	docto = "img/"+archivo+".jpg";
	document.form1.original.src=docto;
	if(leyenda!='' && leyenda!=null){
		document.form1.leyenda.value = leyenda;
	}else{
		document.form1.leyenda.value = " ";		
	}
}

function obtenerP(nParametro){
	//Capturamos la URL
	var callingURL = document.location.href;
	//Separamos los parametros
	if(callingURL.indexOf('?')!=-1){
		var cgiString = callingURL.substring(callingURL.indexOf('?')+1,callingURL.length);
	}else{
		return 0;
	}
	// Para manejar control ya que el arreglo empieza en cero restaremos 1 al parametro recibido
	nParametro -=1;
	// Dividimos mediante la función split los parámetros separados por ampersam
	var col_array=cgiString.split("&");
	var part_num=0;
	// Ahora hacemos un recorrido del arreglo y buscamos el # de parametro solicitado!
	while (part_num < col_array.length){
		if ( part_num == nParametro )
			return col_array[part_num].substring(col_array[part_num].indexOf('=')+1);
		else
			part_num+=1;
	}
	// evaluar que devolver cuando no lo
	// encuentra...
	return 0;
} 