﻿function AgregarFavoritos(Url, Titulo) {
    if (window.sidebar && window.sidebar.addPanel)
        window.sidebar.addPanel(Titulo, Url, "");
    else window.external.AddFavorite(Url, Titulo);
}

function esIE() {
    nNav = navigator.appName;
    if (nNav == 'Microsoft Internet Explorer') return true;
    else return false;
}

function FechaHoy() {
    var Hoy = new Date();
    var year = Hoy.getFullYear()
    var day = Hoy.getDay()
    var month = Hoy.getMonth()
    var daym = Hoy.getDate()
    //var dayarray = new Array("Domingo", "Lunes", "Martes", "Miércoles", "Jueves", "Viernes", "Sábado")
    var montharray = new Array("enero", "febrero", "marzo", "abril", "mayo", "junio", "julio", "agosto", "septiembre", "octubre", "noviembre", "diciembre");
    document.write(daym + " de " + montharray[month] + " de " + year);
}

HMarquee = function (id, speed, pause, WidthForIE) {
    var container = document.getElementById(id);
    var _timer;
    var Width = parseInt(container.scrollWidth);
    if (esIE()) Width = WidthForIE;
    var scrollSpeed = (parseInt(speed) > 0) ? speed : 30;
    var Pause = (parseInt(pause) > 0) ? pause : scrollSpeed;

    Right = function () {
        if (container.scrollLeft > Width) {
            window.setTimeout(Right, Pause);
            container.scrollLeft = Width;
        } else container.scrollLeft += 2;
    }
    Left = function () {
        if (container.scrollLeft <= 0) {
            //Left();
            window.setTimeout(Left, Pause);
            container.scrollLeft = 1;
        } else container.scrollLeft -= 2;
    }
    goLeft = function () {
        _timer = window.setInterval(Left, scrollSpeed);
    }
    goRight = function () {
        _timer = window.setInterval(Right, scrollSpeed);
    }
    stop = function () {
        if (_timer) window.clearInterval(_timer);
    }
}

