// JavaScript Document
function imgPopup(pic, width, height) {
remote=window.open("","remotewindow","toolbar=yes,location=no,directories=no,status=no,menubar=yes,scrollbars=yes,resizable=yes,width="+width+",height="+height);
remote.location.href=pic;
}
 function MM_displayStatusMsg(msgStr) { //v1.0
  status=msgStr;
  document.MM_returnValue = true;
}
var splashWin, autoCloseTimeoutHandle, ontopIntervalHandle;

function PD_openSplashWindow(sUrl, width, height, autoCloseTime){

	var nLeft = (window.screen.width - width)/2;
	var nTop = (window.screen.height - height)/2;
	
	autoCloseTime = autoCloseTime * 1000;

	splashWin = window.open(sUrl, '_splash', 'fullscreen=0,toolbar=0,location=0,directories=0,status=0,menubar=0,scrollbars=1,resizable=1' );

	splashWin.blur();	// Hide while updating
	window.focus();
	
	splashWin.resizeTo(width,height);
	splashWin.moveTo(nLeft, nTop);
	splashWin.focus();
	
	ontopIntervalHandle = splashWin.setInterval("window.opener.splashWin.focus();", 50);
	splashWin.document.body.onbeforeunload = function() {
		// Splash is being closed. no need to close it again
		window.clearInterval(autoCloseTimeoutHandle);
		window.onbeforeunload = null;
	};
	
	splashWin.document.body.onload = function() {splashWin.setInterval("window.opener.splashWin.focus();", 50);};
	
	window.clearTimeout(autoCloseTimeoutHandle);	// in case some one calls this twice	
	if (autoCloseTime != null && autoCloseTime > 0 && autoCloseTime != "NaN") {
		autoCloseTimeoutHandle = window.setTimeout("splashWin.close()", autoCloseTime);
	}
	
	window.onbeforeunload = function() {splashWin.close();};	// Close splash when this page is unloaded
}