function openLogin(){
	advAJAX.get({
		url: "/wp-login.php?ajax=1",
	
		onInitialization : function() {
			openHiden();  
			document.getElementById('hiden').innerHTML="<div style='text-align:center;width:300px;height:300px;line-height:15px; background:#FFF; margin:auto; margin-top:40px ' >&nbsp;<br><br><br><br><br><br><h2>Wczytywanie...</h2<br><img src='/js/loading.gif' border='0'></div>"
		},
	
		onSuccess : function(obj) { 
			document.getElementById('hiden').innerHTML=obj.responseText; 

		}
	});

}


function openHiden(){
	
	var arrayPageSize = getPageSize();
	var over = document.getElementById("over");
	over.style.height = arrayPageSize[1] +"px";
	over.style.background="#000";
	new Effect.Appear('over', { duration: overlayDuration, from: 0.0, to: overlayOpacity });
	var hiden = document.getElementById("hiden");
	hiden.style.height = arrayPageSize[1] +"px";
	hiden.style.display = "block";
	var over = document.getElementById("over");
	over.style.height = arrayPageSize[1] +"px";


}


function getPageSize(){
	
	var xScroll, yScroll;
	
	if (window.innerHeight && window.scrollMaxY) {	
		xScroll = document.body.scrollWidth;
		yScroll = window.innerHeight + window.scrollMaxY;
	} else if (document.body.scrollHeight > document.body.offsetHeight){ // all but Explorer Mac
		xScroll = document.body.scrollWidth;
		yScroll = document.body.scrollHeight;
	} else { // Explorer Mac...would also work in Explorer 6 Strict, Mozilla and Safari
		xScroll = document.body.offsetWidth;
		yScroll = document.body.offsetHeight;
	}
	
	var windowWidth, windowHeight;
	if (self.innerHeight) {	// all except Explorer
		windowWidth = self.innerWidth;
		windowHeight = self.innerHeight;
	} else if (document.documentElement && document.documentElement.clientHeight) { // Explorer 6 Strict Mode
		windowWidth = document.documentElement.clientWidth;
		windowHeight = document.documentElement.clientHeight;
	} else if (document.body) { // other Explorers
		windowWidth = document.body.clientWidth;
		windowHeight = document.body.clientHeight;
	}	
	
	// for small pages with total height less then height of the viewport
	if(yScroll < windowHeight){
		pageHeight = windowHeight;
	} else { 
		pageHeight = yScroll;
	}

	// for small pages with total width less then width of the viewport
	if(xScroll < windowWidth){	
		pageWidth = windowWidth;
	} else {
		pageWidth = xScroll;
	}


	arrayPageSize = new Array(pageWidth,pageHeight,windowWidth,windowHeight) 
	return arrayPageSize;
}


function closeHiden(){
	
//	document.getElementById("message").style.display = "none";
	document.getElementById("hiden").innerHTML = "";
	var over = document.getElementById("over");
	over.style.display = "none";
	var over = document.getElementById("over");
	over.style.height = "0px";
	over.style.background="transparent";
	var hiden = document.getElementById("hiden");
	hiden.style.display = "none";
	
}