//This is the master JavaScript file for pete web site.

function popawindie(arg1,arg2,popwhat,centerH,showStatusBar,forceVScr) {
	screenW = 640;
	screenH = 480;
	//alert(popwhat);
	if (parseInt(navigator.appVersion)>3) {
	 screenW = screen.width;
	 screenH = screen.height;
	}
	else if (navigator.appName == "Netscape" 
	    && parseInt(navigator.appVersion)==3
	    && navigator.javaEnabled()
	   ) 
	{
		jToolkit = java.awt.Toolkit.getDefaultToolkit();
		jScreenSize = jToolkit.getScreenSize();
		screenW = jScreenSize.width;
		screenH = jScreenSize.height;
	}
	/* now we need to determine ideal window size to use for this
	 picture, taking into account the screen size of the user and
	 whether or not scrollbars will be present... */
	/* some constants */
	var xmargin = 8; /* white space between picture and inside border of window */
	var xtitle = 26;  /* height of title bar */
	var xborder = 6;  /* thickness of a window border */
	var xscrllbar = 17;  /* scrollbar width */
	/* calc OUTSIDE size of window needed... */
	var psizeW = arg1+(2*xmargin)+(2*xborder)+6; /* need the damn 6 */
	var psizeH = arg2+(2*xmargin)+xtitle+xborder+15; /* need the damn 15 */
	hScrll = (psizeW > screenW);  /* hScrll = TRUE: have horz scrollbar */
	vScrll = (psizeH > screenH);  /* vScrll = TRUE: have vert scrollbar */
	if (forceVScr) {
		vScrll = 1;
		psizeH = psizeH-(2*xmargin)-15-xborder;
	}
	if (vScrll) {
		psizeW = psizeW + xscrllbar;
	}
	if (psizeW > screenW) {
		psizeW = screenW;
	}
	windW = psizeW - (2*xborder);
	if (hScrll) {
		psizeH = psizeH + xscrllbar;
	}
	if (psizeH > screenH) {
		psizeH = screenH;
	}
	windH = psizeH - xtitle - xborder;
	var xTop = (screenH-psizeH)/2;
	if (xTop <= 0) {
		xTop = 0;
	}
	var xLeft = (screenW-psizeW)/2
	if (xLeft < 0) {
		xLeft = 0;
	}  else {
		if (!centerH) {
			if (xLeft > 20) {
				xLeft = 20;
			}
		}
	}
	if (hScrll || vScrll) {
		arg3 = "width="+windW+",height="+windH+",left="+xLeft+",top="+xTop+",toolbar=no,location=no,resizable=yes,scrollbars=yes";
		if (showStatusBar) {
			arg3 = arg3 + ",status=yes";
		} 
	} else {
	arg3 = "width="+windW+",height="+windH+",left="+xLeft+",top="+xTop+",toolbar=no,location=no,resizable=yes,scrollbars=no" 
		if (showStatusBar) {
			arg3 = arg3 + ",status=yes";
		} 
	}
	// alert(arg3);
	var mapWindow1 = window.open(popwhat,'_blank',arg3);
}


