﻿function scrollStart(direction, divID, elementID) {
    //CHANGE THE BACKGROUND COLOR OF THE TD THE MOUSE IS OVER
    // REPEATED CALL EITHER scrollUp OR scrollDown
    ourInterval = setInterval("scroll" + direction + "('" + divID + "')", scrollSpeed);
    //alert(ourInterval);
    //alert(direction);
    //alert(divID);
    //alert(scrollSpeed);
}
function scrollEnd(which) {
    //alert('Test');
    // OUR MOUSE IS OUT, SO RETURN TD TO ORIGINAL COLOR
    // STOP CALLING THE SCROLL FUNCTION
    clearInterval(ourInterval);
}

function scrollUp(which) {
    // SET THE SCROLL TOP
    var intscrollTop;
    intscrollTop = document.getElementById(which).scrollTop;
    document.getElementById(which).scrollTop = document.getElementById(which).scrollTop - scrollHeight;
    if (intscrollTop > document.getElementById(which).scrollTop) 
    {
        return;
    }
}
function scrollDown(which) {
    // SET THE SCROLL TOP
    var intscrollTop;
    intscrollTop = document.getElementById(which).scrollTop;
    document.getElementById(which).scrollTop = document.getElementById(which).scrollTop + scrollHeight;
    if (intscrollTop < document.getElementById(which).scrollTop)
    {
        return;
    }
}