//local data
var delay= 500;
var restart = 50;
var speed = 1;
var cache = 1;
var height;
var object;
var tmout = 50;
var dx = 50;


//we need the event to be installed
if (window.addEventListener)
	window.addEventListener("load", init, false)
else if (window.attachEvent)
	window.attachEvent("onload", init)
else
	window.onload = init;

//Initialize the scroller
function init()
{
	//Now initialize the variables
	object = document.all? document.all.scroller : document.getElementById("scroller");
	get_height();
	object.style.top= restart + "px";
	setTimeout("get_height()", delay);
	restart = height / 2;
}

function get_height()
{
	height = object.offsetHeight;
	dx = height / 2;
	if (height==0)
	{	
		height = 10;
		setTimeout("get_height()",10);
	}
	else
		scroll();
}

function scroll()
{
	
	object.style.top = (parseInt(object.style.top) - speed) + "px";

	if (parseInt(object.style.top) < - height)
		object.style.top = restart + "px";
	
	setTimeout("scroll()",40);
}
