    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","<strong class='red'>￥" + formatAsMoney(price)+"</strong>");
	    showInnterText("showVipPrice","<strong class='red'>￥" + formatAsMoney(vipPrice)+"</strong>");
	   // showInnterText("showPriceDesc","The price includes the frame cost.");
	    showInnterText("showFramePrice","<strong class='red'>￥"+formatAsMoney(framePrice)+"</strong>，");
	    
	    cartForm.price.value=formatAsMoney(totalPrice);
	    cartForm.vipPrice.value=formatAsMoney(vipTotalPrice);
	    cartForm.framePrice.value=formatAsMoney(framePrice);
	  }else{
	    showInnterText("showPrice","<strong class='red'>￥" + formatAsMoney(price)+"</strong>");
	    showInnterText("showVipPrice","<strong class='red'>￥" + formatAsMoney(vipPrice)+"</strong>");
	    //showInnterText("showPriceDesc","");
	    showInnterText("showFramePrice",frameTag==1?'可选择，':'不可用，');
	    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", "运费:<strong class='red'>￥" +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", "运费:<strong class='red'>￥" +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="";
	}
	
	function handleReview(flag){
	   var listReviewHeader = dojo.byId("listReviewHeader");
	   var deliverReviewHeader = dojo.byId("deliverReviewHeader");
	   var listReview = dojo.byId("listReview");
	   var deliverReview = dojo.byId("deliverReview");
	   if(flag=="list"){//??????
	     listReviewHeader.style.display="";
	     listReview.style.display="";
	     deliverReviewHeader.style.display="none";
	     deliverReview.style.display="none";
	   }else{//????
	     listReviewHeader.style.display="none";
	     listReview.style.display="none";
	     deliverReviewHeader.style.display="";
	     deliverReview.style.display="";
	   
	   }
	}
  function changePage(requestUrl) {
		var pageSelect= dojo.byId("curP");
		pageSelect.disabled = true;
		var selectHref = requestUrl + (pageSelect.selectedIndex + 1);
		doPageForward(selectHref,"curP");
	}
  function doPageForward(requestUrl,pageSelectId) {
		doEngine("byGet","handle_page_view",requestUrl,pageSelectId);		
		return false;
	}
  function deliverReview(){
    var currForm = dojo.byId("validateForm");
    if(Validator.Validate(currForm,3)){
    doFormEngine('handle_page_view','showOperMsg','不允许!','handleDeliverReview.htm');
    currForm.subject.value="";
    currForm.content.value="";
    currForm.country.value="";
    handleReview("list");
    }
  }
  function validateReview(){
   var result = false;
    var currForm = dojo.byId("validateForm");
   if(!isNotEmpty(currForm.subject.value,"主题不能为空!","showSubjectMsg")){
      currForm.subject.focus();
   }else if(!isNotEmpty(currForm.content.value,"评论内容不能为空!","showContentMsg")){
     currForm.content.focus();
   }else{
    result = true;
   }
   return result;
  }
  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"
		});
   }

