 function doWatchItem(showDivId,requestUrl) {
        var showDiv = dojo.byId(showDivId);
		dojo.io.bind({
			url:requestUrl,
			load: function(type,data,evt){
		        if(data!="Error"){
			      showDiv.innerHTML = data;
				}
			},
			timeoutSeconds: 5000,
			error: function(type, error) { alert(error.message); },
    		timeout: function(type) { alert("timeout"); },
		    preventCache: true,
			mimetype:"text/plain"
		});
      }
	function doChangeImage(showDivId,requestUrl) {	
		doEngine("byGet",showDivId,requestUrl);
	    return false;
    }
    function doViewOtherMerchDetail(showDivId,requestUrl){
        doEngine("byGet",showDivId,requestUrl);
	    return false;
    }
	function doCalculatePrice(select,price,vipPrice,framePrice,frameTag){
	    var packingType = select.options[select.selectedIndex].value;
	 	var shippingSel = dojo.byId("shippingSel");
	 	var cartForm = dojo.byId("cartForm");
	    if(packingType=="13"||packingType=="22"){
	    price -=0;
	    framePrice -=0;
	    vipPrice -=0;
	    var totalPrice =  price;
	    var vipTotalPrice = vipPrice;
	    showInnterText("showPrice","USD$" + formatAsMoney(price));
	    showInnterText("showVipPrice","USD$" + formatAsMoney(vipPrice));
	   // showInnterText("showPriceDesc","The price includes the frame cost.");
	    showInnterText("showFramePrice","<strong>USD$"+formatAsMoney(framePrice)+"</strong>，");
	    cartForm.price.value=formatAsMoney(totalPrice);
	    cartForm.vipPrice.value=formatAsMoney(vipTotalPrice);
	    cartForm.framePrice.value=formatAsMoney(framePrice);
	  }else{
	    showInnterText("showPrice","USD$" + formatAsMoney(price));
	    showInnterText("showVipPrice","USD$" + formatAsMoney(vipPrice));
	    //showInnterText("showPriceDesc","The price excludes the frame cost.");
	    showInnterText("showFramePrice",frameTag==1?'Optional，':'Without Frame，');
	    cartForm.price.value=formatAsMoney(price);
	    cartForm.vipPrice.value=formatAsMoney(vipPrice);
	    cartForm.framePrice.value=formatAsMoney("0.00");
	  }
	  doCalculateShipping(shippingSel);
	  
	}
	function doCalculateShipping(select){
	 var showShipping = dojo.byId("showShipping");
	 var cartForm = dojo.byId("cartForm");
	 //????????
	 var shippingValue = select.options[select.selectedIndex].value;
	 var shippings = dojo.string.splitEscaped(shippingValue,';');
	 //??????
	 var packingSel = dojo.byId("packingSel");
	 var packingType = packingSel.options[packingSel.selectedIndex].value;
	 packingType = packingType.substring(1,2);
	 packingType -=1;
	 showInnterText("showShipping", "Freight:<strong>USD$" +formatAsMoney(shippings[packingType])+"</strong>");
	 cartForm.shipping.value = formatAsMoney(shippings[packingType]);
	}
	function doCalculateShipping2(select){
	 var showShipping = dojo.byId("showShipping");
	 var cartForm = dojo.byId("cartForm");
	 var shippingValue = select.options[select.selectedIndex].value;
	 var currValues = dojo.string.splitEscaped(shippingValue,';');
	 showInnterText("showShipping", "Freight:<strong class='red'>USD$" +formatAsMoney(currValues[0])+"</strong>");
	 cartForm.shipping.value = formatAsMoney(currValues[0]);
	}
	function doCart(url){
	 var cartForm = dojo.byId("cartForm");
	 cartForm.action=url;
	 cartForm.submit();
	 dojo.byId("addCartSubmitSpan").style.display="none";
	 dojo.byId("addCartWaitSpan").style.display="";
	 dojo.byId("addOfferSubmitSpan").style.display="none";
	 dojo.byId("addOfferDisSpan").style.display="";
	 
	}
	function doOffer(url){
	 var cartForm = dojo.byId("cartForm");
	 cartForm.action=url;
	 cartForm.submit();
	 dojo.byId("addOfferSubmitSpan").style.display="none";
	 dojo.byId("addOfferWaitSpan").style.display="";
	 dojo.byId("addCartSubmitSpan").style.display="none";
	 dojo.byId("addCartDisSpan").style.display="";
	}
