var splashWin;

function openSplashWin(theURL,width,height,left,top) {

	// what version of IE etc
	var v=navigator.appVersion.substring(navigator.appVersion.indexOf("MSIE ")+5,navigator.appVersion.indexOf("MSIE ")+8);
	
	//is it windows 
	var c=(document.all&&navigator.userAgent.indexOf("Win")!=-1)?1:0; 
	

	var isSplash=1;
	if(v>=5.5){isSplash=0;}

	var s = 'fullscreen='+isSplash+',toolbar=0,location=0,directories=0,status=0,menubar=0,scrollbars=0,resizable=0';
	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;
	
	splashWin = window.open("",'', s );

	splashWin.blur();	// Hide while updating
	
	splashWin.resizeTo(width,height);
	splashWin.moveTo(l, t);

	splashWin.document.open("text/html", "replace");
	splashWin.document.write("<html>\n<style type='text/css'>\n");
	splashWin.document.write("# contactHost	{position:absolute; left:0px; top:0px; width:100%; height:20; z-index:1; background-color: #CCCCCC; layer-background-color: #CCCCCC; border: 1px none #000000;}\n");
	splashWin.document.write("</style>\n");
	splashWin.document.write("<body onload=\"top.document.location.replace('"+theURL+"')\" TOPMARGIN=0 LEFTMARGIN=0 MARGINWIDTH=0 MARGINHEIGHT=0 scroll='no'>\n");
	splashWin.document.write('<div id="contactHost">');
	splashWin.document.write('<table width="100%" border="0" cellspacing="0" cellpadding="0" height="20"><tr align="left" valign="middle"><td bgcolor="#CCCCCC"><font face="Arial, Helvetica, sans-serif" size="1">&nbsp;&nbsp;L o a d i n g . . . . </font></td></tr></table>');
	splashWin.document.write("</div>\n");
	splashWin.document.write("</body>\n</html>");
	splashWin.document.close();

	splashWin.focus();

	return;

}

function checkWin(theURL,width,height,left,top){
	if(splashWin && !splashWin.closed){
		splashWin.location.href=theURL; 		//splash already open change URL
		splashWin.focus();
	}else{
		openSplashWin(theURL,width,height,left,top);	//opening new splash
	}
}

function closeSplashWin(){
	if(splashWin && !splashWin.closed){			// if user exits site close splash window
		splashWin.window.close();
		return false
	}
}
