<!--
function loginIngles() {

//alert(document.form1.login.value)

//writeCookie('myCookie', 'Entro', 1);
document.form1.action="default.asp?login=1&Idioma=1";
document.form1.submit();
}

function loginSalirIngles() {

//alert(document.form1.login.value)
//writeCookie('myCookie', 'Salio', 1);
document.form1.action="salir.asp?Idioma=1&SalirLogin=1&ColorFondo="+document.frmSalidaSegura.ColorFondo.value;
document.form1.submit();
}


var popUpWin=0;
function popUpWindow(URLStr, left, top, width, height){
  if(popUpWin)
  {
    if(!popUpWin.closed) popUpWin.close();
  }
  popUpWin = open(URLStr, 'popUpWin', 'toolbar=no,location=no,directories=no,status=no,menubar=no,scrollbar=no,resizable=yes,copyhistory=yes,width='+width+',height='+height+',left='+left+', top='+top+',screenX='+left+',screenY='+top+'');
}

var pong;
function makeArray(n){
  this.length = n;
  for (i=1;i<=n;i++){
    this[i]=0;
  }
  return this;
}

// standard date display function with y2k compatibility
function displayDate() {
  var this_month = new makeArray(12);
  this_month[0]  = "Enero";
  this_month[1]  = "Febrero";
  this_month[2]  = "Marzo";
  this_month[3]  = "Abril";
  this_month[4]  = "Mayo";
  this_month[5]  = "Junio";
  this_month[6]  = "Julio";
  this_month[7]  = "Agosto";
  this_month[8]  = "Septiembre";
  this_month[9]  = "Octubre";
  this_month[10] = "Noviembre";
  this_month[11] = "Deciembre";

  var today = new Date();
  var day   = today.getDate();
  var month = today.getMonth();
  var year  = today.getYear();
  var dia = today.getDay();
  
    if (year < 1000) {
       year += 1900; }
  return(day + " de " + this_month[month] + " " + year);
}
// -->

// JavaScript Document
// Example:
// writeCookie("myCookie", "my name", 24);
// Stores the string "my name" in the cookie "myCookie" which expires after 24 hours.
function writeCookie(name, value, hours)
{
  var expire = "";
  if(hours != null)
  {
    expire = new Date((new Date()).getTime() + hours * 3600000);
    expire = "; expires=" + expire.toGMTString();
  }
  document.cookie = name + "=" + escape(value) + expire;
}
// Example:
// alert( readCookie("myCookie") );
function readCookie(name)
{
  var cookieValue = "";
  var search = name + "=";
  if(document.cookie.length > 0)
  { 
    offset = document.cookie.indexOf(search);
    if (offset != -1)
    { 
      offset += search.length;
      end = document.cookie.indexOf(";", offset);
      if (end == -1) end = document.cookie.length;
      cookieValue = unescape(document.cookie.substring(offset, end))
    }
  }
  return cookieValue;
}

function Redireccionar(){
	if (readCookie('Login')=='Entro'){
	}else{
		if (document.frmSalidaSegura.textfield.value ==1){
			history.go(-1);
		}
	}
}



function mueveReloj(){ 
    momentoActual = new Date() 
    hora = momentoActual.getHours() 
    minuto = momentoActual.getMinutes() 
    segundo = momentoActual.getSeconds()
	
	if (segundo<10)
		adicionSegundo =  "0"
	else
		adicionSegundo =  ""
	
	if (minuto<10)
		adicionMinuto =  "0"
	else
		adicionMinuto =  ""
	

	horaImprimible = hora + " : " + adicionMinuto +minuto + " : " +adicionSegundo+ segundo 
	
//    document.form_reloj.reloj.value = displayDate()+" "+horaImprimible 
    document.form_reloj.reloj.value = horaImprimible 
	
	setTimeout("mueveReloj()",1000) 
} 

function fechaInicial(){
    document.form_reloj.reloj1.value = displayDate();
}
/*
function modificar(y,x){
	porcentaje = 100/x
	porcentaje = porcentaje+"%"
	y=y+"";
	x=x+"";
	for (i=1;i<x;i++){
//		alert(y);
//		alert(x);
		alert(y+i);
		alert(porcentaje);
		document.getElementById(y+i).width = porcentaje
	}
//		document.getElementById('1001').width = "10%"
}
*/

function verBuscador(){
	if (document.form2.txtBuscar.value != "") {
		return true;
	}else{
		alert('no hay criterios de busqueda');
	}
}

function verBuscadorI(){
	if (document.form2.txtBuscar.value != "") {
		return true;
	}else{
		alert('no hay criterios de busqueda');
	}
}

function login1() {

//alert(document.form1.login.value)

//writeCookie('myCookie', 'Entro', 1);
document.form1.action="default.asp?login=1";
document.form1.submit();
}

function loginSalir() {

//alert(document.form1.login.value)
//writeCookie('myCookie', 'Salio', 1);
document.form1.action="salir.asp?SalirLogin=1&ColorFondo="+document.frmSalidaSegura.ColorFondo.value;
document.form1.submit();
}



function encuesta() {

document.enct.submit();
}

function john(j,total)
{
//modificar(j);
//alert(j);
var tester = document.getElementById(j);

tester.style.display = 'block';
document.getElementById('POR').style.display = 'NONE';
	for (i = 1; i <= total; i++)	{
		var tester1 = document.getElementById(i);
		if (i!=j){
		tester1.style.display = 'NONE';
	}
}



//hola=setTimeout( 'john('+j+')',5000000000);

}
function john1(j,total)
{
var tester = document.getElementById(j);
tester.style.display = 'none';
document.getElementById('POR').style.display = 'block';
}


function isEmail (s){
//alert(s);
	
    var i = 1;
    var sLength = s.length;

    // look for @
    while ((i < sLength) && (s.charAt(i) != "@")){
		i++
    }

    if ((i >= sLength) || (s.charAt(i) != "@")) return false;
    else i += 2;

    // look for .
    while ((i < sLength) && (s.charAt(i) != ".")){ 
		i++
    }

    // there must be at least one character after the .
    if ((i >= sLength - 1) || (s.charAt(i) != ".")) return false;
    else return true;
}

function MensajeRegistroOk(Idioma){
	if (Idioma == 1){
		alert('Los datos se han enviado satisfactoriamente Ingles');
	}else{
		alert('Los datos se han enviado satisfactoriamente');
	}
}