(function(a){a.extend(a.fn,{enable:function(){if(this[0]){this[0].disabled=false}},disable:function(){if(this[0]){this[0].disabled=true}}})})(jQuery);$.ajaxSetup({dataType:"html",error:function(){alert("\u7cfb\u7edf\u4ea7\u751f\u5f02\u5e38")}});var delSku=null;var reAddSku=null;var Cart={AddProduct:function(c,f,b,a,h){var e,d;if(a&&a!="0"){d=a}else{d="1"}if(!h){var g=$("#"+f).html()}$.ajax({beforeSend:function(){if(!h){Utils.showAddWaitTip(f,1)}},url:path+"cart.aspx?act="+b+"&id="+c+"&count="+d,complete:function(){if(!h){window.setTimeout(function(){$("#"+f).html(g)},1500)}},success:function(i){Utils.showProductListHtml(i);if(!h){Utils.showAddWaitTip(f,2)}}})},ShowShoppingCart:function(){$("#productList").load(path+"cart.aspx?act=ShowShoppingCart")},changeBar:function(c,a,e){var d=null;var f=0;if(c=="+"){d=$(e).prev().prev();f=1}if(c=="-"){d=$(e).next();f=-1}var b=parseInt(d.val());if(b+f<0){alert("\u60a8\u8f93\u5165\u7684\u6570\u5b57\u5df2\u7ecf\u8d85\u51fa\u7684\u6700\u5c0f\u503c");return}d.val(b+f);this.changeProductCount(a,d[0])},changeProductCount:function(a,c){var b=$(c);if(b.val()==b.next().val()){return}if(b.val().length<=0){b.val(b.next().val());return}if(parseInt(b.val())==0){this.removeProductOnShoppingCart(a,c);return}$.ajax({beforeSend:function(){b.disable()},url:path+"cart.aspx?act=modify&cartId="+a+"&count="+b.val(),success:function(d){if(d.indexOf("errMessage:")==-1){var e=new getPos(c);Utils.showProductListHtml(d);Utils.showChangeSucTip(e)}else{b.enable();b.val($("#hidChange"+a).val());alert(d.substr(11))}}})},removeProductOnShoppingCart:function(a,b){if(confirm("\u786e\u5b9a\u4e0d\u8d2d\u4e70\u8be5\u5546\u54c1\uff1f")){this._setDelSku(a,b);$.ajax({url:path+"cart.aspx?act=del&cartId="+a,success:function(c){Utils.showProductListHtml(c);if(delSku.Num){Cart._setDelSkuShow()}}})}},_setDelSku:function(a,c){delSku=new DeledSku();var b=$(c).parent().parent().children();delSku.Id=b.eq(0).attr("id");delSku.Name=b.eq(1).attr("productName");delSku.Price=b.eq(2).text();delSku.Num=$("#hidChange"+a).val()},_setDelSkuShow:function(){if(!$("#divDeledSku")){return}if(delSku!=null&&delSku.Id!=""){var a="<table class='delItem'><tr>";a+="<td style='width:70px'>"+delSku.Id+"</td>";a+="<td style='text-align:left'>"+delSku.Name+"</td>";a+="<td style='width:150px'>"+delSku.Price+"</td>";a+="<td style='width:125px'>"+delSku.Num+"</td>";a+="<td style='width:100px'><a href='javascript:void(0)' onclick=\"Cart.AddProduct('"+delSku.Id+"','','buyAjax','"+delSku.Num+"',true);Cart.reAddedSku('delSku"+delSku.Id+"');\">\u91cd\u65b0\u8d2d\u4e70</a> | <a href='javascript:void(0)' onclick=\"Cart.saveFavorite('"+delSku.Id+"')\">\u6536\u85cf</a></td>";a+="</tr></table>";if($("#divDeledSku").children().length>0){a="<div class='delSplit'></div>"+a}$("#divDeledSku")[0].innerHTML+="<div class='delItem' id='delSku"+delSku.Id+"'>"+a+"</div>"}if($("#divDeledSku").children().length>0){$("#DeledSkuInfo").show()}delSku=null},clearCart:function(){if(confirm("\u786e\u5b9a\u6e05\u7a7a\u8d2d\u7269\u8f66\u5417\uff1f")){$.get(path+"cart.aspx?act=delall",function(a){Utils.showProductListHtml(a)})}},runOrderInfo:function(){if(Utils.checkAjaxStatus()){$("#submit_info").show();$("#submit_info").html("\u6b63\u5728\u8f6c\u5411\u8ba2\u5355\u4fe1\u606f\u586b\u5199\u9875\u9762\uff0c\u8bf7\u7a0d\u5019\uff01");$("#submit_btn").hide();$.ajax({beforeSend:Utils.showOverLay(),url:path+"cart.aspx?act=okAll",success:function(a){Cart._setCartSubmitRes(a)}})}},_setCartSubmitRes:function(a){if(a.indexOf("errMessage:")!=-1){alert(a.substr(11));Utils.removeOverLay();$("#submit_info").hide();$("#submit_btn").show();return}else{if(a.indexOf("errLogin:")!=-1){var b=a.substr(9);$("#submit_info").html(b);window.setTimeout(function(){window.location.href=path+"login.aspx?url=cart.aspx"},1000)}else{window.location.href=path+"cartstep.aspx"}}},reAddedSku:function(a){try{$("#"+a).remove();if($("#divDeledSku").children().length==0){$("#DeledSkuInfo").hide()}}catch(b){}},saveFavorite:function(b){var c="";$.get(path+"cart.aspx?act=saveFavorite&id="+b,function(d){c=d;if(c.indexOf("errMessage:")==-1){a(c)}else{alert(c.substr(11))}});function a(d){$.ajax({beforeSend:function(){$("#favSkuInfo").html("\u6b63\u5728\u8bfb\u53d6\u60a8\u6536\u85cf\u5939\u4e2d\u7684\u5546\u54c1\u4fe1\u606f\uff0c\u8bf7\u7a0d\u7b49\u3002\u3002\u3002")},url:path+"cart.aspx?act=getFavorite",success:function(e){$("#favSkuInfo").html(e);alert("\u5546\u54c1\u6536\u85cf\u6210\u529f")}})}},delFav:function(a,b){$.ajax({beforeSend:function(){$("#favSkuInfo").html("\u6b63\u5728\u8bfb\u53d6\u60a8\u6536\u85cf\u5939\u4e2d\u7684\u5546\u54c1\u4fe1\u606f\uff0c\u8bf7\u7a0d\u7b49\u3002\u3002\u3002")},url:path+"cart.aspx?act=delFav&favId="+a,success:function(c){$("#favSkuInfo").html(c)}})}};var isAddrOpen=false;var isDlyOpen=false;var isPackOpen=false;var isInvoiceOpen=false;var label_Address="";var label_Delivery="";var label_Package="";var label_Invoice="";var nStr="",pStr="",cStr="",cyStr="";var nTmp="",pTmp="",cTmp="",cyTmp="";var CartOrder={showForm_Address:function(){label_Address=$("#part_consignee").html();Utils.showWaitInfo("\u6b63\u5728\u8bfb\u53d6\u6536\u8d27\u4eba\u4fe1\u606f\uff0c\u8bf7\u7b49\u5f85\uff01",$("#linkConsignee"));$("#part_consignee").load(path+"cartstep.aspx?act=getCurrentAddr",function(){isAddrOpen=true;Utils.loadScript("orderValidatorAddr","cart.validator.addr.js");nTmp=$("#area_nation option:selected").text().replace("\u8bf7\u9009\u62e9","");pTmp=$("#area_province option:selected").text().replace("\u8bf7\u9009\u62e9","");cTmp=$("#area_city option:selected").text().replace("\u8bf7\u9009\u62e9","");cyTmp=$("#area_county option:selected").text().replace("\u8bf7\u9009\u62e9","")})},changeForm_Address:function(a){$("#addrList li").removeClass("xz");$(a).parent().parent().addClass("xz");$("#consignee_addr").load(path+"cartstep.aspx?act=changeCurrentAddr&id="+$(a).val())},closeForm_Address:function(){$("#part_consignee").html(label_Address);isAddrOpen=false},savePart_Address:function(){Utils.showWaitInfo("\u6b63\u5728\u63d0\u4ea4\u6536\u8d27\u4eba\u4fe1\u606f\uff0c\u8bf7\u7b49\u5f85\u3002\u3002\u3002",$("#btnSaveAddress"));$("#addrForm").ajaxSubmit({target:"#part_consignee",success:function(a){isAddrOpen=false;CartOrder.showForm_PayAndDly(true)}});return false},showForm_PayAndDly:function(c){label_Delivery=$("#part_payanddly").html();if(c){var b='<div class="o_show">';b+='<h1><b>\u652f\u4ed8\u53ca\u914d\u9001\u65b9\u5f0f</b>&nbsp;<a id="linkPayAndDly" onClick="CartOrder.showForm_PayAndDly();" href="javascript:void(0)">[\u4fee\u6539]</a></h1>';b+='<div class="middle">\u5bf9\u4e0d\u8d77\uff0c\u60a8\u8fd8\u6ca1\u6709\u7ef4\u62a4\u652f\u4ed8\u53ca\u914d\u9001\u65b9\u5f0f\uff01</div>';label_Delivery=b}Utils.showWaitInfo("\u6b63\u5728\u8bfb\u53d6\u652f\u4ed8\u53ca\u914d\u9001\u65b9\u5f0f\uff0c\u8bf7\u7b49\u5f85\uff01",$("#linkPayAndDly"));var a=path+"cartstep.aspx?act=getPayAndDly";if(c){a=path+"cartstep.aspx?act=getPayAndDly&isRefresh=true"}$.ajax({url:a,complete:Utils.clearWaitInfo,success:function(d){isDlyOpen=true;$("#part_payanddly").html(d);Utils.loadScript("orderValidatorDly","cart.validator.dly.js")}})},closeForm_PayAndDly:function(){$("#part_payanddly").html(label_Delivery);isDlyOpen=false},savePart_PayAndDly:function(){Utils.showWaitInfo("\u6b63\u5728\u63d0\u4ea4\u652f\u4ed8\u53ca\u914d\u9001\u65b9\u5f0f\uff0c\u8bf7\u7b49\u5f85\u3002\u3002\u3002",$("#btnSavePayAndDly"));$("#pdForm").ajaxSubmit({target:"#part_payanddly",success:function(){isDlyOpen=false;CartOrder.reloadPriceInfo()}});return false},ChangeDly:function(a){$.get(path+"cartstep.aspx?act=calcFee&query="+$(a).attr("query")+"&dllname="+$(a).val(),function(c){$("#showFee").html(c);if($("#isLogin").val()=="0"){var b=c.substring(c.indexOf(">")+1);$("#feeDiv").html(b);CartOrder._mathNoAjaxTotalPrice(b)}})},checkCod:function(){var a=$("input[name='delivery']:checked");if($(this).val()=="COD"&&!(a.size())){alert("\u8bf7\u5148\u9009\u62e9\u914d\u9001\u65b9\u5f0f");return false}if($(this).val()=="COD"&&a.attr("iscod")=="0"){alert("\u8be5\u914d\u9001\u65b9\u5f0f\u4e0d\u652f\u6301\u8d27\u5230\u4ed8\u6b3e");return false}else{return true}},showForm_Package:function(){label_Package=$("#part_Package").html();Utils.showWaitInfo("\u6b63\u5728\u5305\u88c5\u53ca\u8d3a\u5361\u4fe1\u606f\uff0c\u8bf7\u7b49\u5f85\uff01",$("#linkPackage"));$.ajax({url:path+"cartstep.aspx?act=getPackage",complete:Utils.clearWaitInfo,success:function(a){isPackOpen=true;$("#part_Package").html(a);Utils.loadScript("orderValidatorPck","cart.validator.pck.js")}})},showForm_Pck_NoAjax:function(){$("#writePckDiv").show();$("#defaultPckDiv").hide()},closeForm_Pck_NoAjax:function(){$("#writePckDiv").hide();$("#showPckDiv").show();$("#defaultPckDiv").show();$("#defaultPckDivContent").hide();var f=$("input[name='productpackage']:checked");var b=$("input[name='greetingcard']:checked");if(f.size()==0){alert("\u8bf7\u9009\u62e9\u5305\u88c5");return false}if(b.size()==0){alert("\u8bf7\u9009\u62e9\u8d3a\u5361");return false}var d=f.val();var e=f.attr("alt");var a=b.val();var c=b.attr("alt");if(d==0){$("#show_IsNeedPackage").html("\u5426");$("#show_PackageArea").hide()}else{$("#show_IsNeedPackage").html("\u662f");$("#show_PackageName").html(e+" \uffe5"+f.attr("price")+"\u5143");$("#show_PackageArea").show()}if(a==0){$("#show_IsNeedCard").html("\u5426");$("#show_CardArea").hide()}else{$("#show_IsNeedCard").html("\u662f");$("#show_CardName").html(c+" \uffe5"+b.attr("price")+"\u5143");$("#show_CardArea").show()}if(d==0&&a==0){$("#defaultPckDivContent").show();$("#showPckDiv").hide()}this._mathNoAjaxTotalPrice()},savePart_Package:function(){Utils.showWaitInfo("\u6b63\u5728\u63d0\u4ea4\u5305\u88c5\u53ca\u8d3a\u5361\u4fe1\u606f\uff0c\u8bf7\u7b49\u5f85\u3002\u3002\u3002",$("#btnSavePackage"));$("#packageForm").ajaxSubmit({target:"#part_Package",success:function(){isPackOpen=false;CartOrder.reloadPriceInfo()}});return false},closeForm_Package:function(){$("#part_Package").html(label_Package);isPackOpen=false},showForm_Invoice:function(a){label_Invoice=$("#part_Invoice").html();Utils.showWaitInfo("\u6b63\u5728\u8bfb\u53d6\u53d1\u7968\u4fe1\u606f\uff0c\u8bf7\u7b49\u5f85\uff01",$("#linkInvoice"));$("#part_Invoice").load(path+"cartstep.aspx?act=getInvoice",function(){isInvoiceOpen=true})},closeForm_Invoice:function(){$("#part_Invoice").html(label_Invoice);isInvoiceOpen=false},showForm_Inv_NoAjax:function(){$("#writeInvDiv").show();$("#defaultInvDiv").hide()},closeForm_Inv_NoAjax:function(){if($("input[name='IsInvoice']").is(":checked")){$("#show_IsNeedInvoice").html("\u662f");$("#show_InvoiceHead").html($("input[name='InvoiceHead']").val());$("#show_InvoicePricw").html("\uffe5"+$("input[name='InvoicePrice']").val()+"\u5143");$("#writeInvDiv").hide();$("#showInvDiv").show()}else{$("#writeInvDiv,#showInvDiv").hide();$("#defaultInvDiv").show()}this._mathNoAjaxTotalPrice()},savePart_Invoice:function(){Utils.showWaitInfo("\u6b63\u5728\u63d0\u4ea4\u53d1\u7968\u4fe1\u606f\uff0c\u8bf7\u7b49\u5f85\u3002\u3002\u3002",$("#btnSaveInvoice"));$("#invoiceForm").ajaxForm({target:"#part_Invoice",success:function(){isInvoiceOpen=false;CartOrder.reloadPriceInfo()}})},showForm_Remark:function(){$("#writeBzDiv").show();$("#defaultBzDiv").hide()},closeForm_Remark:function(){if($("textarea[name='txtRemark']").val().length>0){$("#show_Bzinfo").html($("textarea[name='txtRemark']").val());$("#writeBzDiv").hide();$("#showBzDiv").show()}else{$("#writeBzDiv,#showBzDiv").hide();$("#defaultBzDiv").show()}},ShowScoreOper:function(a){if($(a).html().indexOf("+")!=-1){$("#scoreContent").show();$(a).html($(a).html().replace("+","-"))}else{$("#scoreContent").hide();$(a).html($(a).html().replace("-","+"))}},ShowCouponOper:function(a){if($(a).html().indexOf("+")!=-1){$("#couponContent").show();$(a).html($(a).html().replace("+","-"))}else{$("#couponContent").hide();$(a).html($(a).html().replace("-","+"))}},changeMoney:function(){if(!this._checkScore()){return}if($("#changebutton").val()=="\u53d6\u6d88\u79ef\u5206\u62b5\u6263"){$("#usedscore").val(0);$("input[name^='usedmoney']").val(0);$("#changebutton").val("\u79ef\u5206\u62b5\u6263")}else{var b=$("#usedscore").val();var a=b/scorepercent;$("input[name^='usedmoney']").val(a)}this._mathPrice();this.useCoupon()},_checkScore:function(){var c=$("#usedscore")[0];var d=$("#userscore").val();var b=$("#maxscore").val();var a=c.value;if(isNaN(a)||a.indexOf(".")!=-1||a.indexOf("-")!=-1){alert("\u60a8\u7684\u79ef\u5206\u8f93\u5165\u4e0d\u5408\u6cd5");c.select();return false}if(parseInt(d)<parseInt(a)){alert("\u60a8\u6700\u591a\u80fd\u4f7f\u7528"+d+"\u79ef\u5206");c.select();return false}if(parseInt(a)>parseInt(b)){if(b=="0"){alert("\u8be5\u8ba2\u5355\u4e0d\u53ef\u4f7f\u7528\u79ef\u5206");c.select();return false}else{alert("\u8be5\u8ba2\u5355\u60a8\u6700\u591a\u53ef\u4ee5\u4f7f\u7528"+b+"\u79ef\u5206");c.select();return false}}return true},_mathNoAjaxTotalPrice:function(h){var g=$("input[name='productpackage']:checked");var e=$("input[name='greetingcard']:checked");var a=Math.round($("#totalprice").val());var f=h||$("input[name='feeValue']").val();if(!f){f="0"}var d=Math.round(g.attr("compare"));var c=Math.round(e.attr("compare"));var b=0;if($("input[name='IsInvoice']").is(":checked")){b=Math.round($("input[name='InvoicePrice']").val())}if(a>=d){d=0}else{d=Math.round(g.attr("price"))}if(a>=c){c=0}else{c=Math.round(e.attr("price"))}$("#newtotalprice").html(Math.round($("#totalprice").val())+Math.round(f)+d+c+b)},_mathPrice:function(){var a=Math.round(($("#totalprice").val()/10)*1000)/100-Math.round(($("input[name='usedmoney']").val()/10)*1000)/100;a=Math.round((a/10)*1000)/100;$("#newtotalprice").html(a)},ShowCouponList:function(a){if(a.checked){$("#couponlist").show()}else{$("#couponlist").hide()}},initCoupon:function(c){var a=c.value.split("-");try{$("#coupon1").val(a[0]);$("#coupon2").val(a[1]);$("#coupon3").val(a[2]);$("#coupon4").val(a[3]);this.verifyCoupon()}catch(b){}},moveNext:function(b,a){b.value=b.value.toUpperCase();if(b.value.length==4&&a!=4){$("#coupon"+(a+1))[0].select();$("#coupon"+(a+1))[0].focus()}},verifyCoupon:function(){var a=$("#coupon1").val()+"-"+$("#coupon2").val()+"-"+$("#coupon3").val()+"-"+$("#coupon4").val();var b=path+"cartstep.aspx?act=coupon&coupon="+a;$("#load").show();$("#ok").hide();$("#error").hide();$("#ispasstxt").load(b,function(){var c=$("#ispasstxt").html();$("#load").hide();if(isNaN(c)){if(c=="none"){$("#ok").hide();$("#error").show();$("#errmsg").html("\u00d7 \u9a8c\u8bc1\u9519\u8bef\uff0c\u4f7f\u7528\u8be5\u5238\u4e0d\u5b58\u5728\u6216\u5df2\u88ab\u4f7f\u7528")}else{$("#ok").hide();$("#error").show();$("#errmsg").html("\u00d7 \u9a8c\u8bc1\u9519\u8bef\uff0c"+c)}}else{$("#ok").show();$("#error").hide();$("#couponmoney").html(c);$("#verify").enable()}});$("#verify")[0].checked=false;$("#verify").disable();$("#couponprice").val("0")},useCoupon:function(){if($("#verify")[0].checked==true){var a=Math.round(($("#totalprice").val()/10)*1000)/100-Math.round(($("#couponmoney")[0].innerHTML/10)*1000)/100-Math.round(($("input[name='usedmoney']").val()/10)*1000)/100;a=Math.round((a/10)*1000)/100;if(a<0){a=0}$("#newtotalprice").html(a);$("#couponprice").val($("#couponmoney").html())}else{this._mathPrice();$("#couponprice").val("0")}},reloadPriceInfo:function(){$.get(path+"cartstep.aspx?act=getPriceInfo",function(b){var a=b.split("||");$("#priceSummary").html(a[0]);$("#totalprice").val(a[1]);$("#newtotalprice").html(a[1])});$("#usedscore").val(0);$("#usedmoneyTemp,#usedmoney").val(0);$("#couponprice").val(0);$("#verify")[0].checked=false},submitNoAjaxOrder:function(){if($("input[name='delivery']:checked").size()&&$("input[name='paymethod']:checked").size()){$("#submit_tip").show();Utils.showWaitInfo("\u6b63\u5728\u63d0\u4ea4\u8ba2\u5355\uff0c\u8bf7\u7a0d\u5019\uff01",$("#submitWaitInfo"),true);$("#submit_btn").hide();$("#orderNoForm").ajaxSubmit({beforeSubmit:Utils.showOverLay(),success:function(a){if(a.indexOf("errMessage:")!=-1){alert(a.substr(11));Utils.removeOverLay();$("#submit_tip").hide();$("#submit_btn").show()}else{window.location.href=a}}})}else{alert("\u5bf9\u4e0d\u8d77\uff0c\u652f\u4ed8\u65b9\u5f0f\u6216\u914d\u9001\u65b9\u5f0f\u4e3a\u7a7a\u3002\n\u60a8\u53ef\u80fd\u6ca1\u6709\u5b89\u88c5\u914d\u9001\u53ca\u652f\u4ed8\u65b9\u5f0f\u6216\u9009\u62e9\u7684\u5730\u533a\u6ca1\u6709\u914d\u9001\u65b9\u5f0f\uff01");return false}},submitOrder:function(){if(Utils.checkAjaxStatus()){if(CartOrder._check_submit_isClose()){if($("#isPayAndDly").val()){$("#submit_error").html("");$("#submit_error").hide();$("#submit_tip").show();Utils.showWaitInfo("\u6b63\u5728\u63d0\u4ea4\u8ba2\u5355\uff0c\u8bf7\u7a0d\u5019\uff01",$("#submitWaitInfo"),true);$("#submit_btn").hide();$("#orderRemark").val($("#txtRemark").val());$("#orderForm").ajaxSubmit({beforeSubmit:Utils.showOverLay(),success:function(a){if(a.indexOf("errMessage:")!=-1){alert(a.substr(11));Utils.removeOverLay();$("#submit_tip").hide();$("#submit_btn").show()}else{window.location.href=a}}})}else{alert("\u5bf9\u4e0d\u8d77\uff0c\u652f\u4ed8\u65b9\u5f0f\u6216\u914d\u9001\u65b9\u5f0f\u4e3a\u7a7a\u3002\n\u60a8\u53ef\u80fd\u6ca1\u6709\u5b89\u88c5\u914d\u9001\u53ca\u652f\u4ed8\u65b9\u5f0f\u6216\u9009\u62e9\u7684\u5730\u533a\u6ca1\u6709\u914d\u9001\u65b9\u5f0f\uff01")}}}},_check_submit_isClose:function(){var a="";if(isAddrOpen){a+="\u201c\u6536\u8d27\u4eba\u4fe1\u606f\u201d"}if(isDlyOpen){if(a!=""){a+=","}a+="\u201c\u652f\u4ed8\u65b9\u5f0f\u53ca\u914d\u9001\u65b9\u5f0f\u201d"}if(isPackOpen){if(a!=""){a+=","}a+="\u201c\u5546\u54c1\u5305\u88c5\u53ca\u8d3a\u5361\u201d"}if(isInvoiceOpen){if(a!=""){a+=","}a+="\u201c\u53d1\u7968\u4fe1\u606f\u201d"}if(a!=""){$("#submit_error").html("\u8bf7\u5148\u4fdd\u5b58"+a);$("#submit_error").show();return false}return true},changeNation:function(b){var a=$("#area_nation option:selected");$.getJSON(path+"cartstep.aspx?areaId="+a.val()+"&level=2&act=getArea",function(c){Utils.initAreaList($("#area_province"),c);Utils.initAreaList($("#area_city"));Utils.initAreaList($("#area_county"))});this.__getSelectArea();if($("#tempAddr").val().length==0){$("#txtAddress").val(nStr+$("#tempAddr").val())}else{$("#txtAddress").val($("#tempAddr").val().replace(nTmp,nStr))}if(b){$("#deliveryList").load(path+"cartstep.aspx?areaId="+a.val()+"&act=getDelivery")}},changeProvince:function(b){var a=$("#area_province option:selected");$.getJSON(path+"cartstep.aspx?areaId="+a.val()+"&level=3&act=getArea",function(c){Utils.initAreaList($("#area_city"),c);Utils.initAreaList($("#area_county"))});this.__getSelectArea();if($("#tempAddr").val().length==0){$("#txtAddress").val(nStr+pStr+$("#tempAddr").val())}else{$("#txtAddress").val($("#tempAddr").val().replace(nTmp+pTmp,nStr+pStr))}if(b){$("#deliveryList").load(path+"cartstep.aspx?areaId="+(a.val()=="-1"?$("#area_nation option:selected").val():a.val())+"&act=getDelivery")}},changeCity:function(b){var a=$("#area_city option:selected");$.getJSON(path+"cartstep.aspx?areaId="+a.val()+"&level=4&act=getArea",function(c){Utils.initAreaList($("#area_county"),c)});this.__getSelectArea();if($("#tempAddr").val().length==0){$("#txtAddress").val(nStr+pStr+cStr+$("#tempAddr").val())}else{$("#txtAddress").val($("#tempAddr").val().replace(nTmp+pTmp+cTmp,nStr+pStr+cStr))}if(b){$("#deliveryList").load(path+"cartstep.aspx?areaId="+(a.val()=="-1"?$("#area_province option:selected").val():a.val())+"&act=getDelivery")}},changeCounty:function(b){var a=$("#area_county option:selected");this.__getSelectArea();if($("#tempAddr").val().length==0){$("#txtAddress").val(nStr+pStr+cStr+cyStr+$("#tempAddr").val())}else{$("#txtAddress").val($("#tempAddr").val().replace(nTmp+pTmp+cTmp+cyTmp,nStr+pStr+cStr+cyStr))}if(b){$("#deliveryList").load(path+"cartstep.aspx?areaId="+(a.val()=="-1"?$("#area_city option:selected").val():a.val())+"&act=getDelivery")}},__getSelectArea:function(){nStr=$("#area_nation option:selected").text().replace("\u8bf7\u9009\u62e9","");pStr=$("#area_province option:selected").text().replace("\u8bf7\u9009\u62e9","");cStr=$("#area_city option:selected").text().replace("\u8bf7\u9009\u62e9","");cyStr=$("#area_county option:selected").text().replace("\u8bf7\u9009\u62e9","")}};var Utils={checkAjaxStatus:function(){if(jqueryAjaxStatus!=-1&&jqueryAjaxStatus!=4){alert("\u9875\u9762\u6b63\u5728\u52a0\u8f7d\u4e2d\uff0c\u8bf7\u7a0d\u5019\u2026\u2026");return false}else{return true}},showProductListHtml:function(a){if($("#productList")){$("#productList").html(a)}},showWaitInfo:function(f,d,a){try{if(d==null){return}this.clearWaitInfo();if(!a){var c=document.createElement("span")}else{var c=document.createElement("div")}c.className="waitInfo";c.id="waitInfo";c.innerHTML=f;d.parent().append(c);if(a){$(c).css({width:"135px",position:"relative","z-index":"110","margin-left":"auto"})}}catch(b){}},clearWaitInfo:function(){$("#waitInfo").remove()},showOverLay:function(){var c=document.createElement("div");c.id="usercart-overlay";$(document.body).append(c);var a=navigator.userAgent.indexOf("MSIE 6")>=0;var b=$(a?document.body:document);$("#usercart-overlay").css({width:b.width(),height:b.height()});if(a){$("#usercart-overlay").css({position:"absolute",top:"0px",left:"0px"})}},removeOverLay:function(){$("#usercart-overlay").remove()},showAddWaitTip:function(c,a){var d="";if(a==1){d="\u6b63\u5728\u52a0\u5165\u8d2d\u7269\u8f66\uff0c\u8bf7\u7a0d\u5019\uff01"}else{d="\u5546\u54c1\u52a0\u5165\u6210\u529f\uff01&nbsp;<a href='"+path+"cart.aspx#top'>\u8f6c\u5230\u8d2d\u7269\u8f66</a>"}var b="<div id='addSucTip'>"+d+"</div>";$("#"+c).html(b)},showChangeSucTip:function(c){this.closeWindow();c.Top=c.Top-84;c.Left=c.Left-(204-c.Width)/2;var b="<div id='changeSucTip'><div id='tipContent'><div id='tipTitle'>\u5546\u54c1\u6570\u91cf\u4fee\u6539\u6210\u529f\uff01<br />\u5546\u54c1\u91d1\u989d\u4e3a\uff1a<span id='priceSpan'>"+$("#cartBottom_price").html()+"</span>\u5143<br /><a href='javascript:Utils.closeWindow()'>\u5173\u95ed</a></div></div></div>";this._showMessageBox(b,c,204);var a=$("#mesWindow");setTimeout(function(){a.fadeOut(300,this.closeWindow)},4000)},_showMessageBox:function(e,f,c){this.closeWindow();var b=parseInt(document.documentElement.scrollWidth);var a=parseInt(document.documentElement.scrollHeight);var d=document.createElement("div");d.id="mesWindow";d.innerHTML=e;if(b-f.Left<c){styleStr="left:"+(f.Left-c)+"px;"}else{styleStr="left:"+(f.Left)+"px;"}styleStr+="top:"+f.Top+"px;position:absolute;width:"+c+"px;";d.style.cssText=styleStr;document.body.appendChild(d)},closeWindow:function(){if($("#mesWindow")){$("#mesWindow").remove()}},initAreaList:function(c,a){var b=c[0];b.length=0;b.options.add(new Option("\u8bf7\u9009\u62e9","-1"));if(a){$.each(a,function(d,e){b.options.add(new Option(d,e))})}},loadScript:function(d,a){var c=document.getElementById(d);var b=document.getElementsByTagName("body").item(0);if(c){b.removeChild(c)}c=document.createElement("script");c.setAttribute("src",path+"template/public/js/"+a);c.setAttribute("id",d);c.setAttribute("type","text/javascript");c.setAttribute("language","javascript");b.appendChild(c)}};function getPos(b){this.Left=0;this.Top=0;this.Height=b.offsetHeight;this.Width=b.offsetWidth;var a=b;while(a.tagName.toLowerCase()!="body"&&a.tagName.toLowerCase()!="html"){this.Left+=a.offsetLeft;this.Top+=a.offsetTop;a=a.offsetParent}}function DeledSku(){this.Id="";this.Name="";this.Price="";this.Num=""}$(document).ready(function(){$("input[name='paymethod']").click(CartOrder.checkCod);$("#btnSaveOrder").click(CartOrder.submitOrder)});
