var t = 0;
var timeOutUpObj = null;
var timeOutDownObj = null;
var timeOutDelay = 25;
var scrollPixels = 3;
var scrollableElementId;
	
function getObject(id) 
{
	var object = null;
		
	if( document.layers ) {   
		object = document.layers[id];
	} else if( document.all ) {
		object = document.all[id];
	} else if( document.getElementById ) {
		object = document.getElementById(id);
	}
		
	return object;
}
	
function moveUp() {
	up();
	timeOutUpObj = setTimeout("moveUp()", timeOutDelay);
}
		
function moveDown() {
	down();
	timeOutDownObj = setTimeout("moveDown()", timeOutDelay);
}
	
function stopMoving(timeOutObj) {
	clearTimeout(timeOutObj);
}


function up()
{
	t += scrollPixels;

	with(getObject(scrollableElementId))
	{
		if (-t <= 0)
			t = 0;

		if(style)
			style.top = t + "px";
		else
			setAttribute("style", "top: " + t + "px");
	}
}
	
function down()
{
	t -= scrollPixels;
	
	with(getObject(scrollableElementId))
	{
		if(t < parentNode.clientHeight - clientHeight)
			t =  parentNode.clientHeight - clientHeight;
		
		if(style)
			style.top = t + "px";
		else 
			setAttribute("style", "top: " + t + "px");
	}
}