// WebTicker by Mioplanet
// www.mioplanet.com

var TICKER_CONTENT = document.getElementById("TICKER").innerHTML;

var TICKER_RIGHTTOLEFT = false;
var TICKER_SPEED = 2;
var TICKER_STYLE = "font-family:Arial; font-size:12px; color:#444444";
var TICKER_PAUSED = false;

ticker_start();

function ticker_start()
{
	var ticker;
    var tickerSupported = false;
    TICKER_WIDTH = document.getElementById("TICKER").style.width;
    var img = "<img src=ticker_space.gif width=" + TICKER_WIDTH + " height=0>";

    // Firefox
    if (navigator.userAgent.indexOf("Firefox") != - 1 || navigator.userAgent.indexOf("Safari") != - 1 || navigator.userAgent.indexOf("Mozilla") != - 1 )
    {
        ticker = document.getElementById("TICKER");
        ticker.innerHTML = "<TABLE  cellspacing='0' cellpadding='0' width='100%'><TR><TD nowrap='nowrap'>"
            + img + "<SPAN style='" + TICKER_STYLE + "' ID='TICKER_BODY' width='100%'>&nbsp;</SPAN>" + img
            + "</TD></TR></TABLE>";
        tickerSupported = true;
    }

    // IE
    if (navigator.userAgent.indexOf("MSIE") != - 1 && navigator.userAgent.indexOf("Opera") == - 1)
    {
        ticker = document.getElementById("TICKER");
        ticker.innerHTML = "<DIV nowrap='nowrap' style='width:100%;'>" + img
            + "<SPAN style='" + TICKER_STYLE + "' ID='TICKER_BODY' width='100%'></SPAN>" + img + "</DIV>";
        tickerSupported = true;
    }

    if (! tickerSupported)
    {
    	ticker = document.getElementById("TICKER");
        ticker.outerHTML = "";
    }
    else
    {
        ticker = document.getElementById("TICKER");
        ticker.scrollLeft = TICKER_RIGHTTOLEFT
            ? ticker.scrollWidth - ticker.offsetWidth
            : 0;
        document.getElementById("TICKER_BODY").innerHTML = TICKER_CONTENT;
        ticker.style.display = "block";
        TICKER_tick();
    }
}

function TICKER_tick()
{
    var ticker = document.getElementById("TICKER");
    if (! TICKER_PAUSED)
    {
        ticker.scrollLeft += TICKER_SPEED * (TICKER_RIGHTTOLEFT ? - 1 : 1);
    }
    if (TICKER_RIGHTTOLEFT && document.getElementById("TICKER").scrollLeft <= 0)
    {
        ticker.scrollLeft = ticker.scrollWidth - ticker.offsetWidth;
    }
    if (! TICKER_RIGHTTOLEFT && ticker.scrollLeft
            >= ticker.scrollWidth - ticker.offsetWidth)
    {
        ticker.scrollLeft = 0;
    }
    window.setTimeout("TICKER_tick()", 30);
}