﻿// JScript File
function OpenFullWindow(ruta,winname)
{
    window.open(ruta,winname,'width='+screen.width+',height='+screen.height+',left=0,top=0');
}

function OpenMiddleWindow(ruta,winname,width,height)
{
    var top = (screen.height - height) / 2;
    var izq = (screen.width - width) / 2;
    
    window.open(ruta,winname,'width='+width+',height='+height+',left='+izq+',top='+top+',scrollbars=1');
}

function preloadImages() 
{
  var d=document; if(d.images){ if(!d.MM_p) d.MM_p=new Array();
    var i,j=d.MM_p.length,a=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 MostrarFecha(){
    var ahora = new Date();
    var dia = new Array();
    dia[0]='Domingo';
    dia[1]='Lunes';
    dia[2]='Martes';
    dia[3]='Miércoles';
    dia[4]='Jueves';
    dia[5]='Viernes';
    dia[6]='Sábado';
    var ndia = ahora.getDate();
    var mes = ahora.getMonth()+1;
    var anio = ahora.getFullYear();
    
    var Mes = new Array();
    Mes[1] = 'Enero';
    Mes[2] = 'Febrero';
    Mes[3] = 'Marzo';
    Mes[4] = 'Abril';
    Mes[5] = 'Mayo';
    Mes[6] = 'Junio';
    Mes[7] = 'Julio';
    Mes[8] = 'Agosto';
    Mes[9] = 'Septiembre';
    Mes[10] = 'Octubre';
    Mes[11] = 'Noviembre';
    Mes[12] = 'Diciembre';
    
    var temp = dia[ahora.getDay()]+', '+ndia+' de '+Mes[mes]+' de '+anio;
    document.getElementById('fecha').innerHTML=temp;
    setTimeout("MostrarFecha()",60000);
}

function MostrarHora(){
    var tiempo = new Date();
   var hora = tiempo.getHours();
   var minutos = tiempo.getMinutes();
   var segundos = tiempo.getSeconds();
   var temp = "" + ((hora > 12) ? hora - 12 : hora);
   if (hora == 0)
      temp = "12";
   temp += ((minutos < 10) ? ":0" : ":") + minutos;
   temp += ((segundos < 10) ? ":0" : ":") + segundos;
   temp += (hora >= 12) ? " p.m." : " a.m.";
   document.getElementById('reloj').innerHTML='<strong>'+temp+'</strong>';
   setTimeout("MostrarHora()",1000);
}

function querySt(ji) {
    hu = window.location.search.substring(1);
    gy = hu.split("&");
    for (i=0;i<gy.length;i++) {
        ft = gy[i].split("=");
        if (ft[0] == ji) {
            return ft[1];
        }
    }
}
