﻿var isScrtolling;

function initPage() {
    isScrolling = false;
}

function scroll2Left(evt) {
    DX = 3;
    DELAY = 0;
    if (evt) {
        isScrolling = true;
    }

    if (isScrolling) {
        if (document.getElementById("div_scroller").scrollLeft > 0) {
            document.getElementById("div_scroller").scrollLeft -= DX;
            window.setTimeout("scroll2Left()", DELAY);

        }
    }
}



function scroll2Right(evt) {
    DX = 3;
    DELAY = 0;

    if (evt) {
        isScrolling = true;
    }

    if (isScrolling) {
        document.getElementById("div_scroller").scrollLeft += DX;
        window.setTimeout("scroll2Right()", DELAY);

    }

}



function scroll2LeftFaster(evt) {
    DX = 100;
    DELAY = 0;
    if (evt) {
        isScrolling = true;
    }
    if (isScrolling) {
        if (document.getElementById("div_scroller").scrollLeft > 0) {
            document.getElementById("div_scroller").scrollLeft -= DX;
            window.setTimeout("scroll2Left()", DELAY);
        }
    }
}

function scroll2RightFaster(evt) {
    DX = 100;
    DELAY = 0;

    if (evt) {
        isScrolling = true;
    }
    if (isScrolling) {
        document.getElementById("div_scroller").scrollLeft += DX;
        window.setTimeout("scroll2Right()", DELAY);
    }
}


function stopScrolling() {
    isScrolling = false;
}