var uniqueWin = false;

function popup1(path,w,h,wresizeable,topPos,leftPos,wmenubar,wtoolbar,wlocation,wscrollbars,wstatus) {
	
	// Set variables for Screen Dimensions	
	var screenw = 800, screenh =600;
	if (document.all || document.layers) {
	   screenw = screen.availWidth;
	   screenh = screen.availHeight;
	}
	
	// setup defaults for everything but path, w, h
	if (wresizeable != "no") wresizeable = "yes";
	// default for centering window on screen if no position values stated
	if (!topPos) topPos = (screenh-h)/2;
	if (!leftPos) leftPos = (screenw-w)/2;
	if (wmenubar != "yes") wmenubar = "no";
	if (wtoolbar != "yes") wtoolbar = "no";
	if (wlocation != "yes") wlocation = "no";
	if (wscrollbars != "yes") wscrollbars = "yes"
	{
		w += 16; 
		h += 16;
	}
	if (wstatus != "yes") wstatus = "no";
	
	
	
	// Center Popup Window In Screen
	
	// Set window name
	var windowName = "newWin";
	// check flag for unique windows
	if ((uniqueWin != 'undefined') && (uniqueWin)) {
		winIndex = parseInt(Math.random() * 100000);
		windowName = 'window' + winIndex;
		// alert(windowName); // left in for testing purposes
	}
	
	// Open the window and set the parameters
	newWin = window.open(path,windowName,"width=" + w + ",innerwidth="+ w + ",height=" + h + ",innerHeight="+ h + ",resizable=" + wresizeable + ",top=" + topPos + ",pixelTop=" + topPos + ",left=" + leftPos + ",pixelLeft=" + leftPos + ",menubar=" + wmenubar + ",toolbar=" + wtoolbar + ",location=" + wlocation + ",scrollbars=" + wscrollbars + ",status=" + wstatus);
	
	// focus the window
	newWin.focus();
}
