function CreaArray(n) {
	this.length = n   
	for (var i = 1; i<=n; i++) {   
		this[i] = new Image()   
	}   
	return this  
}

function LlenarImagen1(pStrRuta1,pStrImagen1)
{	this.src=pStrRuta1+pStrImagen1;
}
//En la llamada a esta funcion, pasamos la imagen del array que sustituye   
//y el nombre del tag <img ...> en el cual es sustituida   
function CambiarImagen(botonNuevo,deCualBoton) {
	deCualBoton.src=botonNuevo.src;
}

function imprimir(que) {
	var ventana = window.open("", "", "");
	var contenido = "<html><link rel='stylesheet' type='text/css' href='css/estilos.css' /><body style='background:#FFFFFF' onload='window.print();window.close();'><div style='width:650px; background:#FFFFFF; text-align:left'>" + document.getElementById(que).innerHTML + "</div></body></html>";
	ventana.document.open();
	ventana.document.write(contenido);
	ventana.document.close();
}
function NewWindow(mypage,myname,w,h,scrollbar,resi)
{	LeftPosition = (screen.width-w)/2
	TopPosition = (screen.height-h)/2 
	settings ='height='+h+',width='+w+',top='+TopPosition+',left='+LeftPosition+',scrollbars='+scrollbar+',resizable='+resi+',toolbar=no,directories=no,menubar=no,status=no'
	//window.open(mypage,myname,settings);
	
	var vent ;
	 vent =open(mypage,vent,settings);
	 vent.focus();
}
function mustraReloj(){ 
    var ahora = new Date(); 
	var horas = ahora.getHours(); 
	var minutos = ahora.getMinutes(); 
	var segundos = ahora.getSeconds(); 
	var ampm =" "; 
	
	if (horas < 10) { Hora = "0" + horas } else { Hora = "" + horas } 
	if (minutos < 10) { Hora += ":0" + minutos } else { Hora += ":" + minutos } 
	//if (segundos < 10) { Hora += ":0" + segundos } else { Hora += ":" + segundos } 
	
	// Activa las siguientes 2 líneas para obtener un reloj en formato de 12 horas 
	if (horas > 12) { horas -= 12; ampm = " PM" } else ampm = " AM" 
	Hora += ampm 
	
	// Puede desactivarse el reloj de la barra de estado, anulando la siguiente línea 
	//window.status = Hora 
	
	// Puede suprimirse el reloj del cuerpo de la página, y dejarlo en la barra de estado, anulando la siguiente línea, 
	// en cuyo caso tampoco es necesario el <FORM> incluido en el <body> de la página. 
	document.getElementById("reloj").innerHTML = Hora 
	
	RelojRefresco = setTimeout("mustraReloj()",1000) 
	RelojActivo=true
	// final --> 
} 

var Utf8 = {

	// public method for url encoding
	encode : function (string) {
		string = string.replace(/\r\n/g,"\n");
		var utftext = "";

		for (var n = 0; n < string.length; n++) {

			var c = string.charCodeAt(n);

			if (c < 128) {
				utftext += String.fromCharCode(c);
			}
			else if((c > 127) && (c < 2048)) {
				utftext += String.fromCharCode((c >> 6) | 192);
				utftext += String.fromCharCode((c & 63) | 128);
			}
			else {
				utftext += String.fromCharCode((c >> 12) | 224);
				utftext += String.fromCharCode(((c >> 6) & 63) | 128);
				utftext += String.fromCharCode((c & 63) | 128);
			}

		}

		return utftext;
	},

	// public method for url decoding
	decode : function (utftext) {
		var string = "";
		var i = 0;
		var c = c1 = c2 = 0;

		while ( i < utftext.length ) {

			c = utftext.charCodeAt(i);

			if (c < 128) {
				string += String.fromCharCode(c);
				i++;
			}
			else if((c > 191) && (c < 224)) {
				c2 = utftext.charCodeAt(i+1);
				string += String.fromCharCode(((c & 31) << 6) | (c2 & 63));
				i += 2;
			}
			else {
				c2 = utftext.charCodeAt(i+1);
				c3 = utftext.charCodeAt(i+2);
				string += String.fromCharCode(((c & 15) << 12) | ((c2 & 63) << 6) | (c3 & 63));
				i += 3;
			}
		}
		return string;
	}
}
/*FUNCIONES PROPIAS FUNRIOS*/
/*CARGA EN PROCESOS*/
function cargaEnlace1(pIntElemento,pStrID)
{	var pPar1;
	
	if(vSecActual!=7)
	{	pPar1="'"+vStrID+"'";
		document.getElementById('menu'+vSecActual).innerHTML='<a href="pl.quienes-banner.ajx.php?item='+vStrID+'" target="serv_banner" onclick="javascript:cargaEnlace1('+vSecActual+','+pPar1+');" class="menu_izq1" title="'+arrEnlaces[vSecActual]+'">'+arrEnlaces[vSecActual]+'</a>';
	}
	pPar1="'"+pStrID+"'";
	document.getElementById('menu'+pIntElemento).innerHTML='<a href="pl.quienes-banner.ajx.php?item='+pStrID+'" target="serv_banner" onclick="javascript:cargaEnlace1('+vSecActual+','+pPar1+');" class="menu_izq2" title="'+arrEnlaces[pIntElemento]+'">'+arrEnlaces[pIntElemento]+'</a>';
	vSecActual=pIntElemento;
	vStrID=pStrID;
	
	recibeid1("quienes-somos.php","ajx=2&item="+pStrID,"","img_quienes");
	recibeid("quienes-somos.php","ajx=1&item="+pStrID,"","contenido_quienes");
}

function cargaMega(pIntSubElemento,pStrSubId,pStrSubId1)
{	var pPar1,pPar2;
	if(vSubSecAct!=0)
	{	pPar1="'"+vStrSubId+"'";
		pPar2="'"+vStrSubId1+"'";
		document.getElementById('tr'+vSubSecAct).innerHTML='<a href="javascript:cargaMega('+vSubSecAct+','+pPar1+','+pPar2+');" class="lnk_icon_flecha4" title="'+arrTrayectoria[vSubSecAct]+'">'+arrTrayectoria[vSubSecAct]+'</a>';
	}
	pPar1="'"+pStrSubId+"'";
	pPar2="'"+pStrSubId1+"'";
	document.getElementById('tr'+pIntSubElemento).innerHTML='<a href="javascript:cargaMega('+pIntSubElemento+','+pPar1+','+pPar2+');" class="lnk_icon_flecha4_rj" title="'+arrTrayectoria[pIntSubElemento]+'">'+arrTrayectoria[pIntSubElemento]+'</a>';
	vSubSecAct=pIntSubElemento;
	vStrSubId=pStrSubId;
	vStrSubId1=pStrSubId1;
	
	//recibeid1("quienes-somos.php","ajx=2&item="+pStrSubId+"&itemS="+pStrSubId1,"","img_quienes");
	recibeid("quienes-somos.php","ajx=1&item="+pStrSubId,"","contenido_quienes");
}

/*CARGA LISTADO DE NEWSLETTERS*/
function cargaNewsList(pIntAnio,pIntNewsletter)
{	recibeid("newsletter.php","acc=2&anio="+pIntAnio+"&item="+pIntNewsletter,"","contenido_lista_news")
}
function cargaPastillaList(pIntAnio,pIntPastilla)
{	recibeid("pastilla.php","acc=2&anio="+pIntAnio+"&item="+pIntPastilla,"","contenido_lista_news")
}

/*FORMULARIOS*/
/*ALERTA REQUERIDOS*/
function alertarReq(pStrForm,pStrId,pStrCapa,pStrMsj)
{	eval("document."+pStrForm+".txt"+pStrId+".className='inpTxtAl';");
	document.getElementById(pStrCapa).innerHTML=pStrMsj;
}

function agregar(){
	if (document.all)
		window.external.AddFavorite("http://www.eseperu.com","Escuela Servicios de Excelencia");
}