/*Original Javascript code by dynamic drive.
Cross browser Marquee II- ¿ Dynamic Drive (www.dynamicdrive.com)
For full source code, 100's more DHTML scripts, and TOS, visit http://www.dynamicdrive.com*/

// Speed settings
var scrollinterval=50; // Specify the refresh rate. This affects the speed also. Larger is slower.
var pauseit=1; //Pause marquee onmousever of text area (0=no. 1=yes)?

// Speed and size settings
var marqueespeed=1; // Specify speed (larger is faster 1-10) This is the amount of pixel movement per refresh. 1 is best for smoothness.
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;

function scrollup(){
	copyspeed=marqueespeed+3;
}
function scrolldoubledown(){
	copyspeed=marqueespeed-7;
}

var txt='';
if (iedom||document.layers){
	with (document){
		if (iedom){
			txt+='<div style="position:relative;width:'+marqueewidth+';height:'+marqueeheight+';overflow:hidden" onmouseover="copyspeed=pausespeed" onmouseout="copyspeed=marqueespeed">';
			txt+='<div id="iemarquee" style="position:absolute;left:0px;top:0px;width:100%;">';
			txt+='</div></div>';
		}
		else if (document.layers){
			txt+='<ilayer width='+marqueewidth+' height='+marqueeheight+' name="ns_marquee">';
			txt+='<layer name="ns_marquee2" width='+marqueewidth+' height='+marqueeheight+' left=0 top=0 onmouseover="copyspeed=pausespeed" onmouseout="copyspeed=marqueespeed"></layer>';
			txt+='</ilayer>';
		}
	}
}

function scrollmarquee(){
	if (iedom){
		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";
		}
	}
	else if (document.layers){
		if (ns_marquee.top>(actualheight*(-1)+8)) {
			ns_marquee.top-=copyspeed;
		}
		else {
			ns_marquee.top=parseInt(marqueeheight)+8;
		}
	}
}

function populate(){
	if (iedom){
		cross_marquee=document.getElementById? document.getElementById("iemarquee") : document.all.iemarquee;
		cross_marquee.style.top=parseInt(marqueeheight)+8+"px";
		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()",scrollinterval);
}
window.onload=populate;