// JavaScript Document

var delayb4scroll=3000;//Specify initial delay before marquee starts to scroll on page (2000=2 seconds)
var marqueespeed=1; //Specify marquee scroll speed (larger is faster 1-10)
var pauseit=1;//Pause marquee onMousever (0=no. 1=yes)?

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

var copyspeed=marqueespeed;
var pausespeed=(pauseit===0)? copyspeed: 0;
var actualheight='';
var cross_marquee,cross_marquee1;
function scrollmarquee(){
	var ontop=(parseInt(cross_marquee.style.top,10)<parseInt(cross_marquee1.style.top,10)?cross_marquee:cross_marquee1);
	var below=(parseInt(cross_marquee.style.top,10)>parseInt(cross_marquee1.style.top,10)?cross_marquee:cross_marquee1);
	actualheight=ontop.offsetHeight;
	if (parseInt(ontop.style.top,10)>(actualheight*(-1)+8)){
		ontop.style.top=parseInt(ontop.style.top,10)-copyspeed+"px";
		below.style.top=parseInt(below.style.top,10)-copyspeed+"px";
		}else{
		below.style.top=parseInt(below.style.top,10)-copyspeed+"px";
		ontop.style.top=parseInt(below.style.top,10)+8+below.offsetHeight+"px";
	}
}

function initializemarquee(){
	cross_marquee=document.getElementById("vmarquee");
	if(!cross_marquee){return;}
	cross_marquee.style.top=0;
	var marqueeheight=document.getElementById("marqueecontainer").offsetHeight;
	actualheight=cross_marquee.offsetHeight;
		if (window.opera || navigator.userAgent.indexOf("Netscape/7")!=-1){ //if Opera or Netscape 7x, add scrollbars to scroll and exit
		cross_marquee.style.height=marqueeheight+"px";
		cross_marquee.style.overflow="scroll";
		return;
		}
	//Uncomment to view movement
	//document.getElementById("marqueecontainer").style.overflow="visible";
	var m2=cross_marquee.cloneNode(true);
	m2.setAttribute("id","vmarquee1");
	var str="width:98%; position:absolute;";
	if(document.all && !window.opera) {
		m2.style.setAttribute("cssText",str);
	} else {
		m2.setAttribute("style",str);
	}
	m2.style.top=parseInt(actualheight,10)+8+"px";
	document.getElementById("marqueecontainer").appendChild(m2);
	cross_marquee1=document.getElementById("vmarquee1");
	setTimeout('lefttime=setInterval("scrollmarquee()",40)', delayb4scroll);
}

if (window.addEventListener){
window.addEventListener("load", initializemarquee, false);
}
else if (window.attachEvent){
window.attachEvent("onload", initializemarquee);
}
else if (document.getElementById){
window.onload=initializemarquee;
}
if(typeof(window.toggle_news_div)!=="function"){
	function toggle_news_div(obname){
		//alert(typeof(obname));
		//alert(obname.tagName);
		//return;
		if(typeof(obname)==="string"){
		var mdiv=document.getElementById(obname);
		}else{
			// Skip first child so start at 1 not 0
			for(var x=1;x<obname.childNodes.length;x++){
				if(obname.childNodes[x].nodeType===1&&obname.childNodes[x].tagName==="DIV"){
					var mdiv=obname.childNodes[x];
					break;
				}
			}
		}
			mdiv.style.display=(mdiv.style.display=="none"||!mdiv.style.display?"block":"none");
		var ontop=(parseInt(cross_marquee.style.top,10)<parseInt(cross_marquee1.style.top,10)?cross_marquee:cross_marquee1);
		var below=(parseInt(cross_marquee.style.top,10)>parseInt(cross_marquee1.style.top,10)?cross_marquee:cross_marquee1);
		actualheight=ontop.offsetHeight;
		below.style.top=parseInt(ontop.style.top,10)+8+ontop.offsetHeight+"px";
	}	
}