function loginError(outputText)
{
	document.getElementById("darkness").style.display = 'block';
	xyPage = getPageSizeWithScroll();	
	document.getElementById("darkness").style.height = xyPage[1]+"px";
	
	//print error box middle of screen
	var _docHeight = (document.height !== undefined) ? document.height : document.body.offsetHeight;
	var _docWidth = (document.width !== undefined) ? document.width : document.body.offsetWidth;
	screenWidth = _docWidth;
	screenWidth = screenWidth - 400;
	pxLeft = screenWidth / 2;

	document.getElementById("ErrorOutput").style.display = 'block';
	document.getElementById("ErrorOutput").style.left = pxLeft+"px";
	document.getElementById("ErrorOutputPrintp").innerHTML = outputText;
} 

function loginBoxClose(){
	document.getElementById("darkness").style.display = 'none';
	document.getElementById("ErrorOutput").style.display = 'none';
}

function getPageSizeWithScroll(){
	if (window.innerHeight && window.scrollMaxY) {// Firefox
		yWithScroll = window.innerHeight + window.scrollMaxY;
		xWithScroll = window.innerWidth + window.scrollMaxX;
	} else if (document.body.scrollHeight > document.body.offsetHeight){ // all but Explorer Mac
		yWithScroll = document.body.scrollHeight;
		xWithScroll = document.body.scrollWidth;
	} else { // works in Explorer 6 Strict, Mozilla (not FF) and Safari
		yWithScroll = document.body.offsetHeight;
		xWithScroll = document.body.offsetWidth;
  	}
	arrayPageSizeWithScroll = new Array(xWithScroll,yWithScroll);
	//alert( 'The height is ' + yWithScroll + ' and the width is ' + xWithScroll );
	return arrayPageSizeWithScroll;
}

function checkKeycode(e) {
	var keycode;
	if (window.event) keycode = window.event.keyCode;
	else if (e) keycode = e.which;
	
	if(keycode == 27 || keycode == 13)
	{
	           loginBoxClose();             
	}
}
