/* LYONESS Newsticker v1.01                                          (c)by.martin@2009 */

var step = 1;       // in pixels
var stepSize = 30;  // in milliseconds

function marqueeText(ticker) {
    var text = ticker.firstChild.nextSibling;
    text.style.left = ticker.offsetWidth + "px";
    text.matchingTicker = ticker;

    ticker.stop = false;
    ticker.style.visibility = "visible";
    text.intVal = window.setInterval(function() { stepLeft(text); }, stepSize);
}

function stepLeft(el) {
    if (!el.matchingTicker.stop) {        
        el.style.left = (el.offsetLeft - step) + "px";
        if (el.offsetLeft < (el.offsetWidth * -1)) {
            el.style.left = el.matchingTicker.offsetWidth + "px";
        }
    }
}

function startTicker() {
    var ticker = document.getElementById('newsticker');
    ticker.onmouseover = function() { ticker.stop = true; }
    ticker.onmouseout = function() { ticker.stop = false; }
    marqueeText(ticker);
}