function popWindow(pUrl, pw, ph) {
// function pops a window given a url, width and height, and centers it in the monitor

sw = screen.availWidth;
sh = screen.availHeight;
   
leftpos = (sw - pw) / 2;
toppos = (sh - ph) / 2;
 
if (!popwin || popwin.closed) {
	pStr = "left=" + leftpos + ",top=" + toppos + ",width=" + pw + ",height=" + ph + ",scrollbars=yes";
	var popwin = window.open(pUrl,"popup",pStr);
	} else {
		popwin.location = pUrl;
		popwin.focus();
	}
}

