﻿/*
JScript File
Utilitarios Generales:
function OpenFullWindow(ruta,winname)
function OpenMiddleWindow(ruta,winname,width,height)
function preloadImages() 
function MostrarFecha()
function MostrarHora()
function ShowDate()
function ShowTime()
function Print() 
function enlrge(imgnme,cptn)
function enlrgeen(imgnme,cptn)
*/

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) / 3;
    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]='Dimanche';
    dia[1]='Lundi';
    dia[2]='Mercredi';
    dia[3]='Mardi';
    dia[4]='Jeudi';
    dia[5]='Vendredi';
    dia[6]='Samedi';
    var ndia = ahora.getDate();
    var mes = ahora.getMonth()+1;
    var anio = ahora.getFullYear();
    
    var Mes = new Array();
    Mes[1] = 'janvier';
    Mes[2] = 'f&eacute;vrier';
    Mes[3] = 'mars';
    Mes[4] = 'avril';
    Mes[5] = 'mai';
    Mes[6] = 'juin';
    Mes[7] = 'juillet';
    Mes[8] = 'a&ocirc;ut';
    Mes[9] = 'septembre';
    Mes[10] = 'octobre';
    Mes[11] = 'novembre';
    Mes[12] = 'd&eacute;cembre';
    
    var temp = dia[ahora.getDay()]+', '+ndia+' '+Mes[mes]+' '+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 ShowDate(){
    var now = new Date();
    var day = new Array();
    day[0]='Sunday';
    day[1]='Monday';
    day[2]='Tuesday';
    day[3]='Wednesday';
    day[4]='Thursday';
    day[5]='Friday';
    day[6]='Saturday';
    var nday = now.getDate();
    var month = now.getMonth()+1;
    var yr = now.getFullYear();
    
    var Month = new Array();
    Month[1] = 'January';
    Month[2] = 'February';
    Month[3] = 'March';
    Month[4] = 'April';
    Month[5] = 'May';
    Month[6] = 'June';
    Month[7] = 'July';
    Month[8] = 'August';
    Month[9] = 'September';
    Month[10] = 'October';
    Month[11] = 'November';
    Month[12] = 'December';
    
    var temp = day[now.getDay()]+', '+Month[month]+' '+nday+', '+yr;
    document.getElementById('fecha').innerHTML=temp;
    setTimeout("ShowDate()",60000);
}

function ShowTime(){
    var time = new Date();
   var hour = time.getHours();
   var minutes = time.getMinutes();
   var seconds = time.getSeconds();
   var temp = "" + ((hour > 12) ? hour - 12 : hour);
   if (hour == 0)
      temp = "12";
   temp += ((minutes < 10) ? ":0" : ":") + minutes;
   temp += ((seconds < 10) ? ":0" : ":") + seconds;
   temp += (hour >= 12) ? " p.m." : " a.m.";
   document.getElementById('reloj').innerHTML='<strong>'+temp+'</strong>';
   setTimeout("ShowTime()",1000);
}

function Print() {
document.body.offsetHeight;
window.print();
}

