var count = 1;
var tickerOver = false;
var interval = 5000;
function setupTicker() {
    if (Fx) {
        theTicker = $("ticker");
        theTickerScroller = $("tickerScroller");
        theTicker.className += " enabled";
        theTicker.onmouseover = function() {
            tickerOver = true;
        }
        theTicker.onmouseout = function() {
            tickerOver = false;
        }
        theLIs = theTickerScroller.getElementsByTagName("li");
        tEffect = new Fx.Style(theTickerScroller, "opacity", {duration:500, onComplete:function() {
            newTop = "-" + (20 * count);
            if (this.to == 0) {
                theTickerScroller.style.top = newTop + "px"
                tEffect.custom(0,1);
                count++;
            }
 
 
        }});
        setInterval(tick, interval);
    }
}
 
 
function tick() {
    if (!tickerOver) {
        if (count < theLIs.length) {
            tEffect.custom(1,0);
        } else {
            count = 0;
            tick();
        }
    }
}
window.addEvent("domready", setupTicker);