var WindowObjectReference = null; // global variable

function openRequestedPopup(strUrl, strWindowName, width, height){
	var wleft = parseInt((screen.availWidth/2) - (width/2));
	var wtop = parseInt((screen.availHeight/2) - (height/2));
	
	// IE5 and other old browsers might allow a window that is partially offscreen or wider than the screen. Fix that.
	if (wleft < 0) {
		w = screen.width; wleft = 0;
	}
	if (wtop < 0) {
		h = screen.height; wtop = 0;
	}
	
	if(WindowObjectReference == null || WindowObjectReference.closed){
		WindowObjectReference = window.open(strUrl, strWindowName, "width=" + width + ",height=" + height + ",menubar=1,resizable=no,left=" + wleft + ",top=" + wtop + ",scrollbars=yes,status=yes");
	}else{
		WindowObjectReference.focus();
	};
}