function disableScreen()
{
		resizeOverlay();

		if (/MSIE (\d+\.\d+);/.test(navigator.userAgent))
		{
			//test for MSIE x.x;
	 		var ieversion=new Number(RegExp.$1) // capture x.x portion and store as a number
 			if (ieversion<=6)
 			{
				for (i=0; i<document.forms.length; i++)
				{
					for (j=0; j<document.forms[i].elements.length; j++)
					{
						if (document.forms[0].elements[j].type == "select-one" || document.forms[0].elements[j].type == "select-multiple")
							document.forms[0].elements[j].style.visibility = "hidden";
					}
				}
			}
		}
		document.getElementById('subPopupBG').style.display='block';
}

function enableScreen()
{
		for (i=0; i<document.forms.length; i++)
		{
			for (j=0; j<document.forms[i].elements.length; j++)
			{
				if (document.forms[0].elements[j].type == "select-one" || document.forms[0].elements[j].type == "select-multiple")
					document.forms[0].elements[j].style.visibility = "visible";
			}
		}

	document.getElementById("subPopupBG").style.display = "none";
}

function resizeOverlay()
{
		if( document.body && ( document.body.scrollWidth || document.body.scrollHeight ) )
		{
				var pageWidth = document.body.scrollWidth + 'px';
				var pageHeight = document.body.scrollHeight +'px';

				if (document.body.offsetHeight && document.body.offsetHeight > document.body.scrollHeight)
					pageHeight = document.body.offsetHeight+'px';
		}
		else if( document.body.offsetWidth )
		{
			var pageWidth = document.body.offsetWidth+'px';
			var pageHeight = document.body.offsetHeight+'px';
		}
		else
		{
			var pageWidth='100%';
			var pageHeight='100%';
		}

		document.getElementById('subPopupBG').style.height = pageHeight;
		document.getElementById('subPopupBG').style.width = pageWidth;
}

function centerDiv (divElement, xLocation, yLocation)
{
		if( document.body && ( document.body.scrollWidth || document.body.scrollHeight ) )
		{
				var pageWidth = document.body.scrollWidth;
				var pageHeight = document.body.scrollHeight;

				if (document.body.offsetHeight && document.body.offsetHeight > document.body.scrollHeight)
					pageHeight = document.body.offsetHeight;
		}
		else if( document.body.offsetWidth )
		{
			var pageWidth = document.body.offsetWidth;
			var pageHeight = document.body.offsetHeight;
		}

		if (pageHeight && yLocation == null)
		{
			divElement.style.top=(pageHeight - divElement.offsetHeight)/2;
		}
		else if (yLocation != null)
			divElement.style.top = yLocation;

		if (pageWidth && xLocation == null)
		{
			divElement.style.left=(pageWidth - divElement.offsetWidth)/2;
		}
		else if (xLocation != null)
			divElement.style.left = xLocation;

}

