﻿var keepMoving = true;

function moveLeft() {
    if (keepMoving) {
        var scroller = document.getElementById('scroller');
        if (typeof (scroller.style.pixelRight) !== 'undefined') {
            if (scroller.style.pixelRight < containerWidth) {
                scroller.style.pixelRight += speed;
            }
        }
        else {
            if (scroller.runtimeLeft > (0 - containerWidth)) {
                scroller.runtimeLeft -= speed;
                scroller.style.left = scroller.runtimeLeft + 'px';
            }
        }
        setTimeout("moveLeft();", 50);
    }
}
function moveRight() {
    if (keepMoving) {
        var scroller = document.getElementById('scroller');
        if (typeof (scroller.style.pixelRight) !== 'undefined') {
            if (scroller.style.pixelRight > 0) {
                scroller.style.pixelRight -= speed;
            }
        }
        else {
            if (!scroller.runtimeLeft) scroller.runtimeLeft = 0;
            if (scroller.runtimeLeft < 0) {
                scroller.runtimeLeft += speed;
                scroller.style.left = scroller.runtimeLeft + 'px';
            }
        }
        setTimeout("moveRight();", 50);
    }
}
function stopMove() {
    keepMoving = false;
    var scroller = document.getElementById('scroller');
}
function SetScroller() {
    var scroller = document.getElementById('scroller');
    if (typeof (scroller.style.pixelRight) !== 'undefined') {
        scroller.style.pixelRight = 230;
    }
    else {
        scroller.runtimeLeft = -230;
        scroller.style.left = scroller.runtimeLeft + 'px';
    }
}
            
