// JavaScript Document
/***********************************************
* IFRAME Scroller script- © Dynamic Drive DHTML code library (www.dynamicdrive.com)
* This notice MUST stay intact for legal use
* Visit Dynamic Drive at http://www.dynamicdrive.com/ for full source code
***********************************************/

//Specify speed of scroll. Larger=faster (ie: 5)
var scrollspeed=cache=(document.all)?8:2

//Specify intial delay before scroller starts scrolling (in miliseconds):
var initialdelay=5000
var nodeWalker=0	// used to scroll from node-to-node in the news scroller

function initializeScroller(){
//alert(document.all?"document.all":"getElementById");
try{
	dataobj=document.all? document.frames("datamain").document.all.datacontainer : document.getElementById("datamain").contentDocument.getElementById("datacontainer")
	setTimeout("getdataheight()", initialdelay)
	dataobj.style.top="5px"
}
catch(e){
}
}

function getdataheight(){
thelength=dataobj.offsetHeight
if (thelength==0)
setTimeout("getdataheight()",20)
else
scrollDiv()
}

function scrollDiv(){
var dataobj_a
try{
	dataobj_a=dataobj.childNodes[nodewalker++]
}
catch(e){
	dataobj_a=dataobj.childNodes[1]
}
dataobj.style.top=parseInt(dataobj.style.top)-scrollspeed+"px"

//dataobj.style.top=dataobj_a.style.y+"px"
//alert(thelength)
//alert(dataobj.style.top)
//alert(parseInt(dataobj.style.top)+" scroll contents top is above scroll contents length "+(thelength*(-1)))
//alert(parseInt(dataobj.style.top)+" scroll contents top is above scroll contents length "+(dataobj.offsetHeight*(-1)))

if (parseInt(dataobj.style.top)<thelength*(-1))
dataobj.style.top="5px"
setTimeout("scrollDiv()",(document.all)?750:250)
}

if (window.addEventListener)
window.addEventListener("load", initializeScroller, false)
else if (window.attachEvent)
window.attachEvent("onload", initializeScroller)
else
window.onload=initializeScroller
