function loadXMLDoc(dname){
var xmlDoc;
// code for IE
if (window.ActiveXObject)
{
xmlDoc=new ActiveXObject("Microsoft.XMLDOM");
}
// code for Mozilla, Firefox, Opera, etc.
else if (document.implementation && document.implementation.createDocument)
{
xmlDoc=document.implementation.createDocument("","",null);
}
else
{
alert('Your browser cannot handle this script');
}
xmlDoc.async=false;
xmlDoc.load(dname);
return(xmlDoc);
}
function get_firstchild(n){
var x=n.firstChild;
while (x.nodeType!=1)
{
x=x.nextSibling;
}
return x;
}
function iniciar(){
	iniciarrelogito();
}
function iniciarrelogito(){
var hoy=new Date()
var numdia = hoy.getDay()
var h=hoy.getHours()
var m=hoy.getMinutes()
var s=hoy.getSeconds()
var ano = hoy.getFullYear()
var numdiames = hoy.getDate()
var nummes = hoy.getMonth()
var es,dia
var mes=new Array(12)
mes[0]="Enero"
mes[1]="Febrero"
mes[2]="Marzo"
mes[3]="Abril"
mes[4]="Mayo"
mes[5]="Junio"
mes[6]="Julio"
mes[7]="Agosto"
mes[8]="Septiembre"
mes[9]="Octuber"
mes[10]="Noviembre"
mes[11]="Diciembre"
switch (numdia){
	case 1: dia = "Lunes"
		break
	case 2: dia = "Martes"
		break
	case 3: dia = "Miércoles"
		break
	case 4: dia = "Jueves"
		break
	case 5: dia = "Viernes"
		break
	case 6: dia = "Sábado"
		break
	case 0: dia = "Domingo"
		break
	}
//ponemos cero antes
m=pon0antes(m)
s=pon0antes(s)
//checamos que estilo corresponde según la hora
/*
if(h>5 && h<9){
	es = "amanece"	
	//document.getElementById("hojaestilo").href="amanece.css"
}
else{
	if((h<6 && h>-1 )|| (h>19 && h<25)){
	es = "noche"	
	//document.getElementById("hojaestilo").href="noche.css"
	}
	else{
		if(h<12 && h>8){
		es = "mañana"
		//document.getElementById("hojaestilo").href="manana.css"
		}
		else{
			if(h<18 && h>11){
			es = "tarde"
			document.getElementById("hojaestilo").href="tarde.css"
			}
			else{
				if(h<20 && h>17){
				es = "atardecer"
				document.getElementById("hojaestilo").href="atardece.css"
				}	
			}
		}
	}
}
*/
document.getElementById('relogito').innerHTML=dia+", "+numdiames+" de "+mes[nummes]+" de "+ano+", "+h+":"+m+":"+s
t=setTimeout('iniciarrelogito()',1000)
}
function pon0antes(i){
if (i<10) 
  {i="0" + i}
  return i
}
function ponerMenuHorizontal(){
			var menuHorizontalDoc = loadXMLDoc("menuhorizontal.xml");
			var menu = get_firstchild(menuHorizontalDoc);
			var elementosmenu = menuHorizontalDoc.getElementsByTagName("elemento");
			var MenuHorizontal = "<ul>";
			for (i=0;i<elementosmenu.length;i++){
				//Display only element nodes getElementsByTagName('referencia')[0].   + elementosmenu[i].getElementsByTagName('titulo')[0].childNodes[0].nodeValue
					MenuHorizontal = MenuHorizontal + "<li><a href=\"" + elementosmenu[i].getElementsByTagName('referencia')[0].childNodes[0].nodeValue + "\">" + elementosmenu[i].getElementsByTagName('titulo')[0].childNodes[0].nodeValue  + "</a></li>";
			}
			var MenuHorizontal = MenuHorizontal + "</ul>";
			document.getElementById("MenuHorizontal").innerHTML = MenuHorizontal;
}
