
function scroll_up() {
    d = document.getElementById('contentdiv');
    t = document.getElementById('contentdiv').scrollTop;
    t = parseInt(t) - 5; // this would be the pixel scroll per move
    // you will need some kind of error check here to make sure that the top of the layer
    // does not go outside your set parameters - for this example I have taken that to be 0
    if (t <= 0) { t = 0; }
    document.getElementById('contentdiv').scrollTop = t;
    timerID=setTimeout('scroll_up()',50)
}

function to_top() {
    document.getElementById('contentdiv').scrollTop = 0;
}
function scroll_down() {
    d = document.getElementById('contentdiv');
    t = document.getElementById('contentdiv').scrollTop;
    t = parseInt(t) + 5; // this would be the pixel scroll per move
    // you will need some kind of error check here to make sure that the top of the layer
    // does not go outside your set parameters - for this example this is 300
    if (t >= 400) { t = 1000 }
    document.getElementById('contentdiv').scrollTop = t;
    timerID=setTimeout('scroll_down()',50)
}
