
function positionPopup (popupName, top, left) 
{
	var Y = top + 
            document.body.parentNode.scrollTop
    
    var X = left + 
            document.body.parentNode.scrollLeft

    Y = (Y > 0) ? Y : 0;
    X = (X > 0) ? X : 0;                    
    UpdatePosition(popupName, X, Y);
}
    
function sizePopup (popupName, width, height, dynamicHeight) 
{
	//get the height of the window
	var myWidth = 0, myHeight = 0;
	if( typeof( window.innerWidth ) == 'number' ) {
		//Non-IE
		myWidth = window.innerWidth;
		myHeight = window.innerHeight;
	} else if( document.documentElement && ( document.documentElement.clientWidth || document.documentElement.clientHeight ) ) {
		//IE 6+ in 'standards compliant mode'
		myWidth = document.documentElement.clientWidth;
		myHeight = document.documentElement.clientHeight;
	} else if( document.body && ( document.body.clientWidth || document.body.clientHeight ) ) {
		//IE 4 compatible
		myWidth = document.body.clientWidth;
		myHeight = document.body.clientHeight;
	}
	
	if (dynamicHeight)
	{
		if (myHeight < height) 
		{
			myHeight = height;
		}
		else
		{
			myHeight = myHeight - 100;
		}
	}
	else
	{
		myHeight = height;
	}
	
	myWidth = width;
	
	UpdateSize('moreinfo',myWidth,myHeight) 
}        

function showMoreInfo(location)
{
	var htmlstring="<iframe src=\"linkname\" name=\"adpiframe\" id=\"adpiframe\" width=100% height=100% align=\"center\" Frameborder=\"0\" Scrolling=\"auto\" marginheight=\"5\" marginwidth=\"5\"></iframe>"
	htmlstring = htmlstring.replace("linkname",location);
	
	UpdateContent('moreinfo', htmlstring);
	show('moreinfo');
	
	positionPopup('moreinfo', 50, 50); 
	sizePopup('moreinfo',675,300, true) 
}

function showSendCart()
{	
	var htmlstring="<iframe src=\"linkname\" name=\"adpiframe\" id=\"adpiframe\" width=100% height=100% align=\"center\" Frameborder=\"0\" Scrolling=\"auto\" marginheight=\"5\" marginwidth=\"5\"></iframe>"
	htmlstring = htmlstring.replace("linkname",'SendCartLink.aspx');
	
	UpdateContent('moreinfo', htmlstring);
	show('moreinfo');
	
	positionPopup('moreinfo', 50, 50); 
	sizePopup('moreinfo',420,330, false) 
}

function showOrderHelp()
{
	var htmlstring="<iframe src=\"linkname\" name=\"adpiframe\" id=\"adpiframe\" width=100% height=100% align=\"center\" Frameborder=\"0\" Scrolling=\"auto\" marginheight=\"5\" marginwidth=\"5\"></iframe>"
	htmlstring = htmlstring.replace("linkname",'http://www.refacedepot.com/esupport/viewinfo.php?kbid=395');
	
	UpdateContent('moreinfo', htmlstring);
	show('moreinfo');
	
	positionPopup('moreinfo', 50, 50); 
	sizePopup('moreinfo',600,300, true) 
}

function showItemDetails(uItemId)
{
	var htmlstring="<iframe src=\"linkname\" name=\"adpiframe\" id=\"adpiframe\" width=100% height=100% align=\"center\" Frameborder=\"0\" Scrolling=\"auto\" marginheight=\"5\" marginwidth=\"5\"></iframe>"
	htmlstring = htmlstring.replace("linkname",'ViewItem.aspx?uitemid=' + uItemId);
	
	UpdateContent('moreinfo', htmlstring);
	show('moreinfo');
	
	positionPopup('moreinfo', 50, 50); 
	sizePopup('moreinfo',450,400, true) 
}

function showlink()
{
	//alert("show");
	//var htmlstring="<iframe src=\"linkname\" name=\"adpiframe\" id=\"adpiframe\" width=100% height=100% align=\"center\" Frameborder=\"0\" Scrolling=\"auto\" marginheight=\"5\" marginwidth=\"5\"></iframe>"
	//alert(htmlstring);
	//htmlstring = htmlstring.replace("linkname",location);
	//alert(htmlstring);
	//UpdateContent('moreinfo', htmlstring);
	//show('moreinfo');
	//alert(show('moreinfo'));
	//positionPopup('moreinfo', 50, 50); 
	//sizePopup('moreinfo',675,300, true) 

}
