function popupBox()
{
	bodyTag = document.getElementsByTagName("body")[0];		
	
	var sizeatt = getPageSize();
	var scrollatt = getPageScroll();
	var fullHeight = "";
	
	/* Create overlay */
	var overlay = document.createElement("div");
	overlay.id = "dataOverlay";
	overlay.style.display = "block";	
	
	if(navigator.appName.indexOf("Opera") != -1)	
		fullHeight = parseInt(document.getElementsByClassName("bodyBg")[0].offsetHeight);		
	else
		fullHeight = sizeatt[1];
		
	overlay.style.height = fullHeight + "px";							
	
	if(navigator.userAgent.indexOf("MSIE") != -1)	
		overlay.style.width = (sizeatt[0]) + "px";			
	else
		overlay.style.width = (sizeatt[0] - 17) + "px";		
	
	bodyTag.appendChild(overlay);	
	
	var overlayBox = document.createElement("div");
	overlayBox.id = "dataOverlayBox";
	overlayBox.style.display = "block";
	overlayBox.style.top = scrollatt[1] + "px";
	bodyTag.appendChild(overlayBox);	
	
	var overlayContent = document.createElement("div");
	overlayContent.id = "overlayContent";
	overlayBox.appendChild(overlayContent);
	overlayContent.style.background = "none";	
	
	/* Create popup content */		
	var content = document.createElement("span");							
	content.id = "formResult";	
	content.style.display = "block";			
	overlayContent.appendChild(content);
	sizingGuide();
}
function hideBox()
{				
	overlayObj = document.getElementById("dataOverlay");	
	document.body.removeChild(overlayObj);
	overlayContentBox = document.getElementById("dataOverlayBox");
	document.body.removeChild(overlayContentBox);
}
function GetXmlHttpObject()
{
	var xmlHttp = null;	
	try
	{
		xmlHttp = new XMLHttpRequest();
	}
	catch (e)
	{
		try
		{
			xmlHttp = new ActiveXObject("Msxml2.XMLHTTP");
		}
		catch (e)
		{
			xmlHttp = new ActiveXObject("Microsoft.XMLHTTP");
		}
	}
	return xmlHttp;
}
function sizingGuide()
{	
	xmlHttp = GetXmlHttpObject();				
	var url = "/sizingguide-popup.aspx";	
	xmlHttp.onreadystatechange = function()
	{
		if (xmlHttp.readyState == 4)
			document.getElementById("formResult").innerHTML = xmlHttp.responseText;
	}
	xmlHttp.open("GET",url,true);	
	xmlHttp.send(null);	
}
function getPageScroll()
{
	var yScroll;

	if (self.pageYOffset) 
	{
		yScroll = self.pageYOffset;
	} 
	else if (document.documentElement && document.documentElement.scrollTop)
	{
		yScroll = document.documentElement.scrollTop;
	} 
	else if (document.body) 
	{
		yScroll = document.body.scrollTop;
	}
	
	arrayPageScroll = new Array('',yScroll) 
	return arrayPageScroll;
}
function getPageSize()
{	
	var xScroll, yScroll;	
	if (window.innerHeight && window.scrollMaxY) 
	{	
		xScroll = document.body.scrollWidth;
		yScroll = window.innerHeight + window.scrollMaxY;
	} 
	else if (document.body.scrollHeight > document.body.offsetHeight)
	{
		xScroll = document.body.scrollWidth;
		yScroll = document.body.scrollHeight;
	} 
	else 
	{ 
		xScroll = document.body.offsetWidth;
		yScroll = document.body.offsetHeight;
	}		
	var windowWidth, windowHeight;
	if (self.innerHeight) 
	{
		windowWidth = self.innerWidth;
		windowHeight = self.innerHeight;
	} 
	else if (document.documentElement && document.documentElement.clientHeight) 
	{
		windowWidth = document.documentElement.clientWidth;
		windowHeight = document.documentElement.clientHeight;
	} 
	else if (document.body) 
	{
		windowWidth = document.body.clientWidth;
		windowHeight = document.body.clientHeight;
	}	
	if(yScroll < windowHeight)
	{
		pageHeight = windowHeight;
	} 
	else 
	{ 
		pageHeight = yScroll;
	}
	if(xScroll < windowWidth)
	{	
		pageWidth = windowWidth;
	} 
	else 
	{
		pageWidth = xScroll;
	}	
	arrayPageSize = new Array(pageWidth,pageHeight,windowWidth,windowHeight) 
	return arrayPageSize;
}
