vbIE6 = false;
vbHover=false;

function getPageDim(type)
{
	if( window.innerHeight && window.scrollMaxY ) // Firefox 
	{
		pageWidth = window.innerWidth + window.scrollMaxX;
		pageHeight = window.innerHeight + window.scrollMaxY;
	}
	else if( document.body.scrollHeight > document.body.offsetHeight ) // all but Explorer Mac
	{
		pageWidth = document.body.scrollWidth;
		pageHeight = document.body.scrollHeight;
	}
	else // works in Explorer 6 Strict, Mozilla (not FF) and Safari
	{ 
		pageWidth = document.body.offsetWidth + document.body.offsetLeft; 
		pageHeight = document.body.offsetHeight + document.body.offsetTop; 
	}
	
	if (type=="w")
		return pageWidth;
	else
		return pageHeight;
		
}

function toggleLoginBox(pbHideOnly)
{
	voBox = document.getElementById("box_login");

	if (vbIE6)
		voBox2 = document.getElementById("box_login2");
	else
		voBox2 = false;
		
	if (voBox && !vbHover)
	{
		if (voBox.style.display == "block" || pbHideOnly)
		{
			voBox.style.display = "none";
			if (voBox2)
				voBox2.style.display = "none";
		}	
		else
		{
			voBox.style.display = "block";
			if (voBox2)
				voBox2.style.display = "block";
		}	
	}
}
function doLogin(pbEntra)
{
	if (pbEntra)
		document.getElementById("login_richiedi").value = "1";
	else
		document.getElementById("login_richiedi").value = "0";
	
	voBox = document.getElementById("login");
	if (voBox)
		voBox.submit();
}
function hideError()
{
	voDiv = document.getElementById("error");
	voDiv.style.display = "none";
}
function moveError()
{
	vnWidth = getPageDim("w");
	voDiv = document.getElementById("error_content");
	voDiv.style.left = (vnWidth-347)/2+"px";
}