//handles scrolling content in a page without using scrollbars
//originally derived from a dynamic drive script (www.dynamicdrive.com)

//movedown:
// 1)stop moving down if moveupvar is active
// 2)create scrAmt variable that tells the function when to stop
//   a) last number in scrAmt increases extra space at bottom when scroll stops
// 3)set new top value to the current top value minus speed variable until less than scrAmt

//moveup:
// 1)stop moving up if movedownvar is active
// 2)decrease content.style.top variable until it equals 0

//stopscroll:
// 1)stops the scrolling

//movetop:
// 1)moves the content to the top of content area

//choose IE or NS/FF object type
var scrobj=document.getElementById 
	? document.getElementById("scrollablecontent")
	: document.all.scrollablecontent;
var contentheight=scrobj.offsetHeight;
var speed=4;
var topspeed=10;

function movedown(){
	if (window.moveupvar) clearTimeout(moveupvar);
	var scrAmt = contentheight*(-1)+335;
	if ( parseInt(scrobj.style.top) >= scrAmt ) scrobj.style.top=parseInt(scrobj.style.top)-speed+"px";
	movedownvar=setTimeout("movedown()",50);
}

function moveup(){
	if (window.movedownvar) clearTimeout(movedownvar);
	if (parseInt(scrobj.style.top)<=0) scrobj.style.top=parseInt(scrobj.style.top)+speed+"px";
	moveupvar=setTimeout("moveup()",50);
}

function stopscroll(){
	if (window.moveupvar) clearTimeout(moveupvar);
	if (window.movedownvar) clearTimeout(movedownvar);
}

function movetop(){
	stopscroll();
	scrobj.style.top=0+"px";
}

function getcontent_height(){
	contentheight=scrobj.offsetHeight;
	//alert(contentheight);
}

/*
function scrollFaster() {
	if (speed < 10) speed++; 
	else alert("You are at the maximum speed");	
}

function scrollSlower() {
	if (speed > 1) speed--;
	else alert("You are at the minimum speed");
}

function scrollFF() {
	if (window.movedownvarRW) clearTimeout(movedownvarRW);
	if (parseInt(scrobj.style.top)<=0) scrobj.style.top=parseInt(scrobj.style.top)+topspeed+"px";
	moveupvarFF=setTimeout("scrollFF()",5);
}

function scrollRW() {
	if (window.moveupvarFF) clearTimeout(moveupvarFF);
	var scrAmt = contentheight*(-1)+335;
	if ( parseInt(scrobj.style.top) >= scrAmt ) scrobj.style.top=parseInt(scrobj.style.top)-topspeed+"px";
	movedownvarRW=setTimeout("scrollRW()",5);
}
*/
