function TickerScroller(b, f, c, a) {
    this.name = b;
    this.id = f;
    this.shiftBy = c ? c : 1;
    this.interval = a ? a : 100;
    this.runId = null;
    this.div = document.getElementById(f);
    var e = this.div.firstChild;
    var d;
    while (e) {
        d = e.nextSibling;
        if (e.nodeType == 3) {
            this.div.removeChild(e)
        }
        e = d
    }
    this.left = 0;
    this.shiftLeftAt = this.div.firstChild.offsetWidth;
    this.div.style.height = this.div.firstChild.offsetHeight;
    this.div.style.width = 2 * screen.availWidth;
    this.div.style.visibility = "visible";
}
function startTicker() {
    this.stop();
    this.left -= this.shiftBy;
    if (this.left <= -this.shiftLeftAt) {
        this.left = 0;
        this.div.appendChild(this.div.firstChild);
        this.shiftLeftAt = this.div.firstChild.offsetWidth
    }
    this.div.style.left = (this.left + "px");
    this.runId = setTimeout(this.name + ".start()", this.interval)
}
function stopTicker() {
    if (this.runId) {
        clearTimeout(this.runId)
    }
    this.runId = null
}
function changeTickerInterval(a) {
    if (typeof (a) == "string") {
        a = parseInt("0" + a, 1000)
    }
    if (typeof (a) == "number" && a > 0) {
        this.interval = a
    }
    this.stop();
    this.start()
}
TickerScroller.prototype.start = startTicker;
TickerScroller.prototype.stop = stopTicker;
TickerScroller.prototype.changeInterval = changeTickerInterval;

