var iNaveg= (document.all) ? 1 : 0;
function myC(lay){  
this.creaSp = creaSp;
this.lay=lay;
this.update = update;
this.writeT = writeT;}
function creaSp(){
var today = new Date(); 
a = today.getSeconds()
if (a<10){
segundo="0"+a}
else{
segundo=today.getSeconds()}
b = today.getMinutes()
if (b<10){
minuto="0"+b}
else{
minuto=today.getMinutes() }
hora = today.getHours(); 
fin = " A.M."; 
if (hora > 12){
hora = hora - 12;
fin = " P.M.";}else if (hora< 0){hora = 24 + hora; fin = " P.M."}
dateStr = "Hora " + hora +  ":" + minuto + ":" + segundo + fin;
this.display = dateStr;}
function update(){
this.creaSp();
this.writeT();
window.setTimeout("aClock.update()", 1000);}
function writeT(){
var htmlOut = ""
htmlOut += "<font class='t'>" +this.display +"</font>"
if(document.layers) {
this.lay.document.open();
this.lay.document.write(htmlOut);
this.lay.document.close();
} else {
this.lay.innerHTML = htmlOut;}}

function init() {
if(document.layers){
aClock = new myC(document.layers["reloj"])  // Netscape syntax
aClock.update();
} else {
if (document.all)
aClock = new myC(document.all["reloj"])  // IE syntax
else
aClock = new myC(document.getElementById("reloj"))  // IE syntax
aClock.update();}}

var meses = new Array();
meses[1]=" Enero ";
meses[2]=" Febrero ";
meses[3]=" Marzo ";
meses[4]=" Abril ";
meses[5]=" Mayo ";
meses[6]=" Junio ";
meses[7]=" Julio ";
meses[8]=" Agosto ";
meses[9]=" Septiembre ";
meses[10]=" Octubre ";
meses[11]=" Noviembre ";
meses[12]=" Diciembre ";
function getF(sep){
var fecha=new Date();

var today = new Date(); 
hora = today.getHours();
if (hora > 0 && hora < 7){
var dia=fecha.getDate();var numero=fecha.getDay();}else {var dia=fecha.getDate();var numero=fecha.getDay();}

var mes=fecha.getMonth()+1;
var mestxt = meses[mes];
var anio=fecha.getFullYear();

var nom;
switch (numero){
case 1 : nom = "Lunes"; break;
case 2 : nom = "Martes"; break;
case 3 : nom = "Miércoles"; break;
case 4 : nom = "Jueves"; break;
case 5 : nom = "Viernes"; break;
case 6 : nom = "Sábado"; break;
case 0: nom = "Domingo"; break;}
var hoy = "Arequipa, " + nom + " " + dia  + " de " + mestxt + anio;
return hoy;}
window.onfocus=init

