var vDoRo=false;
var browserN=false;
var browserIE=false;
var browserW3C=false;

if (document.layers) {
	browserN=true; // netscape4-esque
} else if (document.all) {
	browserIE=true; // ie4-5-esque
} else if (document.getElementById) {
	browserW3C=true; // w3c-compliant-esque
}

function imgOver( argImgName ){
	if( (argImgName!=vCurrPageTop) && vDoRo ){
		if( vArBtns[argImgName].over.loaded ){ //if the OVER state of that button is loaded
			document[argImgName].src = vArBtns[argImgName].over.src;
		}
	}
}
		
function imgOut( argImgName ){
	if( (argImgName!=vCurrPageTop) && vDoRo ){
		document[argImgName].src = vArBtns[argImgName].off.src;
	}
}

function txtOver(){
	this.style.textDecoration="underline";
	this.style.color="#CE1126";
}

function txtOverNav(){
	this.style.textDecoration="none";
	this.style.color="#CE1126";
}
function txtOut(){this.style.color="999999";}

function txtOutNav(){this.style.color="#999999";}

//this hack is necessary since NS6 PC has a problem with the predefined image object's complete property
function fImgLoaded(){this.loaded=true;}

function fLoaded(){
/*	if( document.images ){
		vArBtns = new Object();
		for(i=0; i<document.images.length; i++){
			if( document.images[i].name ){ //if that image has a NAME, we assume it has a rollover effect
				var vSrc = new String(document.images[i].src);
				var vIndexDot = vSrc.lastIndexOf(".");
				if(document.images[i].name == vCurrPageTop){
					document.images[i].src = vSrc.slice(0,vIndexDot) + "_curr" + vSrc.slice(vIndexDot);
				}else{
					vArBtns[document.images[i].name] = new Object();
					vArBtns[document.images[i].name].off = new Image();
					vArBtns[document.images[i].name].off.src = vSrc;

					vArBtns[document.images[i].name].over = new Image();
					vArBtns[document.images[i].name].over.loaded=false;
					vArBtns[document.images[i].name].over.onload=fImgLoaded;
					vArBtns[document.images[i].name].over.src = vSrc.slice(0,vIndexDot) + "_o" + vSrc.slice(vIndexDot);
				}
			}
		}
		vDoRo=true;
	} */

	if(!browserN){
		//the text rollover effect
		var arLinks=document.getElementsByTagName("a");
		for(var i=0; i<arLinks.length; i++){
			var navLink = arLinks[i].name;
			if(navLink.substr(0,4)!='Nav_'){
				if(!arLinks[i].onmouseover){
					//arLinks[i].onmouseover=txtOver;
					//arLinks[i].onmouseout=txtOut;
				}
			}
			else
			{
				if(!arLinks[i].onmouseover){
					arLinks[i].onmouseover=txtOverNav;
					arLinks[i].onmouseout=txtOutNav;
				}

			}
		}
		
		//netscape4 poorly supports this style so we dynamically apply it to everybody else
		//document.forms.searchform["q"].style.borderWidth = "1px";
	}
}

function stockpop_window(url) {
	if(navigator.userAgent.indexOf("MSIE") == -1) {
		newwindow = window.open(url,'stockpop','toolbar=0,location=0,directories=0,status=0,menubar=0,scrollbars=0,resizable=1,width=300,height=275');
 		newwindow.focus();
 	 } else {
 window.open(url,'stockpop','toolbar=0,location=0,directories=0,status=0,menubar=0,scrollbars=0,resizable=1,width=300,height=275');
}
}

function popWindow(mypage,myname,w,h,scroll) {

	settings='height='+h+',width='+w+',scrollbars='+scroll+',toolbar=no,location=no,status=no,menubar=no,resizable=yes,dependent=no'
	
	if(navigator.userAgent.indexOf("MSIE") == -1) {
		newwindow = window.open(mypage,myname,settings);
 		newwindow.focus();
 	 } else {
 window.open(mypage,myname,settings);
}
}

function Start(page) {

OpenWin = this.open(page, "CtrlWindow", "toolbar=no,menubar=yes,location=no,scrollbars=yes,width=525,height=600,resizable=yes");

}
