function lookup(product_id, attName){
	var lookupurl = '/catalog/showProductAttr.jsp?product_id='+product_id+'&attr_name='+attName;
	var obj_window = window.open(lookupurl, 'shipping',
		'height=500,width=510,resizable=yes,scrollbars=yes');
	obj_window.opener = window;
	obj_window.focus();
}

function showSwatch(prodSwatchId){
	var lookupurl = '/catalog/showSwatch.jsp?prodSwatchId='+prodSwatchId;
	var obj_window = window.open(lookupurl, 'shipping',
		'height=500,width=510,resizable=yes,scrollbars=yes');
	obj_window.opener = window;
	obj_window.focus();
}
function checkCookieEnable(){
	var result=false;
	if(navigator.cookiesEnabled)
		return true;
	document.cookie = "testcookie=yes;";
	var cookieSet = document.cookie;
	if (cookieSet.indexOf("testcookie=yes") > -1)
		result=true;
	document.cookie = "";
	return result; 
}

function isCookieEnabled(){
	if (!checkCookieEnable()){
		var cookieDisabledDiv = document.getElementById("cookieDisabled");
		var cookieEnabledDiv = document.getElementById("cookieEnabled");
		cookieDisabledDiv.style.display = "";
		cookieEnabledDiv.style.display = "none";
		return false;
	}
	changePriceValue();
}

function changePriceValue()
{
	var dtValue = document.ToShoppingCartForm.ProductOptionIdPrice;
	var dtId;
	var dtPrice;
	var salesPrice;
	if (dtValue != null){
		if( document.ToShoppingCartForm.attrnameNum!=null &&
			document.ToShoppingCartForm.attrnameNum.length!=null){
			for(i=0;i<dtValue.length;i++){
				strIdPriceSplit = dtValue[i].value;
				arSpans=strIdPriceSplit.split(",");
				if(dtId!=null)
					dtId = dtId + "," + arSpans[0];
				else
					dtId = arSpans[0];

				if(dtPrice!=null)
					dtPrice = dtPrice + parseFloat(arSpans[1]);
				else
					dtPrice = parseFloat(arSpans[1]);
			}
		}else {
			strIdPriceSplit = dtValue.value;
			arSpans=strIdPriceSplit.split(",");
			dtId=arSpans[0];
			dtPrice = parseFloat(arSpans[1]);
		}

		document.ToShoppingCartForm.optionId.value=	dtId;
		NewPrice = parseFloat(salesPrice) + parseFloat(dtPrice);
		//document.getElementById('strRealPrice').innerHTML = '$' + formatCurrency(NewPrice);
	}
}
