var splashWin, autoCloseTimeoutHandle, ontopIntervalHandle;

function openwindow(file)
{
url = file;
var hWnd = window.open(url,"openwindow","left=10,top=10,width=200,height=250,resizable=no,scrollbars=yes");
    if (!hWnd.opener) hWnd.opener = self;
	if (hWnd.focus != null) hWnd.focus();
}

function openwindow1(file)
{
url = file;
var hWnd = window.open(url,"openwindow","left=200,top=10,width=350,height=300,resizable=no,scrollbars=yes");
    if (!hWnd.opener) hWnd.opener = self;
	if (hWnd.focus != null) hWnd.focus();
}

function launchSplashWin(contentType, contentString, width, height, left, top, autoCloseTime) {
	var w = window.screen.width;
	var h = window.screen.height;
	var l = (left != null) ? left : (w-width)/2;
	var t = (top != null) ? top : (h-height)/2;
	var uri = (contentType.toLowerCase() == "uri") ? contentString : "";
	//splashWin = window.open(uri, '_splash','toolbar=0,location=0,directories=0,status=0,menubar=0,scrollbars,resizable=0');
	splashWin = window.open(uri, '_splash','fullscreen=1,toolbar=0,location=0,directories=0,status=0,menubar=0,scrollbars,resizable=0');
	//splashWin.blur();	// Hide while updating
	//window.focus();
		splashWin.focus();	
	splashWin.resizeTo(width,height);
	splashWin.moveTo(l, t);

	if (contentType.toLowerCase() == "string") {
		var swd = splashWin.document;
		swd.open();
		swd.write(contentString);
		swd.close();
	}


	
//	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) {
		autoCloseTimeoutHandle = window.setTimeout("splashWin.close()", autoCloseTime);
	}
	
	//window.onbeforeunload = function() {splashWin.close();};	// Close splash when this page is unloaded
}
// actual site

