var marquee;
var size;
var tickerSpeed=2;
var copySpeed = tickerSpeed;
var tickerWidth;
var tickerHeight;
var direction='horizontal';

function registerMarquee () {
    if (document.getElementById) {
        marquee = document.getElementById('ticker_list');
        if (direction=='vertical') {
/*            size = marquee.offsetHeight;
            var parent = marquee.parentNode;
            tickerHeight = parent.offsetHeight-2;
            if (tickerHeight==0) {
                tickerHeight = parent.scrollHeight;
            };
            marquee.style.top = '0px';
            parent.style.height=tickerHeight+'px';*/
        } else {
            size = marquee.scrollWidth;
            var parent = marquee.parentNode;
            tickerWidth = parent.offsetWidth-2;
            if (tickerWidth==0) {
                tickerWidth = parent.scrollWidth;
            };
            marquee.style.left = '0px';
            //parent.style.width=tickerWidth+'px';
            //parent.style.height=marquee.offsetHeight+'px';
        }
        marquee.onmouseover=function() {copySpeed=0;};
        marquee.onmouseout=function()  {copySpeed=tickerSpeed;};
        var lefttime = setInterval("scrollmarquee()", 40);
    }
    return true;
}


function scrollmarquee(){
    if (direction == 'vertical') {
/*        if (parseInt(marquee.style.top) > (size*(-1)+8)) {
          marquee.style.top=parseInt(marquee.style.top)-copySpeed+"px"
        } else {
          marquee.style.top=tickerHeight+'px';
        }*/
    } else {
        if (parseInt(marquee.style.left) > (size*(-1))) {
          marquee.style.left=parseInt(marquee.style.left)-copySpeed+"px";
        } else {
          marquee.style.left=tickerWidth+'px';
        }
    }
}

window.onload=registerMarquee;
