// JavaScript Document

//Specify the marquee's width (in pixels)
var marqueewidth="305px"
//Specify the marquee's height
var marqueeheight="75px"
//Specify the marquee's marquee speed (larger is faster 1-10)
var marqueespeed='3'
//Pause marquee onMousever (0=no. 1=yes)?
var pauseit=1

////NO NEED TO EDIT BELOW THIS LINE////////////

marqueespeed=(document.all)? marqueespeed : Math.max(1, marqueespeed-1) //slow speed down by 1 for NS
var copyspeed=marqueespeed
var pausespeed=(pauseit==0)? copyspeed: 0
var iedom=document.all||document.getElementById
var actualheight=''
var cross_marquee, ns_marquee

if(document.layers){
	document.write('<ilayer width='+marqueewidth+' height='+marqueeheight+' name="ns_marquee">')
	document.write('<layer name="ns_marquee2" width='+marqueewidth+' height='+marqueeheight+' left=0 top=0 onMouseover="copyspeed=pausespeed" onMouseout="copyspeed=marqueespeed"></layer>')
	document.write('</ilayer>')
	ns_marquee=document.ns_marquee.document.ns_marquee2
	ns_marquee.top=parseInt(marqueeheight)+8
	ns_marquee.document.write(marqueecontent)
	ns_marquee.document.close()
	actualheight=ns_marquee.document.height
}

function populate(){


	if (iedom||document.layers){
		with (document){
			if (iedom){
				newX = findPosX('scrollx');
				newY = findPosY('scrollx');
				//document.write('<div id="iemarquee" style="position:absolute;width:'+marqueewidth+';height:'+marqueeheight+';overflow:hidden;top:'+newY+';left:'+newX+';" onMouseover="copyspeed=pausespeed" onMouseout="copyspeed=marqueespeed">')
				//document.write('</div>')
			}
			else if (document.layers){
				//write('<ilayer width='+marqueewidth+' height='+marqueeheight+' name="ns_marquee">')
				//write('<layer name="ns_marquee2" width='+marqueewidth+' height='+marqueeheight+' left=0 top=0 onMouseover="copyspeed=pausespeed" onMouseout="copyspeed=marqueespeed"></layer>')
				//write('</ilayer>')
			}
		}
	}
	


if (iedom){
cross_marquee=document.getElementById? document.getElementById("iemarquee") : document.all.iemarquee
divcontrolX = document.getElementById? document.getElementById("divcontrol") : document.all.divcontrol
//cross_marquee.style.top = newY + 21;
//cross_marquee.style.left = newX + 7;
divcontrolX.style.top = newY + 21;
divcontrolX.style.left = newX + 7;
//cross_marquee.style.top=parseInt(marqueeheight)+8+"px"
//divcontrolX.style.top=parseInt(marqueeheight)+8+"px"
cross_marquee.style.visibility="hidden";
cross_marquee.innerHTML=marqueecontent
actualheight=cross_marquee.offsetHeight

}
else if (document.layers){
//ns_marquee=document.ns_marquee.document.ns_marquee2
//ns_marquee.top=parseInt(marqueeheight)+8
//ns_marquee.document.write(marqueecontent)
//ns_marquee.document.close()
//actualheight=ns_marquee.document.height
}

lefttime=setInterval("scrollmarquee()",100)
}
//window.onload=populate

function scrollmarquee(){



if (iedom){
	newX = findPosX('scrollx');
	newY = findPosY('scrollx');
	divcontrolX.style.top = newY + 21;
	divcontrolX.style.left = newX + 7;
	if (parseInt(cross_marquee.style.top) > (actualheight*(-1)+8)){
		cross_marquee.style.top=parseInt(cross_marquee.style.top)-copyspeed+"px"
	}else{
		cross_marquee.style.top=parseInt(marqueeheight)+8+"px"
	}
	cross_marquee.style.visibility="visible";
}else if (document.layers){
	if (ns_marquee.top>(actualheight*(-1)+8))
		ns_marquee.top-=copyspeed
	else
		ns_marquee.top=parseInt(marqueeheight)+8
	}
}


function findPosX(obj)
{
	var curleft = 0;
	if( typeof obj == "string" ) {

        obj = document.getElementById( obj );
     }
	 if( obj == null ) {
		 alert( "Object not found." );
	 }
	if (document.getElementById || document.all)
	{
		while (obj.offsetParent)
		{
			curleft += obj.offsetLeft
			obj = obj.offsetParent;
		}
	}
	else if (document.layers)
		curleft += obj.x;
	return curleft;
}

function findPosY(obj)
{
	var curtop = 0;
	var printstring = '';
	if( typeof obj == "string" ) {

        obj = document.getElementById( obj );
     }
	if (document.getElementById || document.all)
	{
		while (obj.offsetParent)
		{
			//printstring += ' element ' + obj.tagName + ' has ' + obj.offsetTop;
			curtop += obj.offsetTop
			obj = obj.offsetParent;
		}
	}
	else if (document.layers)
		curtop += obj.y;
	//window.status = printstring;
	return curtop;
}

