var uniqueWin = false;


function popupform(path,w,h,wresizeable,wtop,wleft,wmenubar,wtoolbar,wlocation,wscrollbars,wstatus) {
	// setup defaults for everything but path, w, h
	if (wresizeable != "no") wresizeable = "yes";
	if (!wtop) wtop = 20;
	if (!wleft) wleft = 20;
	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";
	
	// 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=" + wtop + ",pixelTop=" + wtop + ",left=" + wleft + ",pixelLeft=" + wleft + ",menubar=" + wmenubar + ",toolbar=" + wtoolbar + ",location=" + wlocation + ",scrollbars=" + wscrollbars + ",status=" + wstatus);
	
	// focus the window
	newWin.focus();
}


/*
function popupform(path,w,h,wresizeable,wtop,wleft,wmenubar,wtoolbar,wlocation,wscrollbars,wstatus) {
	var winLeft = (window.screen.width - w)  /  2;
	var winTop = (window.screen.height - h)  /  2;
	winProps = 'height = ' + h +
				',width = ' + w + 
				',top = ' + winTop + 
				',left = ' + winLeft + 
				',scrollbars = ' + wscrollbars +
				',resizable = yes';


	var winHandle = window.open(path,'newWinexcpop',winProps);
		
	if ( winHandle.closed )
		winHandle = null;
	else 
		winHandle.focus();
}
*/
			