// JavaScript Document

isDOM=(document.getElementById)?true:false
isNC4=(document.layers)?true:false
isIE=(document.all && document.all.item)?true:false
isOpera=isDOM && window.opera
isNC6=isDOM && !isIE && !isOpera
isMozilla=isNC6
isNC=isNC4 || isNC6 || isMozilla || isOpera
isStandard=isIE || isNC6 || isMozilla || isOpera

function setHeight(v,i){
	if(i==1)
	  v.style.height=220;
	if(i==3)
	  v.style.height=20;
}

var objWindow;
function OpenPopup(page)
{
	var width = 750;
	var height = 550;
	var url = "";
	var features = "location=no,menubar=no,resizable=yes,scrollbars=yes,status=no,titlebar=no,toolbar=no";

	if (page == "ResourceCentre")
		url = "<%= resourceCentreUrl %>";

	if (page == "PrivacyPolicy")
		url = "<%= privacyPolicyUrl %>";

	x = (640 - width)/2, y = (480 - height)/2;
	if (screen) {
		y = (screen.availHeight - height)/2;
		x = (screen.availWidth - width)/2;
	}

	features += ",width=" + width;
	features += ",height=" + height;
	features += ",screenX=" + x;
	features += ",screenY=" + y;
	features += ",top=" + y;
	features += ",left=" + x;

	//If window already open, close and reopen window (with new data), else open window.
	if (objWindow)
		if (objWindow.closed)
			objWindow = window.open(url,"ResourceCentre",features);
		else
		{
			objWindow.close();
			objWindow = window.open(url,"ResourceCentre",features);
		}
	else
	  objWindow = window.open(url,"ResourceCentre",features);
}