/**********************/ /**********************/
// 2007-05-06: First release
// 2009-02-17: Revision to consolidate versions
/**********************/ /**********************/

// Popup window.
function openWindow(path, name, width, height){
	width = width == null ? 800 : width;
	height = height == null ? 600 : height;
	wleft = (screen.width - width) / 2;
	wtop = (screen.height - height) / 2;
	// IE5 and other old browsers might allow a window that is partially offscreen or wider than the screen. Fix that. (Newer browsers fix this for us, but let's be thorough.)
	if (wleft < 0) {
		width = screen.width;
		wleft = 20;
	}
	if (wtop < 0) {
		height = screen.height;
		wtop = 20;
	}
	var win = window.open(path, name, "width=" + width + ", height=" + height + ", " + "left=" + wleft + ", top=" + wtop + ", location=no, menubar=no, status=no, toolbar=no, scrollbars=yes, resizable=yes");
	// Just in case 'width' and 'height' are ignored
	win.resizeTo(width, height);
	// Just in case 'left' and 'top' are ignored
	win.moveTo(wleft, wtop);
	win.focus();
}

// Popup window.
function popup(URL) {
	eval("popupPage = window.open(URL, 'popup', 'toolbar=0,scrollbars=1,location=0,statusbar=1,menubar=0,resizable=1,width=500,height=350,left = 100,top = 100');");
}
