function ChangeButtom(element)
{
	if (document.getElementById(element).style.backgroundPosition == 'left bottom')
	{
		document.getElementById(element).style.backgroundPosition = 'left top';
	}
	else
	{
		document.getElementById(element).style.backgroundPosition = 'left bottom';
	}
}

function ShowHide(element)
{
	if (document.getElementById(element).style.display == 'none')
	{
		document.getElementById(element).style.display = 'block';
	}
	else
	{
		document.getElementById(element).style.display = 'none';
	}
}

function ShowLogin()
{
	document.getElementById('fade').style.display = 'block';
	document.getElementById('login-box').style.display = 'block';
	
	ResetSize();
}

function ResetSize()
{
	var windowHeight;

	// This prevents a gutter in FireFox when sizing the width smaller
	document.getElementById('fade').style.width = '0px';

	// Find the right height
	if (self.innerHeight) // non-IE
	{
		windowHeight = self.innerHeight;
	}
	else if (document.documentElement && document.documentElement.clientHeight) // Explorer 6 Strict Mode
	{
		windowHeight = document.documentElement.clientHeight;
	}
	else if (document.body)
	{
		windowHeight = document.body.clientHeight;
	}

	// Center the login-box horazontally in the page
	document.getElementById('login-box').style.left = (((document.body.offsetWidth + 15) / 2) - 162)  + 'px';
	// Center the login-box vertically in the page
	document.getElementById('login-box').style.top = (((windowHeight) / 2) - 125)  + 'px';

	// If the content covers the length of the page, then use the offsetHeight instead
	if (document.body.offsetHeight + 30 > windowHeight)
	{
		windowHeight = document.body.offsetHeight + 30;
	}

	// Set the height
	document.getElementById('fade').style.height = windowHeight + 'px';
	// Set the width
	document.getElementById('fade').style.width=(document.body.offsetWidth + 30)+'px';
}