<!--
// *** FUNCIÓN PARA ABRIR UNA VENTANA ***
function FnWOp(){
	window.open("index(1).htm","Java","left=0,top=0,screenX=0,screenY=0,width=840,height=600,resizable=yes");
}
// *** FIN DE LA FUNCIÓN PARA ABRIR UNA NUEVA VENTANA ***

// *** FUNCIÓN PARA CERRAR UNA VENTANA ***
function CerrarVentana(){
	window.self.close();
}
// *** FIN DE LA FUNCIÓN PARA CERRAR UNA VENTANA ***

// *** FUNCIÓN PARA CAMBIAR UNA IMÁGEN POR OTRA (O VARIAS) ***
function MM_preloadImages() { //v3.0
  var d=document; if(d.images){ if(!d.MM_p) d.MM_p=new Array();
    var i,j=d.MM_p.length,a=MM_preloadImages.arguments; for(i=0; i<a.length; i++)
    if (a[i].indexOf("#")!=0){ d.MM_p[j]=new Image; d.MM_p[j++].src=a[i];}}
}
function MM_findObj(n, d) { //v4.01
  var p,i,x;  if(!d) d=document; if((p=n.indexOf("?"))>0&&parent.frames.length) {
    d=parent.frames[n.substring(p+1)].document; n=n.substring(0,p);}
  if(!(x=d[n])&&d.all) x=d.all[n]; for (i=0;!x&&i<d.forms.length;i++) x=d.forms[i][n];
  for(i=0;!x&&d.layers&&i<d.layers.length;i++) x=MM_findObj(n,d.layers[i].document);
  if(!x && d.getElementById) x=d.getElementById(n); return x;
}
function MM_swapImgRestore() { //v3.0
  var i,x,a=document.MM_sr; for(i=0;a&&i<a.length&&(x=a[i])&&x.oSrc;i++) x.src=x.oSrc;
}

function MM_swapImage() { //v3.0
  var i,j=0,x,a=MM_swapImage.arguments; document.MM_sr=new Array; for(i=0;i<(a.length-2);i+=3)
   if ((x=MM_findObj(a[i]))!=null){document.MM_sr[j++]=x; if(!x.oSrc) x.oSrc=x.src; x.src=a[i+2];}
}
// *** FIN DE LAS FUNCIONES PARA LAS IMÁGENES ***

// *** FUNCIÓN PARA DESHABILITAR EL MENÚ CONTEXTUAL DEL BOTÓN SECUNDARIO (DERECHO) DEL MOUSE ***
var msg = "";
function clickIE() {
	if (document.all) {
		(message);
		return false;
	}
}
function clickNS(e) {
	if (document.layers||(document.getElementById&&!document.all)) {
		if (e.which==2||e.which==3) {(message);
			return false;
		}
	}
}
if (document.layers) {
	document.captureEvents(Event.MOUSEDOWN);document.onmousedown=clickNS;
} else {
	document.onmouseup=clickNS;document.oncontextmenu=clickIE;
}
document.oncontextmenu = new Function("return false")
// *** FIN DE LA FUNCIÓN PARA DESHABILITAR EL MENÚ CONTEXTUAL DEL BOTÓN SECUNDARIO (DERECHO) DEL MOUSE ***

// *** FUNCIÓN PARA COMPROBAR LA VERSIÓN DEL EXPLORADOR, ASÍ COMO EL NOMBRE DEL MISMO. ***
function MM_checkBrowser(NSvers,NSpass,NSnoPass,IEvers,IEpass,IEnoPass,OBpass,URL,altURL) { //v5.0
  var newURL='', userAgent=navigator.userAgent, version=0;
  if (userAgent.indexOf('Netscape') != -1) {
  	version = parseFloat(userAgent.substring(userAgent.indexOf('Netscape')+9,userAgent.length));
    if (version >= NSvers) {if (NSpass>0) newURL=(NSpass==1)?URL:altURL;}
    else {if (NSnoPass>0) newURL=(NSnoPass==1)?URL:altURL;}
  } else if (userAgent.indexOf('MSIE') != -1) {
  	version = parseFloat(userAgent.substring(userAgent.indexOf('MSIE')+4,userAgent.length));
    if (version >= IEvers)
     {if (IEpass>0) newURL=(IEpass==1)?URL:altURL;}
    else {if (IEnoPass>0) newURL=(IEnoPass==1)?URL:altURL;}
  } else if (OBpass>0) newURL=(OBpass==1)?URL:altURL;
  if (newURL) { window.location=unescape(newURL); document.MM_returnValue=false; }
}
// *** FIN DE LA FUNCIÓN PARA COMPROBAR LA VERSIÓN DEL EXPLORADOR, ASÍ COMO EL NOMBRE DEL MISMO. ***

// *** FUNCIÓN PARA PONER UN RELOJ CON JAVASCRIPT ***
function reloj(){
	if (!document.all){
		return;
	}
	var Digital = new Date()
	var hours = Digital.getHours()
	var minutes = Digital.getMinutes()
	var seconds = Digital.getSeconds()
	var dn = "AM" 
	if (hours > 12){
		dn = "PM"
		hours = hours - 12
	}
	if (hours < 10){
		hours = "0" + hours;
	}
	if (hours == 0){
		hours = 12
	}
	if (minutes <= 9){
		minutes = "0" + minutes;
	}
	if (seconds <= 9){
		seconds = "0" + seconds;
	}
	var day = Digital.getDate();
	var month = Digital.getMonth();
	var year = Digital.getFullYear();
	var dayname = Digital.getDay();
	if (day < 10) {
		day = "0" + day;
	}
	if (month == 0) {
		month = "Enero"
	} else if (month == 1) {
		month = "Febrero"
	} else if (month == 2) {
		month = "Marzo"
	} else if (month == 3) {
		month = "Abril"
	} else if (month == 4) {
		month = "Mayo"
	} else if (month == 5) {
		month = "Junio"
	} else if (month == 6) {
		month = "Julio"
	} else if (month == 7) {
		month = "Agosto"
	} else if (month == 8) {
		month = "Septiembre"
	} else if (month == 9) {
		month = "Octubre"
	} else if (month == 10) {
		month = "Noviembre"
	} else if (month == 11) {
		month = "Diciembre"
	}
	if (dayname == 0) {
		dayname = "Domingo";
	} else if (dayname == 1) {
		dayname = "Lunes";
	} else if (dayname == 2) {
		dayname = "Martes";
	} else if (dayname == 3) {
		dayname = "Miercoles";
	} else if (dayname == 4) {
		dayname = "Jueves";
	} else if (dayname == 5) {
		dayname = "Viernes";
	} else if (dayname == 6) {
		dayname = "Sabado";
	}
	var ctime = "<pre>Hoy es " + dayname + ", " + day + " de " + month + " del " + year + "  |  " + hours + ":" + minutes + ":" + seconds + " " + dn + ".</pre>"; 
	TxtReloj.innerHTML = ctime
	setTimeout("reloj()",1000)
}
// *** FIN DE LA FUNCIÓN PARA PONER UN RELOJ CON JAVASCRIPT ***

// *** FUNCIÓNES PARA LAS COOKIES ***
function CojerValorCookie(indice) {
	var galleta = document.cookie;
	var FinCadena = galleta.indexOf(";", 0);
	if (FinCadena == -1) {
		FinCadena = galleta.length;
		return unescape(galleta.substring(indice + 7, FinCadena));
	} else {
		if (galleta.length > 0) {
			return unescape(galleta.substring(indice + 7, FinCadena));
		} else {
			return "";
		}
	}
}
function CojerCookie(nombre) {
	var galleta = document.cookie;
	var arg = nombre + "=";											//construye la cadena con el nombre del valor
	var alen = arg.length;											//longitud del nombre del valor
	var glen = galleta.length;										//longitud de la cookie
	var i = 0;
	while (i < glen) {
		var j = i + alen;											//posiciona j al final del nombre del valor
		if (galleta.substring(i, j) == arg)	{						//si en la cookie estamo ya en nombre del valor		
			return CojerValorCookie(j);								//devuleve el valor, que esta a partir de j
		}
		i = galleta.indexOf(" ", i) + 1;							//pasa al siguiente
		if (i == 0) {
			break;													//fin de la cookie
		}
	}
	return "";													//no se encuentra el nombre del valor
}
function GuardarCookie (nombre, valor) {
	var fecha = new Date();																//Fecha actual
	var dia = fecha.getDay();															//Dia de la fecha actual
	var mes = fecha.getMonth();															//Mes de la fecha actual
	var ano = fecha.getFullYear();														//Año de la fecha actual
	ano++;																				//Aumenta un año más
	var fec = new Date(ano, mes, dia);													//Crea la fecha de expiración
	if (document.CERCO.LogInOptions[0].checked) {
		valor = "TRUE!" + document.CERCO.TxtUserName.value + "!" + document.CERCO.TxtUserPass.value
		document.cookie = nombre + "=" + escape(valor) + "; expires=" + fec.toGMTString()	//Guarda la cookie
	} else if (document.CERCO.LogInOptions[1].checked) {
		valor = "TRUE!" + document.CERCO.TxtUserName.value
		document.cookie = nombre + "=" + escape(valor) + "; expires=" + fec.toGMTString()	//Guarda la cookie
	} else if (document.CERCO.LogInOptions[2].checked) {
		valor = "TRUE!"
		document.cookie = nombre + "=" + escape(valor) + "; expires=" + fec.toGMTString()	//Guarda la cookie
	} else {
		document.cookie = nombre + "=" + escape(valor) + "; expires=" + fec.toGMTString()	//Guarda la cookie
	}
}
function FindCookie() {
	var nomCookie = CojerCookie("CERCOUser"); 												//Obtiene el valor de la cookie
	if (nomCookie == "" ) {																	//Verifica si existe el valor de la cookie
		document.CERCO.LogInOptions[2].checked = true;										//Pone el valor al radiobutton
		GuardarCookie("CERCOUser", "TRUE!");												// y guarda la cookie por default
		FnFoco("NAME");
	} else {
		var Inicio = nomCookie.indexOf("!", 0)												//Escoje el inicio de la seleccion
		if (Inicio == -1) {																	//-1=Solamente se guardo el nombre de usuario
			document.CERCO.TxtUserName.value = nomCookie;									//Pone el valor de la cookie al textbox
			document.CERCO.LogInOptions[1].checked = true;									//Pone el valor al radiobutton
			FnFoco("PASS");
		} else {
			document.CERCO.TxtUserName.value = nomCookie.substring(0, Inicio);				//Pone los valores de la cookie a los textbox
			document.CERCO.TxtUserPass.value = nomCookie.substring(Inicio + 1, nomCookie.length); //que son el nombre y contraseña
			document.CERCO.LogInOptions[0].checked = true;									//Pone el valor al radiobutton
			FnFoco("BUTTON");
		}
	}
	if (document.cookie == "") {
		window.location.href = "no_cookies.htm";											//Redireccióna si es que no estan habilitadas
	}																						//las cookies del explorador
}
// *** FIN DE LAS FUCIÓNES PARA LAS COOKIES ***

// *** FUNCIÓN PARA MOVER LA PANTALLA
function FnMoverPantalla() {
	window.moveTo(0,0);
	if (document.all) {
		top.window.resizeTo(screen.availWidth,screen.availHeight);
	}
}
// *** FIN DE LA FUNCIÓN PARA MOVER LA PANTALLA

// *** FUNCIÓN PARA ABRIR LA VENTANA DEL ISO
function FnOpenWinISO(){
	window.open("iso.html","ISO","left=0,top=0,screenX=0,screenY=0,width=250,height=200,resizable=yes");
}
// *** FIN DE LA FUNCIÓN PARA ABRIR LA VENTANA DEL ISO
-->