// VENTANA POPUP DOCUMENTOS//

var num=Math.floor (Math.random()*1000000);
function popupdocs(p, l, t, w, h) {
 var windowprops = "location=no,scrollbars=no,menubars=no,toolbars=no,resizable=no" + ",left=" + l + ",top=" + t + ",width=" + w + ",height=" + h;
 var URL = p;
 popup = window.open(URL,"MenuPopup1",windowprops);
}

// VENTANA POPUP MENSAJES//

var num=Math.floor (Math.random()*1000000);
function popupmsgs(p, l, t, w, h) {
 var windowprops = "location=no,scrollbars=no,menubars=no,toolbars=no,resizable=no" + ",left=" + l + ",top=" + t + ",width=" + w + ",height=" + h;
 var URL = p;
 popup = window.open(URL,"MenuPopup2",windowprops);
}

// VENTANA POPUP BIBLICO//

var num=Math.floor (Math.random()*1000000);
function popupbiblico(p, l, t, w, h) {
 var windowprops = "location=no,scrollbars=yes,menubars=no,toolbars=no,resizable=no" + ",left=" + l + ",top=" + t + ",width=" + w + ",height=" + h;
 var URL = p;
 popup = window.open(URL,"MenuPopup3",windowprops);
}

// VENTANA POPUP AGENDA//

var num=Math.floor (Math.random()*1000000);
function popupagenda(p, l, t, w, h) {
 var windowprops = "location=no,scrollbars=yes,menubars=no,toolbars=no,resizable=no" + ",left=" + l + ",top=" + t + ",width=" + w + ",height=" + h;
 var URL = p;
 popup = window.open(URL,"MenuPopup3",windowprops);
}

// VENTANA POPUP PUBLICACIONES//

var num=Math.floor (Math.random()*1000000);
function popuppublicaciones(p, l, t, w, h) {
 var windowprops = "location=no,scrollbars=yes,menubars=no,toolbars=no,resizable=no" + ",left=" + l + ",top=" + t + ",width=" + w + ",height=" + h;
 var URL = p;
 popup = window.open(URL,"MenuPopup3",windowprops);

}

// CUENTA REGRESIVA//

function getTime() {
now = new Date();
y2k = new Date("May 24 2006 00:00:00");
days = (y2k - now) / 1000 / 60 / 60 / 24;
daysRound = Math.floor(days);
hours = (y2k - now) / 1000 / 60 / 60 - (24 * daysRound);
hoursRound = Math.floor(hours);
minutes = (y2k - now) / 1000 /60 - (24 * 60 * daysRound) - (60 * hoursRound);
minutesRound = Math.floor(minutes);
seconds = (y2k - now) / 1000 - (24 * 60 * 60 * daysRound) - (60 * 60 * hoursRound) - (60 * minutesRound);
secondsRound = Math.round(seconds);
sec = (secondsRound == 1) ? " segundo" : " segundos";
min = (minutesRound == 1) ? " minuto" : " minutos, ";
hr = (hoursRound == 1) ? " hora" : " horas, ";
dy = (daysRound == 1)  ? " día" : " días, "
document.timeForm.input1.value = "     Faltan " + daysRound  + dy + hoursRound + hr + minutesRound + min + secondsRound + sec + "!";
newtime = window.setTimeout("getTime();", 1000);
}

// BOTONERA MENU//

function MenuHover(obj){
    if(document.all){
        UL = obj.getElementsByTagName('ul');
        if(UL.length > 0){
            sousMenu = UL[0].style;
            if(sousMenu.display == 'none' || sousMenu.display == ''){
                sousMenu.display = 'block';
            }else{
                sousMenu.display = 'none';
            }
        }
    }
}

function MenuSetHover(){
    LI = document.getElementById('menu').getElementsByTagName('li');
    nLI = LI.length;
    for(i=0; i < nLI; i++){
        LI[i].onmouseover = function(){
            MenuHover(this);
        }
        LI[i].onmouseout = function(){
            MenuHover(this);
        }
    }
}