//maked all added functions work onload. at the end of each function you want to work onload add addLoadEvent(function); to the end of the function.
function addLoadEvent(func) {
	var oldonload = window.onload;
	if (typeof window.onload != 'function') {
		window.onload = func;
	} else {
		window.onload = function() {
			oldonload();
			func();
		}
	}
}

// The following two functions make it possible to have web standard popups
window.onload = function() {
  if (!document.getElementsByTagName) return false;
  var lnks = document.getElementsByTagName("a");
  for (var i=0; i<lnks.length; i++) {
    if (lnks[i].className == "popup") {
      lnks[i].onclick = function() {
        popUp(this.getAttribute("href"));
        return false;
      }
    }
  }
}

function popUp(winURL) {
  window.open(winURL,"popup");
}

//-- Create a :Hover psuedo attribute for IE for header -- //
hdrHover = function() {
	if (document.getElementById('headerNav') != null) {
		if((document.all)&&(document.getElementById)) {
			var hdrCat = document.getElementById("headerNav").getElementsByTagName("li");
			var form = document.getElementById("frmSearch");
			for (var i=0; i<hdrCat.length; i++) {
				hdrCat[i].onmouseover=function() {
					this.className+=" hdrhover";
					if ((this.id == 'pt') || (this.id == 'sl')) {
						form.style.display = "none";
					}
				}
				hdrCat[i].onmouseout=function() {
					this.className=this.className.replace(new RegExp(" hdrhover\\b"), "");
					form.style.display = "block";
				}
			}
		}	else {
			var hdrCat = document.getElementById("headerNav").getElementsByTagName("li");
			var form = document.getElementById("frmSearch");
			for (var i=0; i<hdrCat.length; i++) {
				hdrCat[i].onmouseover=function() {
					if ((this.id == 'pt') || (this.id == 'sl')) {
						form.style.display = "none";
					}
				}
				hdrCat[i].onmouseout=function() {
					form.style.display = "block";
				}
			}
		}
	}
}
addLoadEvent(hdrHover);

//add print link
function addPrintLink() {
  if(!document.getElementById) return false;
  if(!document.getElementById('ptplnk')) return false;
	var printButton = document.getElementById('ptplnk');
	printButton.onclick=function() {
		window.print(); return false;
	}
}
addLoadEvent(addPrintLink);

//**************************************************Add swfobject flash call**************************************************//
function initializeFlash() {
	if (!document.getElementById) return false;
	if (!document.getElementById('flashVarsityValor')) return false;
	var so = new SWFObject("/swf/player.swf", "varsityValor", "290", "24", "8", "#fff");
	so.addParam("wmode", "transparent");
	so.addVariable("FlashVars", "playerID=1&amp;soundFile=/swf/varsity_valor.wma");
	so.write("flashVarsityValor");
}
addLoadEvent(initializeFlash);  