﻿function esIE() {
    nNav = navigator.appName;
    if (nNav == 'Microsoft Internet Explorer') return true;
    else return false;
}

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);
    }
}

function AgregarFavoritos(Url, Titulo) {
    if (window.sidebar && window.sidebar.addPanel)
        window.sidebar.addPanel(Titulo, Url, "");
    else window.external.AddFavorite(Url, Titulo);
}
