/**
* News Scroller per notizie - Alberto Sartori, Novembre 2006
* Compatibilità:	Internet Explorer 6.X, 7
* 					Opera 6.X
*					FireFox 1.X, 2.X
*/

var scrollspeed=cache=1	//Velocità scroller
var initialdelay=1000	//Ritardo iniziale prima dell'inizio dello scroll (millisecondi)

//--------------------- DO NOT EDIT BELOW THIS LINE ---------------------

function initializeScroller() {
	dataobj=document.all? document.all.datacontainer : document.getElementById("datacontainer")
	dataobj.style.top="0px"
	setTimeout("getdataheight()", initialdelay)
}

function getdataheight() {
	thelength=dataobj.offsetHeight
	if (thelength==0)
		setTimeout("getdataheight()",10)
	else
	scrollDiv()
}

function scrollDiv() {
	dataobj.style.top=parseInt(dataobj.style.top)-scrollspeed+"px"
	if (parseInt(dataobj.style.top)<thelength*(-1))
		dataobj.style.top="0px"
	setTimeout("scrollDiv()",40)
}

if (window.addEventListener)
	window.addEventListener("load", initializeScroller, false)
else if (window.attachEvent)
	window.attachEvent("onload", initializeScroller)
else
	window.onload=initializeScroller