	var checkCount = 0;
	var timeoutId = 0;
	var screendisabled = false;
	function resize()
	{
		
		if(screendisabled)
		{
			disableScreen();
			scroll(0,0);

				document.getElementById('loginPopupDiv').style.top =  "100px";
				
			document.getElementById('loginPopupDiv').style.display='block';
		}
	}
	
	window.onresize = resize;
	
	function disableScreen()
	{
		//var newdiv = document.createElement('img');
		//newdiv.setAttribute('id','screenHeightImage');
		//newdiv.setAttribute('src','/images/common/spacer.gif');
		//document.getElementById('footer').appendChild(newdiv);

		var pageWidth;
		var pageWidthPix;
		var pageHeight;
			if( document.body && ( document.body.scrollWidth || document.body.scrollHeight ) )
			{
					pageWidth = document.body.scrollWidth+'px';
					pageHeight = document.body.scrollHeight+'px';
					pageWidthPix = document.body.scrollWidth;
					if (document.body.offsetHeight && document.body.offsetHeight > document.body.scrollHeight)
						pageHeight = document.body.offsetHeight+'px';
			}
			else if( document.body.offsetWidth )
			{
				pageWidth = document.body.offsetWidth+'px';
				pageWidthPix  = document.body.offsetWidth;
				pageHeight = document.body.offsetHeight+'px';
			}
			else
			{
				pageWidthPix='100%';
				pageWidth='100%';
				pageHeight='100%';
			}
			
			if(parseInt(pageWidthPix) < 1030)
			{
				document.getElementById('subPopupBG').style.width = "1030px";
			}
			else
			{
				document.getElementById('subPopupBG').style.width = pageWidth;
			}
			document.getElementById('subPopupBG').style.backgroundColor="#EEEEEE";
			document.getElementById('subPopupBG').style.height = document.getElementById('screenHeightImage').offsetTop +"px";
			
 			document.getElementById('subPopupBG').style.display='block';
			document.getElementById('loginPopupDiv').style.left =  ((parseInt(pageWidthPix) / 2) -200)+"px";

			if(parseInt(document.getElementById('loginPopupDiv').style.left)<0)
			{
				document.getElementById('loginPopupDiv').style.left = "0px";
			}
			screendisabled = true;
	}

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


	function checkLoggedJS(jsFunctionName)
	{
		if (!userLoggedIn)
		{
			checkCount++;

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

			clearTimeout();

			document.getElementById('loginPopupRedirectJS').value = jsFunctionName;
			disableScreen();
			scroll(0,0);

				document.getElementById('loginPopupDiv').style.top =  "100px";
				
				
			document.getElementById('loginPopupDiv').style.display='block';
			dcsMultiTrack('WT.si_n', 'SDPrintBooklet_Walmart', 'WT.si_x', '1');
			return false;
		}
		else
		{
			dcsMultiTrack('WT.si_n', 'SDPrintBooklet_Walmart', 'WT.si_x', '2');
			return true;
		}
}

