
var scrolling = 0;	// Controls whether the layer is scrolling or not
var yT = 0;	// Pixel position the top of the scrolling layer should be set to
var lT = 0;	// Initial position for the top of the layer
var yI = 15;// Increment that the scrolling layer should move at
var yH = 0;	// Hight of scrollling layer
var box = null;	// Stores the generic DOM for the scrolling layer to access style properties


function startScroll(boxID,direction) {
box = document.getElementById(boxID);
scrolling = 1;
do_scroll(direction);
}

function do_scroll(direction) {
if (scrolling == 1){
if(direction == 1){
yT = yT + yI;
box.scrollTop = yT;
if(box.scrollTop < yT){
yT = box.scrollTop;
scolling = 0;
}
}else{
yT -= yI;
box.scrollTop = yT;
if(box.scrollTop > yT){
yT = box.scrollTop;
scolling = 0;
}
}
code2run = 'do_scroll('+ direction + ')';
setTimeout(code2run,0);
}
return false;
}

function stopScroll() {
scrolling = 0;
return false;
}

function BOTTOM(boxID) {
var box = document.getElementById(boxID);
yH = 999999;
box.scrollTop = yH;
}

function TOP(boxID,frameName) {
var box = document.getElementById(boxID);
box.scrollTop = lT;
}