function ExitSite() {
	ExitSite.prototype.ShowLoadingBar = function() {
		var windowSize = this.getWindowSize();
		var windowHeight = windowSize[1];
		
		var windowScrollPos = this.getScrollXY();
		var windowYPos = windowScrollPos[1];
		
		var div = document.createElement("div");
		div.style.position = "absolute";
		div.style.height = (windowYPos+windowHeight)+"px";
		div.style.width = "100%";
		div.style.background = "black";
		div.style.zIndex = "100";
		div.style.top = "0";
		div.style.left = "0";
		div.style.textAlign = "center";
		
		div.style.opacity = "0.6";
		div.style.filter = "alpha(opacity=60)";
		div.id = 'LoadingBar';
		
		
		div.style.lineHeight = (windowHeight/2) + "px";
		
		div.innerHTML = "<img src='/graphics/loader2.gif' height='48' width='48' alt='Loading...' style='margin-top: "+((windowYPos+windowHeight)/2-24)+"px;' />";
		
		document.body.style.overflow = "hidden";
				
		document.body.appendChild(div);
	}
	
	ExitSite.prototype.getWindowSize = function() {
		var myWidth = 0, myHeight = 0;
		if( typeof( window.innerWidth ) == 'number' ) {
		  //Non-IE
		  myWidth = window.innerWidth;
		  myHeight = window.innerHeight;
		} else if( document.documentElement && ( document.documentElement.clientWidth || document.documentElement.clientHeight ) ) {
		  //IE 6+ in 'standards compliant mode'
		  myWidth = document.documentElement.clientWidth;
		  myHeight = document.documentElement.clientHeight;
		} else if( document.body && ( document.body.clientWidth || document.body.clientHeight ) ) {
		  //IE 4 compatible
		  myWidth = document.body.clientWidth;
		  myHeight = document.body.clientHeight;
		}
		return [ myWidth, myHeight ];
	}
	
	ExitSite.prototype.getScrollXY = function() {
		var scrOfX = 0, scrOfY = 0;
		if( typeof( window.pageYOffset ) == 'number' ) {
		  //Netscape compliant
		  scrOfY = window.pageYOffset;
		  scrOfX = window.pageXOffset;
		} else if( document.body && ( document.body.scrollLeft || document.body.scrollTop ) ) {
		  //DOM compliant
		  scrOfY = document.body.scrollTop;
		  scrOfX = document.body.scrollLeft;
		} else if( document.documentElement && ( document.documentElement.scrollLeft || document.documentElement.scrollTop ) ) {
		  //IE6 standards compliant mode
		  scrOfY = document.documentElement.scrollTop;
		  scrOfX = document.documentElement.scrollLeft;
		}
		return [ scrOfX, scrOfY ];
	}
	
}

window.onunload = function() {
	//exit = new ExitSite();
	//exit.ShowLoadingBar();
}

window.onload = function() {
	var img = new Image();
	img.src = './graphics/loader2.gif';
	
	forms = document.getElementsByTagName("form");
	
	for(var i=0;i<forms.length;i++) {
		if(forms[i].target != '_blank') {
			forms[i].onsubmit = function() {
				exit = new ExitSite();
				exit.ShowLoadingBar();
			}
		}
	}
	
	links = document.getElementsByTagName("a");
	
	for(var i=0;i<links.length;i++) {
		if(links[i].target != '_blank') {
			links[i].onclick = function() {
				exit = new ExitSite();
				exit.ShowLoadingBar();
			}
		}
	}
}