function popupWindow(URL,setWidth,setHeight,options,message) {

	var winl   = (screen.width-setWidth)/2;
	var wint   = (screen.height-setHeight)/2;
	var js_message = message ;

	if (options == 'standard') {

		newWindow  = window.open(URL, "StandardWin", 'toolbar=0,location=0,directories=0,status=0,menubar=0,scrollbars=1,resizable=1,width='+setWidth+',height='+setHeight+',top='+wint+',left='+winl);			
	} else {
		newWindow  = window.open(URL, "NewWin", 'toolbar=0,location=0,directories=0,status=0,menubar=0,scrollbars=0,resizable=0,width='+setWidth+',height='+setHeight+',top='+wint+',left='+winl);			
	}

	setTimeout('checkpopup(newWindow)',1500);  // Wait a second or so and see if the window is still around -- DML

	// Echo out any message we may have been passed
	if (message) { 
		setTimeout("alert('" + js_message + "'); newWindow.focus();",2000);  // Wait a second or so and see if the window is still around -- DML
	}

}//End popupWindow

// Checks to see if our popup window is still present.  If not, its likely due to a popup blocker and we
// need to let the person know.  It could also be due to them quickly closing the window, but no likely
function checkpopup(mywin) {

	try {
		if (mywin.opener)  {
			mywin.focus() ;	// Make sure they see this bad boy in case it was already open
		}

	} catch (error) {

		alert("Display of requested webpage aborted -- probably due to a webpage popup blocker.\n" +
		      "Please disable the blocker and try again.") ;
	}
}
