	var checkCount = 0;
	var timeoutId = 0;

	function disableScreen()
	{
			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;
 			document.getElementById('subPopupBG').style.display='block';
	}

	function enableScreen()
	{
		document.getElementById("subPopupBG").style.display = "none";
	}


	function checkLoggedIn(url, tag)
	{
		if (!userLoggedIn)
		{
			checkCount++;

			if (!document.getElementById('loginPopupRedirectURL') && checkCount <= 10)
			{
				timeoutId = setTimeout("checkLoggedIn('" + url + "')", 500);
				return false;
			}

			clearTimeout();

			dcsMultiTrack('WT.si_n', tag, 'WT.si_x', '1');
			document.getElementById('loginPopupRedirectJS').value = "postLogin('" + url + "')";
			disableScreen();

			if(document.body.scrollTop != 0)
				document.getElementById('loginPopupDiv').style.top = document.body.scrollTop + 200;
			else
				document.getElementById('loginPopupDiv').style.top = 200;

			document.getElementById('loginPopupDiv').style.display='block';

			return false;
		}
		else
		{
			//dcsMultiTrack('WT.si_n', tag, 'WT.si_x', '2');
			return true;
			//documemt.location = url;;
		}
}

function postLogin(url)
{
	window.location = url;
}