var d = window.document;
d.write('<style type="text/css">div#LS_loadingScreen {z-index:1000000;/*background-color: #FFFFFF;*/position: absolute;/*filter: alpha(opacity=80);-moz-opacity: 0.80;-khtml-opacity: 0.80;opacity: 0.80;*/}img#LS_loadingImage {display:none;position: absolute;z-index: 1000001;}img#LS_busyImage {position: absolute;z-index: 1000002;cursor: pointer;display: none;}</style>');

var loadingImage = new Object;
loadingImage.src = website.images + 'loading.gif';
loadingImage.width = 30;
loadingImage.height = 31;

var busyImage = new Object;
busyImage.src = website.images + 'busy.gif';
busyImage.width = 220;
busyImage.height = 120;

var LS_busySeek = 300000;
var LS_busyflag = true;

function LS_RELOAD(){
	var d = window.document;
	if(LS_busyflag)
		d.getElementById('LS_busyImage').style.display = 'block';
}
function LS_RELEASE(){
	var d = window.document;
	d.getElementById('LS_loadingScreen').style.display = 'none';
	d.getElementById('LS_loadingImage').style.display = 'none';
	d.getElementById('LS_busyImage').style.display = 'none';
	LS_busyflag = false;
}
function LS_RESIZE(){
	var d = window.document;
	var nWidth, nHeight, nTop, nLeft,scrollAdjust;
	var ua = navigator.userAgent;
	var nHit = ua.indexOf("MSIE");
	var bIE = (nHit >=  0);
	var bVer6 = (bIE && ua.substr(nHit+5, 1) == "6");
	var bStd = (d.compatMode && d.compatMode=="CSS1Compat");
	if (bIE) {
		if (bVer6 && bStd) {
			nWidth = d.documentElement.clientWidth;
			nHeight = d.documentElement.clientHeight;
			nTop = d.documentElement.scrollTop;
			nLeft = d.documentElement.scrollLeft;
		}
		else {
			if(typeof d.body.style.maxHeight != "undefined") {
				nWidth = d.documentElement.clientWidth;
				nHeight = d.documentElement.clientHeight;
				nTop = d.documentElement.scrollTop;
				nLeft = d.documentElement.scrollLeft;
			}
			else {
				nWidth = d.body.clientWidth;
				nHeight = d.body.clientHeight;
				nTop = d.body.scrollTop;
				nLeft = d.body.scrollLeft;
			}
		}
	}
	else {
		nWidth = window.innerWidth - 16;
		nHeight = window.innerHeight;
		nTop = d.body.scrollTop  || d.documentElement.scrollTop;
		nLeft = d.body.scrollLeft || d.documentElement.scrollLeft;
	}
	d.getElementById('LS_loadingScreen').style.width = nWidth+30+"px";
	d.getElementById('LS_loadingScreen').style.height = nHeight+"px";
	d.getElementById('LS_loadingScreen').style.top = (nTop)+"px";
	d.getElementById('LS_loadingScreen').style.left = "0px";
	
	d.getElementById('LS_busyImage').style.top = ((nHeight - busyImage.height) / 2)+nTop+"px";
	d.getElementById('LS_busyImage').style.left = ((nWidth - busyImage.width) / 2)+"px";
	
	d.getElementById('LS_loadingImage').style.top = "20px";
	d.getElementById('LS_loadingImage').style.left = "20px";
}
function LS_INIT(){
	var d = window.document;
	if(d.getElementsByTagName('BODY').length == 0)
		d.write('<body>');
	var loadObj = d.getElementsByTagName("body").item(0);
	var element = d.createElement('div');
	element.id = 'LS_loadingScreen';
	loadObj.appendChild(element);
	
	element = d.createElement('img');
	element.id = 'LS_loadingImage';
	element.src = loadingImage.src;
	loadObj.appendChild(element);
	
	element = d.createElement('img');
	element.id = 'LS_busyImage';
	element.src = busyImage.src;
	element.onclick = function(){
		location.reload();
	}
	loadObj.appendChild(element);
	LS_RESIZE();
	setTimeout("LS_RELOAD()",LS_busySeek);
	//LS_RELOAD();
}
LS_INIT();

try{
	window.addEventListener("resize",function(){LS_RESIZE();},false);
	window.addEventListener("scroll",function(){LS_RESIZE();},false);
	window.addEventListener("load",function(){setTimeout('LS_RELEASE()',500);},false);
}
catch(e){
	window.attachEvent("onscroll",function(){LS_RESIZE();});
	window.attachEvent("onresize",function(){LS_RESIZE();});
	window.attachEvent("onload",function(){setTimeout('LS_RELEASE()',500);});
}

