
function addLoadEvent(func) {
	var oldonload = window.onload;
	if (typeof window.onload != 'function') {
		window.onload = func;
	} else {
		window.onload = function() {
		oldonload();
		func();
		}
	}
}
function rollover(ImageIndex,ImgName){
	document.images[ImageIndex].src = "global/_images/portal/" + ImgName;
}
function displayWindow() {
	var width = 1010;
  var height = 640;
	var chrome = "width=" + width + ",height=" + height + "toolbar=0,resizable=1,status=1,directories=0,menubar=0";
	chrome += ",top=" + parseInt((screen.availHeight/2) - (height/2));
	chrome += ",left=" + parseInt((screen.availWidth/2) - (width/2));
	var pageWindow = window.open(this.href,'gamewin',chrome);
	pageWindow.focus();
	return false;
}

function newWinLinks() {
	for (var i=0; i<document.links.length; i++) {
		if (document.links[i].className == "newWin") {
			document.links[i].onclick = displayWindow;
			var currenttitle = document.links[i].getAttribute("title");
			currenttitle += " (opens new window)";
			document.links[i].setAttribute("title", currenttitle);
		}
	} 
}
addLoadEvent(newWinLinks);


