		
hite=100;
updownscroller=1;
$(document).ready(function(){  

centerbox();
$(".FonClick").click(function(){ 

document.getElementById('loginbox').style.visibility = 'visible';

loadIframe(0);


});  

$(".FonRelease").click(function(){  						  

document.getElementById('loginbox').style.visibility = 'hidden';
loadIframe(1);

}); 

		function hideDiv() {
			if (document.getElementById) { // DOM3 = IE5, NS6
			document.getElementById('loginbox').style.visibility = 'hidden';
			}
			else {
				if (document.layers) { // Netscape 4
				document.loginbox.visibility = 'hidden';
				}
				else { // IE 4
				document.all.loginbox.style.visibility = 'hidden';
				}
			}
			}

			function showDiv() {
				if (document.getElementById) { // DOM3 = IE5, NS6
				document.getElementById('loginbox').style.visibility = 'visible';
				}
				else {
					if (document.layers) { // Netscape 4
					document.loginbox.visibility = 'visible';
					}
					else { // IE 4
					document.all.loginbox.style.visibility = 'visible';
					}
				}
			}

		function getWindowHeight() {
			var windowHeight = 0;
			if (typeof(window.innerHeight) == 'number') {
				windowHeight = window.innerHeight;
			}
			else {
				if (document.documentElement && document.documentElement.clientHeight) {
					windowHeight = document.documentElement.clientHeight;
				}
				else {
					if (document.body && document.body.clientHeight) {
						windowHeight = document.body.clientHeight;
					}
				}
			}
			return windowHeight;
		}
		function centerbox() {
			if (document.getElementById('loginbox')) {
				var windowHeight = getWindowHeight();
				if (windowHeight > 0) {
					var contentElement = document.getElementById('loginbox');
					var contentHeight = contentElement.offsetHeight;
					if (windowHeight - contentHeight > 0) {
						contentElement.style.position = 'relative';
						contentElement.style.top = ((windowHeight / 2) - (contentHeight / 2)) + 'px';
					}
					else {
						contentElement.style.position = 'static';
					}
				}
			}
		}
		window.onload = function() {
			setContent();
		}

		function getWindowHeight() {
			var windowHeight = 0;
			if (typeof(window.innerHeight) == 'number') {
				windowHeight = window.innerHeight;
			}
			else {
				if (document.documentElement && document.documentElement.clientHeight) {
					windowHeight = document.documentElement.clientHeight;
				}
				else {
					if (document.body && document.body.clientHeight) {
						windowHeight = document.body.clientHeight;
					}
				}
			}
			return windowHeight;
		}
		function setContent() {
			if (document.getElementById) {
				var windowHeight = getWindowHeight();
				if (windowHeight > 0) {
					var contentElement = document.getElementById('loginbox');
					var contentHeight = contentElement.offsetHeight;
					if (windowHeight - contentHeight > 0) {
						contentElement.style.position = 'relative';
						contentElement.style.top = ((windowHeight / 2) - (contentHeight / 2)) + 'px';
					}
					else {
						contentElement.style.position = 'static';
					}
				}
			}
		}
		window.onload = function() {
			centerbox();
		}
		window.onresize = function() {
			centerbox();
		}
		

function loadIframe(updown) {
			if (updown==1){updownscroller=1;if(hite<100)loadIframescroll(hite);}
			else {updownscroller=0;if(hite>0)loadIframescrolldowm(hite);}
}

function loadIframescroll(scrollnum){
	if(scrollnum<100 && updownscroller==1){
		document.getElementById('FaderID').style.MozOpacity = scrollnum/100 ;	
		id=setTimeout(function(){hite+=3;loadIframescroll(scrollnum+4);}, 2);
		}
	else clearTimeout(id);
}

function loadIframescrolldowm(scrollnum){
	if(scrollnum>30 && updownscroller==0){
		document.getElementById('FaderID').style.MozOpacity = scrollnum/100 ;
		id=setTimeout(function(){hite-=3;loadIframescrolldowm(scrollnum-4);}, 2);
		}
	else clearTimeout(id);
}


}); 

