﻿function popUp(URL) {
day = new Date();
id = day.getTime();
eval("page" + id + " = window.open(URL, '" + id + "', 'toolbar=0,scrollbars=0,location=0,statusbar=0,menubar=0,resizable=1,width=150,height=150');");
}


function openProductDetails(ProductId)
{
    var productDetailsUrl = 'products/ProductPage.aspx@ProductId=' + ProductId;
	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(myWidth < 1024 || myHeight < 640)
	{
		window.open(productDetailsUrl, 'Product Details', 'height=350,width=900,toolbar=0');
	}
	else
	{
		myLightWindow.activateWindow({href: productDetailsUrl, loadingAnimation: 'false', height: '350', width: '900', title: 'Product Details'});
	}
}
