function tS(){ x=new Date(); x.setTime(x.getTime()); return x; } 
function lZ(x){ return (x>9)?x:'0'+x; } 
function tH(x){ if(x==0){ x=12; } return (x>12)?x-=12:x; } 
function y2(x){ x=(x<500)?x+1900:x; return String(x) } 
function dT(){ document.getElementById('clock').innerHTML=eval(oT); setTimeout('dT()',1000); } 
function aP(x){ return (x>11)?'p.m.':'a.m.'; } 
var dN=new Array('Domingo','Lunes','Martes','Miércoles','Jueves','Viernes','Sábado'),
    mN=new Array('Enero','Febrero','Marzo','Abril','Mayo','Junio','Julio','Agosto','Setiembre','Octubre','Noviembre','Diciembre'),
	oT="dN[tS().getDay()]+', '+tS().getDate()+' de '+mN[tS().getMonth()]+' de '+y2(tS().getYear())+', '+tH(tS().getHours())+':'+lZ(tS().getMinutes())+':'+lZ(tS().getSeconds())+' '+aP(tS().getHours())";
if(!document.all){ window.onload=dT; }else{ dT(); }
