/*Constants and Declerations*/
var interval = 100;

/*Defenitions*/
var listTop = 0;
var theScroller = null;
var intervalID;

/*Get Stuff Going*/
function scroll_list(listName) {
    theScroller = document.getElementById(listName);
    intervalID = setInterval("scroll_step(theScroller)", interval);

    //Register events
    theScroller.onmouseover = stop_scroll;
    theScroller.onmouseout = start_scroll;
}

function scroll_step(theList) {
    if (Math.abs(listTop) < theList.children[0].clientHeight + 8) {
        theList.style.top = --listTop + "px";
    } else {
        theList.appendChild(theList.children[0]);
        theList.style.top = "-1px";
        listTop = -1;
    }
}

function stop_scroll() {
    clearInterval(intervalID);
}

function start_scroll() {
    intervalID = setInterval("scroll_step(theScroller)", interval);
}
