/***************************
	(C) 2003 by Charleshan www.Denninger.nl
	http://www.paranoid.demon.nl
	Free for all users, but leave in this header.
		Started:	31-12-2003
		Last change:	06-09-2005
	==========================
	Function:	Show an OnLoad splash, and hide it afther the page was loaded. - v1.3
	Reference:	I don't remember & http://www.the-cool-place.co.uk
	==========================
	v1.0	31-12-2003	Builded HideWait().
	v1.1	29-10-2003	Added a delay to wait for x seconds (Just optional).
	v1.2	29-03-2004	Made delay (##) adjustable.
	v1.3	07-04-2004	Converted to .js + found window.onload=HideWait(##)
		06-09-2005	Updated the Usage section, found a better way to load this script from HTML code.
	==========================
	Usage:
	- In one (html) page -
		NOTE: If you use: "window.onload=HideWait(##)" then use: "<body>" else use: "<body onload="HideWait(##)">"
		<body>
		<div id="waitdiv" style="position:absolute;top:100px;width:100%;text-align:center;z-index:1">
			<img src="image"> and/or Text.
		</div>
		*** your page goes here ***
		<script language="javascript" src="./templates/hidewait.js"></script>
		<script for=window event=onload language="javascript"><!--
			if (document.readyState=="complete") HideWait(0); else HideWait(5);
			//Start another (onload) function like: StartClockDiv(); or alert("Page is ready!");
		//--></script>
		</body>
	- by using HideWait.js -
		<body>
		Use <div> - The same as above...
		*** your page goes here ***
		<script language="javascript" src="./templates/hidewait.js"></script>
	Note:
		You can use a .css (level 2) to standardize the <div> section.
****************************/

function Wait(delay){	//based on a script found on: http://www.the-cool-place.co.uk
	//string="TDS.visibility=document.layers?"hide":"hidden";";
	string="PauseForView("+delay+");";
	setTimeout(string,delay);
}

function HideWait(delay){
	Wait(1+delay*1000)	//Always wait delay*1 seconds.
	//var TD =document.layers?document.layers["waitdiv"]:document.getElementById("waitdiv");
	//var TDS=document.layers?TD:TD.style;
	//TDS.visibility=document.layers?"hide":"hidden"
}

function PauseForView(delay){	//based on a script found on: http://www.the-cool-place.co.uk
	var TD =document.layers?document.layers["waitdiv"]:document.getElementById("waitdiv");
	var TDS=document.layers?TD:TD.style;
	TDS.visibility=document.layers?"hide":"hidden";
	//alert("Ok "+delay/1000+" sec gewacht");
}
//window.onload=HideWait(0);	//This is the command, but you can (better) place it in the HTML file as descibed in the usage section above.

