jQuery.cookie=function(n,t,i){function u(n,t){return t?encodeURIComponent(n):decodeURIComponent(n)}var c,v,y,l,b,r,o,s,a;if(typeof n!="string")return null;if(arguments.length===1){var p=u(n,!0)+"=",h=document.cookie.indexOf(p),e=null,w={};if(h>-1&&(h=h+p.length,c=document.cookie.indexOf(";",h),c===-1&&(c=document.cookie.length),e=document.cookie.substring(h,c),e.length>0)){if(e.indexOf("&")===-1&&e.indexOf("=")===-1)return u(e,!1);for(v=e.split("&"),l=0,b=v.length;l0&&t.hasOwnProperty(s)&&t[s]&&o.push(u(s,!0)+"="+u(t[s],!0))}o.length>0?(r+=typeof t=="string"?o:o.join("&"),i&&(i.expires instanceof Date&&(r+="; expires = "+i.expires.toUTCString()),typeof i.expires=="number"&&(a=new Date,a.setTime(a.getTime()+i.expires*864e5),r+="; expires = "+a.toUTCString()),i.path&&(r+="; path = "+i.path),i.domain&&(r+="; domain = "+i.domain),i.secure&&(r+="; secure"))):r+="; expires = "+new Date(0).toUTCString()}document.cookie=r;return}},function(n){n.belowthefold=function(t,i){var r;return r=i.container===undefined||i.container===window?n(window).height()+n(window).scrollTop():n(i.container).offset().top+n(i.container).height(),r<=n(t).offset().top-i.threshold};n.rightoffold=function(t,i){var r;return r=i.container===undefined||i.container===window?n(window).width()+n(window).scrollLeft():n(i.container).offset().left+n(i.container).width(),r<=n(t).offset().left-i.threshold};n.abovethetop=function(t,i){var r;return r=i.container===undefined||i.container===window?n(window).scrollTop():n(i.container).offset().top,r>=n(t).offset().top+i.threshold+n(t).height()};n.leftofbegin=function(t,i){var r;return r=i.container===undefined||i.container===window?n(window).scrollLeft():n(i.container).offset().left,r>=n(t).offset().left+i.threshold+n(t).width()};n.extend(n.expr[":"],{"below-the-fold":function(t){return n.belowthefold(t,{threshold:0,container:window})},"above-the-fold":function(t){return!n.belowthefold(t,{threshold:0,container:window})},"right-of-fold":function(t){return n.rightoffold(t,{threshold:0,container:window})},"left-of-fold":function(t){return!n.rightoffold(t,{threshold:0,container:window})}})}(jQuery),function(n){n.PaginationCalculator=function(n,t){this.maxentries=n;this.opts=t};n.extend(n.PaginationCalculator.prototype,{numPages:function(){return Math.ceil(this.maxentries/this.opts.items_per_page)},getInterval:function(n){var t=Math.floor(this.opts.num_display_entries/2),i=this.numPages(),r=i-this.opts.num_display_entries,u=n>t?Math.max(Math.min(n-t,r),0):0,f=n>t?Math.min(n+t+this.opts.num_display_entries%2,i):Math.min(this.opts.num_display_entries,i);return{start:u,end:f}}});n.PaginationRenderers={};n.PaginationRenderers.defaultRenderer=function(t,i){this.maxentries=t;this.opts=i;this.pc=new n.PaginationCalculator(t,i)};n.extend(n.PaginationRenderers.defaultRenderer.prototype,{createLink:function(t,i,r){var u,f=this.pc.numPages();return t=t<0?0:t"+r.text+"<\/span>"):n(""+r.text+"<\/a>").attr("href",this.opts.link_to.replace(/__id__/,t)),r.classes&&u.addClass(r.classes),u.data("page_id",t),u},appendRange:function(n,t,i,r,u){for(var f=i;f<\/div>");return this.opts.prev_text&&(t>0||this.opts.prev_show_always)&&r.append(this.createLink(t-1,t,{text:this.opts.prev_text,classes:"prev"})),u.start>0&&this.opts.num_edge_entries>0&&(o=Math.min(this.opts.num_edge_entries,u.start),this.appendRange(r,t,0,o,{classes:"sp"}),this.opts.num_edge_entries"+this.opts.ellipse_text+"<\/span>").appendTo(r)),this.appendRange(r,t,u.start,u.end),u.end0&&(f-this.opts.num_edge_entries>u.end&&this.opts.ellipse_text&&jQuery(""+this.opts.ellipse_text+"<\/span>").appendTo(r),e=Math.max(f-this.opts.num_edge_entries,u.end),this.appendRange(r,t,e,f,{classes:"ep"})),this.opts.next_text&&(t=0&&t0&&e(t-1),!1});r.bind("nextPage",{numPages:s},function(t){var i=n(this).data("current_page");return i0?-1:1;i.preventDefault();n&&n.call(t)},!1)})}});$.fn.extend({jscroll:function(n){return this.each(function(){function d(){te-u-i&&(t=e-u-i);o.stop().animate({top:t},100);var n=-((t-i)*s/(e-2*i));c.stop().animate({top:n},1e3)}function y(){te-u-i&&(t=e-u-i);o.css({top:t});var n=-((t-i)*s/(e-2*i));c.css({top:n})}var f,s,u;n=n||{};n.Bar=n.Bar||{};n.Btn=n.Btn||{};n.Bar.Bg=n.Bar.Bg||{};n.Bar.Bd=n.Bar.Bd||{};n.Btn.uBg=n.Btn.uBg||{};n.Btn.dBg=n.Btn.dBg||{};f={W:"15px",BgUrl:"",Bg:"#efefef",Bar:{Pos:"up",Bd:{Out:"#b5b5b5",Hover:"#000"},Bg:{Out:"#fff",Hover:"#fff",Focus:"orange"}},Btn:{btn:!0,uBg:{Out:"#ccc",Hover:"#fff",Focus:"orange"},dBg:{Out:"#ccc",Hover:"#fff",Focus:"orange"}},Fn:function(){}};n.W=n.W||f.W;n.BgUrl=n.BgUrl||f.BgUrl;n.Bg=n.Bg||f.Bg;n.Bar.Pos=n.Bar.Pos||f.Bar.Pos;n.Bar.Bd.Out=n.Bar.Bd.Out||f.Bar.Bd.Out;n.Bar.Bd.Hover=n.Bar.Bd.Hover||f.Bar.Bd.Hover;n.Bar.Bg.Focus=n.Bar.Bg.Focus||f.Bar.Bg.Focus;n.Btn.btn=n.Btn.btn!=undefined?n.Btn.btn:f.Btn.btn;n.Fn=n.Fn||f.Fn;var r=this,b,p=0,l=0;$(r).css({overflow:"hidden",position:"relative",padding:"0px"});var k=$(r).width(),e=$(r).height(),h=n.W?parseInt(n.W):21,g=k-h,i=n.Btn.btn==!0?h:0;$(r).children(".jscroll-con").height()==null&&($(r).wrapInner("
<\/div>"),$(r).append("
<\/div><\/div>"));var c=$(r).children(".jscroll-con"),a=$(r).children(".jscroll-e"),o=a.children(".jscroll-bar");$.browser.msie&&document.execCommand("BackgroundImageCache",!1,!0);c.css({"padding-right":h});a.css({width:h,background:n.Bg,"background-image":n.BgUrl});o.css({top:i,background:n.Bar.Bg.Out,"background-image":n.BgUrl,"border-color":n.Bar.Bd.Out,width:h-2});o.hover(function(){l==0&&$(this).css({background:n.Bar.Bg.Hover,"background-image":n.BgUrl,"border-color":n.Bar.Bd.Hover})},function(){l==0&&$(this).css({background:n.Bar.Bg.Out,"background-image":n.BgUrl,"border-color":n.Bar.Bd.Out})});s=c.height();u=(e-2*i)*e/s;u<10&&(u=10);var v=u/6,t=0,w=!1;o.height(u);s<=e?($(r).height(s),c.css({padding:0}),a.css({display:"none"})):w=!0;n.Bar.Pos!="up"&&(t=e-u-i,y());o.bind("mousedown",function(i){l=1;o.css({background:n.Bar.Bg.Focus,"background-image":n.BgUrl});var r=i.pageY,u=parseInt($(this).css("top"));return $(document).mousemove(function(n){t=u+n.pageY-r;y()}),$(document).mouseup(function(){l=0;o.css({background:n.Bar.Bg.Out,"background-image":n.BgUrl,"border-color":n.Bar.Bd.Out});$(document).unbind()}),!1});r.timeSetT=function(n){var r=this,i;n=="u"?t-=v:t+=v;y();p+=2;i=500-p*50;i<=0&&(i=0);b=setTimeout(function(){r.timeSetT(n)},i)};a.bind("mousedown",function(i){return n.Fn&&n.Fn.call(r),t=t+i.pageY-o.offset().top-u/2,d(),!1});$(r).mousewheel(function(){w==!0&&(n.Fn&&n.Fn.call(r),this.D>0?t-=v:t+=v,y())})})}}),function(n,t){n(function(){var v=vancl.dialog.alert,p=vancl.dialog.confirm,w=n("#recom-browse-collect"),b=n("#recom-browse-collect ul.tab>li:eq(0)"),k=w.find("ul.tab>li:eq(1)"),o=n("#recom-browse-collect ul.tab>li:eq(2)"),h=n("#tj-product"),c=n("#recent-browse"),f=n("#favorite"),e=cartGift=n("#cart-gift"),s=n("#collocate-list"),y=n(".coudan-title"),l=n("#gift"),u={add2FavoriteMsg:"确定要移除到收藏夹吗?",delMsg:"确定要删除此商品吗?",emptyCartMsg:"确定要清空购物车吗?",batchCheckOutTip:"请先勾选您要购买的商品后,再去结算",noPresentTitle:"提示",tipStr:"提示",updateQtyMsg:"商品数量不能少于一件。",noPresentMsg:"您还没有选择特惠品,确定要去结算吗?",collocateLoadHtml:"<\/span>",collocateListLoadingHtml:"
正在为您加载凑单品,请稍候...<\/div>",removedProducts:{},itemsPerPage:6,itemsPerPageOther:10},r={noLoginFavoriteHtml:"
请点击此处移入收藏夹<\/a>",emptyRecommendHtml:'
抱歉,没有任何推荐的商品。<\/div>',delItemHtml:'<\/a><\/td>#name#<\/a><\/td>#size#<\/td>#price#<\/td>#amount#<\/td>重新购买<\/a>#add-fav-html#<\/td><\/tr>',popupProductHtml:'

请确定商品信息<\/h4> <\/a><\/div>#name#<\/a>
#colors# <\/div>
#sizes# <\/div><\/div>
<\/div>
<\/div><\/div><\/div>',superPresentPopupHtml:'

#title#<\/h4> <\/a><\/div>
<\/div><\/div>
<\/div>
<\/div><\/div><\/div>',colorHtml:'#name#<\/a>',sizeHtml:"#size#<\/a>",colorHtml4Collocate:'#name#<\/a>',sizeHtml4Collocate:"#size#<\/a>",superPresentSizeHtml:"#size#<\/a>",superPresentMoreHtml:"更多<\/a>",color4RBCHtml:"#color#<\/a>",size4RBCHtml:"#size#<\/a>",noSizeHtml:"没有可选尺码<\/span>",delPresentTipHtml:'

由于您本次暂不结算此商品,#tip-message# 已被移除<\/p>

确定<\/a><\/div>
<\/div><\/div><\/div>',tipStr:"提示",sureTxt:"确定",cancelTxt:"取消",loadingTip:"请稍候...",defaultMsg:"好像出现了点小意外,请您稍后再试一次,或者请您与客服坐席400-650-7099联系。",checkOutLoading:"正在处理...",ellipseTxt:"...",checkOutTxt:"去结算",batchDelTip:"您确定要删除选中的商品吗?",batchDelAllTip:"您确定要删除全部商品吗?",noCheckedDelTip:"请先选择要删除的商品。",superPresentPopupColorTitle:"颜色选择",superPresentPopupColorLabel:"颜色",maxItem:12,recent:4,favorite:3,recommend:2,generalProduct:1,pointProduct:2,numDisplayEntries:3,numEdgeEntries:1,fractionDigits:2,thousandsSeparator:",",superPresentInitCount:11,loginCallBackUrl:document.location.protocol+"//"+document.location.host+"/callback?fn=account.LoginCallBack",loginInfoUrl:"/logininfo",logoutUrl:document.location.protocol+"//login.vancl.com/login/userloginout.aspx",loadCartUrl:"/mycart/items",loadCollocate:"/mycart/collocate",addItemUrl:"/mycart/additem",recommendUrl:"/mycart/recommended",recentUrl:"/mycart/recent",favoriteUrl:"/mycart/favorites",homeUrl:"https://www.vancl.com/",updateQtyUrl:"/mycart/updateqty",batchdelcartUrl:"/mycart/batchdelcart",updateSettlementStatusUrl:"/mycart/updatesettlementstatus",updateAllSettlementStatusUrl:"/mycart/BatchUpdateSettlementStatus",updateVanclSettlementStatusUrl:"/mycart/UpdateVanclSettlementStatus",updateSupplierSettlementStatusUrl:"/mycart/UpdateSupplierSettlementStatus",updateShopSettlementStatusUrl:"/mycart/UpdateShopSettlementStatus"},a={isCheckOut:!1,add2Favorite:null,LoginOnCart:function(n){showLoginDialog(r.loginCallBackUrl,n)},LoginOutOnCart:function(){n.cookie("ShoppingCarInfo","0$0",{expires:15,domain:".vancl.com"});location.href=r.logoutUrl},refresh:function(){n.get(r.loginInfoUrl,function(t){if(i.valid(t)){var r=n("#header .account");r.html(t)}})},LoginCallBack:function(){closeLoginDialog();this.isCheckOut?(this.refresh(),i.checkOut(),n("body").data("is-login-status",!0),this.isCheckOut=!1):typeof this.add2Favorite=="function"?(this.refresh(),this.add2Favorite(),this.add2Favorite=null):o.is(".selected")?(this.refresh(),i.loadCart(),o.click()):t.location.reload()}},i={go2TopWithAnimate:function(){var i=document.documentElement.scrollTop===0?document.body:document.documentElement;try{n(i).animate({scrollTop:0},1e3)}catch(r){n(t).scrollTop(0)}},setGlobalLoadTip:function(i){var u,f,e;i?n(".loading").hide():(n(".loading").length<1&&n("body").append("
<\/span><\/b><\/div>"),u=n(".loading"),u.children("b").text(r.loadingTip),u.show(),n.browser.msie&&n.browser.version<7&&(f=n(t).height()/2+n(document).scrollTop(),e=n(t).width()/2+n(document).scrollLeft(),u.css({top:f,left:e})))},setAnimateTip:function(i){var r,u,f;return n(".cart-tip").length<1&&n("body").append("

提示<\/span><\/a><\/h4>
<\/span>由于商品变化,您已不能享有该赠品,赠品已被移除。<\/span><\/div><\/div>"),r=n(".cart-tip"),typeof i=="string"&&r.find(".content-msg").text(i),u=n(t).height()/2-r.outerHeight()/2+n(document).scrollTop(),f=n(t).width()/2-r.outerWidth()/2+n(document).scrollLeft(),r.css({left:f,top:u}),r.animate({top:u-200,opacity:1},1500),setTimeout(function(){r.animate({top:u,opacity:0},1500,function(){r.css({left:0,top:0})})},3e3),r},setmodalLoadTip:function(n,t){n.length>0&&(typeof t=="undefined"?n.empty().append(r.modalLoadHtml):typeof t=="string"&&n.empty().append(t))},setTrStyle:function(n){var r=n.parent(),t=n.closest("tr"),i=r.attr("rowspan"),u=n[0].checked;u?(t.addClass("selected"),i>1&&t.next().addClass("selected")):(t.removeClass("selected"),i>1&&t.next().removeClass("selected"))},setAllTrStyle:function(n){var i=n[0].checked,t=n.closest("#batchdelcart").find("table tr");i?t.addClass("selected"):t.removeClass("selected")},setTdStyle:function(t,i){t.each(function(){var t=n(this),r=t.children("td"),u,f;if(i)return r.addClass("bd-bottom"),!0;if(u=t.find("td[rowspan]"),f=t.find("td[colspan]"),u.length>0&&u.attr("rowspan")>1||f.length>0&&f.attr("colspan")>1)return r.filter("td[rowspan][rowspan!=1],td[colspan][colspan!=1]").addClass("bd-bottom"),!0;r.addClass("bd-bottom")})},allCbxClick:function(t,i,r){if(t.length>0&&i.length>0){var u=t[0].checked;i.each(function(){var t=n(this);t.attr("checked",u)});typeof r=="function"&&r()}},ifAllCbxsChecked:function(t,i){if(t.length>0&&i.length>0){var r=0;i.each(function(){var t=n(this),i=t[0].checked;if(!i)return!1;r++});r===i.length?t.attr("checked","checked"):t.attr("checked","")}},supplierCbxClick:function(t,i,r){var u=t.checked;i.each(function(){u?n(this).attr("checked","checked"):n(this).attr("checked","")});typeof r=="function"&&r()},singleCbxClick:function(n,t,i,r){var o=i.attr("shopid"),s=i.attr("issupplier"),u=e.find("#batchdelcart input[value='shippers']"),f=e.find("#batchdelcart input[name='products-shop']"),h=e.find("#batchdelcart input[name='p-item'][shopid='"+o+"']");this.ifAllCbxsChecked(f.filter("input[shopid="+o+"]"),h);s=="False"?this.ifAllCbxsChecked(u.filter("input[name='supplier-products']"),f.filter("input[issupplier = 'False']")):this.ifAllCbxsChecked(u.filter("input[name='supplier-products']"),f.filter("input[issupplier = 'True']"));this.ifAllCbxsChecked(n,u);typeof r=="function"&&r()},setDelPresentTip:function(t,i,u){var o,f,e;t||typeof u!="string"||u===""?i.find(".del-present-tip-panel").hide():(o=i.find(".del-present-tip-panel"),o.length<1&&(i.prepend(r.delPresentTipHtml),i.find(".del-present-btn-sure").click(function(){n(this).closest(".del-present-tip-panel").hide()})),f=i.find(".del-present-tip-panel"),e=f.find(".del-present-msg"),e.text(e.text().replace(/#tip-message#/gi,u)),f.show())},setAllDelPresentTip:function(t,r){r.each(function(){var r=n(this),u=r.attr("data-del-tip"),f=r.closest("tr").children(".name");i.setDelPresentTip(t,f,u)})},hasChecked:function(n){for(var t=0;len=n.length,to)return!1;n(this).show()});n(t).triggerHandler("scroll")},commonPagination:function(n,t,u){n.pagination(t.length,{callback:function(n){return i.pageCallback(t,n,u),!1},num_display_entries:r.numDisplayEntries,num_edge_entries:r.numEdgeEntries,items_per_page:u,link_to:"",load_first_page:!0,ellipse_text:r.ellipseTxt,prev_text:" ",next_text:" "})},goToPage:function(n,t,i){if(!parseInt(n)||!(n<2)){var r=t.find(".next"),u=t.find(".prev");i?r.data("page_id")===t.data("current_page")?(u.data("page_id",0),u.click()):r.click():t.data("current_page")===0?(r.data("page_id",n-1),r.click()):u.click()}},getRemovedList:function(t,i){t.each(function(){var t={},f=n(this),e=f.find("input[name='sku']").val(),o=f.find("input[name='qty']").val();typeof e!="undefined"&&typeof o!="undefined"&&(t.clothesCode=e,t.productUrl=f.find(".name:first").children().attr("href"),t.productName=f.find(".name:first").children().text(),t.imgUrl=f.find("td.image img:eq(0)").attr("src"),t.amount=o,t.size=f.children("td.size").text(),t.price=f.children(".td.price").text(),t.isPoint=i,i||(t.addFaverateUrl=f.find(".add-faverate").attr("href")),t.addItemUrl=r.addItemUrl+"?sku="+e+"&qty="+o+"&ispoint="+i,u.removedProducts[e]=t)})},setPointTip:function(){var t=n("#point-tip");return t.length>0?(i.go2TopWithAnimate(),t.fadeTo(500,.2,function(){n(this).fadeTo(500,1)}),!0):!1},valid:function(t){if(typeof t=="string")return!0;var e,s,i,u;if(t!==null&&typeof t=="object"&&(e=t.Title,s=t.Content,i=t.LinkUrl,u=t.Type),u=="Authorize")n("#cart-product").find(".btn-panel .checkout").removeClass("checkout-loading").text(r.checkOutTxt),o.is(".selected")&&f.html(r.noLoginFavoriteHtml),o.data("is-quiet")?o.data("is-quiet",!1):a.LoginOnCart();else{if(u=="Redirect")return location.href=i,!0;v({title:e||r.tipStr,msg:s||r.defaultMsg,fn:function(){n(this).dialog("close");i&&document.location.protocol+"//"+document.location.host+i!==location.href&&(location.href=i)}})}return!1},loadCart:function(u){n.ajax({type:"GET",cache:!1,url:r.loadCartUrl,beforeSend:function(){},success:function(r){i.valid(r)?(cartGift.html(r),i.changed(!1,u)):(cartGift.find(".cart-loading").empty(),n(t).triggerHandler("scroll"));i.barSummaryMove()},complete:function(){}})},loadGift:function(t){var r=t.data("present-url");n.ajax({type:"GET",cache:!1,url:vancl.addQueryString(r,"async","true"),beforeSend:function(){i.setmodalLoadTip(l)},success:function(t){if(i.valid(t)){l.html(t);i.superPresentColorInit();l.find("#gift-item-panel").each(function(){n(this).find(".tab >li:eq(0)").click()});n("#gift .pager-panel").each(function(){var t=n(this),r=t.prevAll("ul.product-list").children();i.commonPagination(t,r,u.itemsPerPage)});var r=n("#gift-shop-panel"),f=r.find(".tab"),e=f.find("li").index(f.find(".selected"));r.find(".tab>li:eq("+e+")").click()}},error:function(n,t){var i=t},complete:function(){}})},superPresentInit:function(t,i){t.each(function(t,u){u=n(u);var f=u.find("a");f.filter(":lt("+i+")").show();f.length>i&&u.append(r.superPresentMoreHtml)})},superPresentColorInit:function(){var t=n(".super-present-item").find(".super-present-shangpin");this.superPresentInit(t,r.superPresentInitCount);t.find("a:eq(0)").click()},collocateColorInit:function(n,t){n.height()>t&&(n.height(t+"px"),n.jscroll({W:"7px",Bg:"#d9d9d9",Bar:{Pos:"up",Bd:{Out:"#900000",Hover:"#900000"},Bg:{Out:"#900000",Hover:"#900000",Focus:"#900000"}},Btn:{btn:!1},Fn:function(){}}))},commonPosition:function(i){var u=i.height(),f=i.width(),e=n(t).height(),o=n(t).width(),r=(e-u)/2,s=(o-f)/2;r<0&&(r=0);i.css({top:r,left:s})},cartInit:function(){var t=n("#promotion-group"),i;t.find("tr").length>0&&(i=t.find(".cart-split"),i.addClass("bd-top"),t.nextAll("tbody").find("tr").length>0&&i.addClass("bd-bottom"),t.find(".promotion-group-title:gt(0)").addClass("bd-top"));this.setTdStyle(n("[name='vancl-general-product']").children());this.setTdStyle(n("[name='vancl-point-product']").children());this.setTdStyle(n("[name='vancl-present-product']").children(),!0);this.setTdStyle(n("[name='supplier-general-product']").children());this.setTdStyle(n("[name='supplier-point-product']").children());this.setTdStyle(n("[name='supplier-present-product']").children(),!0);var r=e.find("#batchdelcart input[name='all-products']"),o=e.find("#batchdelcart input[name='p-item']"),u=e.find("#batchdelcart input[value='shippers']"),f=e.find("#batchdelcart input[name ='products-shop']");f.each(function(){var r=n(this).attr("shopid"),t=e.find("#batchdelcart input[name='p-item'][shopid='"+r+"']"),i=0;t.each(function(){var t=n(this),r=t[0].checked;if(!r)return!1;i++});i===t.length?n(this).attr("checked","checked"):n(this).attr("checked","")});this.ifAllCbxsChecked(u.filter("input[name='vancl-products']"),f.filter("input[issupplier='False']"));this.ifAllCbxsChecked(u.filter("input[name='supplier-products']"),f.filter("input[issupplier='True']"));this.ifAllCbxsChecked(r,u);r.length>0&&o.length>0&&this.setAllDelPresentTip(r[0].checked,o)},changed:function(r,e){if(i.cartInit(),s.hide(),y.hide(),e||(h[0].loaded=!1,f[0].loaded=!1,l[0].loaded=!1),o.is(".selected")&&o.data("is-quiet",!0),this.add2RemovedList(u.removedProducts),r){c[0].loaded=!1;var a=n("#cart-product");a.length>0&&a.data("promotion").toLowerCase()=="true"&&this.setAnimateTip()}n(t).triggerHandler("scroll")},createSuperPresentPopup:function(n,t){var u=t.find(".choose"),f,e,i,o,s;if(u.length>0){u.show();return}switch(n.toLowerCase()){case"color":f=r.superPresentPopupColorTitle;e=r.superPresentPopupColorLabel;i="shangpin";o=t.parent().find(".super-present-color").clone()}s=r.superPresentPopupHtml.replace(/#title#/gi,f).replace(/#popuplabel#/gi,e).replace(/#classname#/gi,i);t.append(s);t.find(".choose ."+i).append(o).closest(".choose").show().find(".super-present-color").show()},createPopupProduct:function(t,i){var h=i.closest("li").find(".list-img-panel"),c=h.data("href"),o,s,u,f,e,l;if(n.isPlainObject(t)){if(n.isPlainObject(t.present))return o=t.present.colors,s=new stringBuilder,n.each(o,function(n,t){s.append(r.colorHtml.replace(/#product-code#/gi,t.productCode).replace(/#ref#/gi,t.ref).replace(/#gallery-image#/gi,t.galleryImage).replace(/#icon-image#/gi,t.iconImage).replace(/#name#/gi,t.name).replace(/#color#/gi,t.color))}),u=o[0],r.popupProductHtml.replace(/#name#/gi,u.name).replace(/#product-url#/gi,c).replace(/#gallery-image#/gi,u.galleryImage).replace(/#yanse#/gi,"").replace(/#selected-color#/gi,"").replace(/#colors#/gi,s.toString());if(n.isPlainObject(t.collocate)){if(t.collocate.empty)return r.popupProductHtml;var o=t.collocate.colors.colors,s=new stringBuilder,u=o[0];return n.each(o,function(n,i){var f=r.colorHtml4Collocate.replace(/#product-code#/gi,i.productCode).replace(/#ref#/gi,i.ref).replace(/#gallery-image#/gi,i.galleryImage).replace(/#icon-image#/gi,i.iconImage).replace(/#name#/gi,i.name).replace(/#color#/gi,i.color);i.productCode==t.collocate.productCode&&(u=i,f=f.replace("track","selected track"));s.append(f)}),f=t.collocate.sizes["p"+t.collocate.productCode],e=new stringBuilder,n.each(f,function(n,t){var i=r.sizeHtml4Collocate.replace(/#sku#/gi,t.sku).replace(/#ref#/gi,t.ref).replace(/#size#/gi,t.size);e.append(i)}),r.popupProductHtml.replace(/#name#/gi,u.name).replace(/#product-url#/gi,c).replace(/#gallery-image#/gi,u.galleryImage).replace(/#yanse#/gi,"").replace(/#selected-color#/gi,"").replace(/#sizes#/gi,f.length>0?e.toString():r.noSizeHtml).replace(/#colors#/gi,s.toString()).replace(/sp_cart_mycart_present_sure_add_to_cart/,"sp_cart_mycart_collocate_sure_add_to_cart")}if(n.isPlainObject(t.RBC))return f=t.RBC.sizes.sizes,e=new stringBuilder,n.each(f,function(n,t){e.append(r.size4RBCHtml.replace(/#sku#/gi,t.sku).replace(/#ref#/gi,t.ref).replace(/#size#/gi,t.size))}),l=h.find("img").attr("alt"),r.popupProductHtml.replace(/#name#/gi,l).replace(/#product-url#/gi,c).replace(/#gallery-image#/gi,h.data("galleryImage")).replace(/#yanse#/gi," yanse").replace(/#colors#/gi,r.color4RBCHtml.replace(/#color#/gi,t.RBC.color)).replace(/#selected-color#/gi,t.RBC.color).replace(/#sizes#/gi,f.length>0?e.toString():r.noSizeHtml)}},addItem:function(t,r){var f=t.attr("href");n.ajax({type:"GET",cache:!1,url:vancl.addQueryString(f,"async","true"),beforeSend:function(){i.setGlobalLoadTip(!1)},success:function(t){i.valid(t)&&(n("#cart-gift").html(t),r&&delete u.removedProducts[vancl.getUrlValByName(f,"sku")],i.changed())},complete:function(){i.setGlobalLoadTip(!0)}})},add2Favorite:function(r,e,o){var s=r.attr("href");n.ajax({type:"GET",cache:!1,url:vancl.addQueryString(s,"async","true"),beforeSend:function(){e&&i.setGlobalLoadTip(!1)},success:function(h){i.valid(h)?(n("#cart-gift").html(h),o&&delete u.removedProducts[vancl.getUrlValByName(s,"sku")],e?i.changed():(i.cartInit(),i.add2RemovedList(u.removedProducts),f[0].loaded=!1,n(t).triggerHandler("scroll"))):a.add2Favorite=function(){i.add2Favorite(r,e)}},complete:function(){i.setGlobalLoadTip(!0)}})},add2RemovedList:function(t){var i=n("#remove-product"),e=r.delItemHtml,u=null,f=new stringBuilder;n.each(t,function(n,t){if(t===null||typeof t!="object")return!0;var i=t;u=i.isPoint?null:r.add2FavHtml.replace(/#add-faverate-url#/gi,i.addFaverateUrl);f.append(e.replace(/#product-url#/gi,i.productUrl).replace(/#img-url#/gi,i.imgUrl).replace(/#name#/gi,i.productName).replace(/#size#/gi,i.size).replace(/#price#/gi,i.price).replace(/#amount#/gi,i.amount).replace(/#is-point#/gi,i.isPoint).replace(/#clothes-code#/gi,i.clothesCode).replace(/#add-item-url#/gi,i.addItemUrl).replace(/#add-fav-html#/gi,u||""))});i.find("tbody").html(f.toString());i.find("tbody>tr").length>0?i.show():i.hide()},del:function(t){var r=t.attr("href"),u=t.closest("tbody").is("#present-product"),f=vancl.getUrlValByName(r,"ispoint")==="true"?!0:!1;n.ajax({type:"GET",cache:!1,url:vancl.addQueryString(r,"async","true"),beforeSend:function(){i.setGlobalLoadTip(!1)},success:function(r){i.valid(r)&&(u||i.getRemovedList(t.closest("tr"),f),n("#cart-gift").html(r),i.changed(!u))},complete:function(){i.setGlobalLoadTip(!0);i.loadMediaVIframe()}})},emptyOfflineProduct:function(){n.ajax({type:"GET",dataType:"text",url:vancl.addQueryString(n("#offline-product").find("thead .clear-offline-product").attr("href"),"async","true"),success:function(){},complete:function(){n("#offline-product").empty().hide()}})},batchDelCart:function(t,u){if(this.hasChecked(u))p({title:r.tipStr,msg:t[0].checked?r.batchDelAllTip:r.batchDelTip,fn:function(){n.ajax({type:"GET",url:r.batchdelcartUrl,beforeSend:function(){i.setGlobalLoadTip(!1)},success:function(t){if(i.valid(t)){var r=n("[name='vancl-general-product']").children(".selected"),u=n("[name='#vancl-point-product']").children(".selected"),f=n("[name='supplier-general-product']").children(".selected"),e=n("[name='supplier-point-product']").children(".selected");i.getRemovedList(r,!1);i.getRemovedList(u,!0);i.getRemovedList(f,!1);i.getRemovedList(e,!0);n("#cart-gift").html(t);i.changed()}},complete:function(){i.setGlobalLoadTip(!0);i.loadMediaVIframe()}})}});else{v({title:r.tipStr,msg:r.noCheckedDelTip});return}},updateAllSettlementStatus:function(t){var u=r.updateAllSettlementStatusUrl+"?settlementStatus="+t+"&async=true";n.ajax({type:"GET",cache:!1,url:u,beforeSend:function(){i.setGlobalLoadTip(!1)},success:function(t){i.valid(t)&&(n("#cart-gift").html(t),i.changed())},complete:function(){i.setGlobalLoadTip(!0)}})},updateSettlementStatus:function(t){var u=t,e=u.nextAll("input[name='promotionId']").val(),o=u.nextAll("input[name='promotionIndex']").val(),f=r.updateSettlementStatusUrl+"?sku="+u.closest("tr").find("input[name='sku']").val()+"&isPoint="+u.closest("tr").find("input[name='ispoint']").val()+"&settlementStatus="+u.attr("checked");typeof e!="undefined"&&e.length>0&&(f=f+"&promotionId="+e+"&promotionIndex="+o);f=f+"&async=true";n.ajax({type:"GET",cache:!1,url:f,beforeSend:function(){i.setGlobalLoadTip(!1)},success:function(t){i.valid(t)&&(n("#cart-gift").html(t),i.changed())},complete:function(){i.setGlobalLoadTip(!0)}})},updateVanclSettlementStatus:function(t){var f=t,u=r.updateVanclSettlementStatusUrl+"?settlementStatus="+t+"&async=true";n.ajax({type:"GET",cache:!1,url:u,beforeSend:function(){i.setGlobalLoadTip(!1)},success:function(t){i.valid(t)&&(n("#cart-gift").html(t),i.changed())},complete:function(){i.setGlobalLoadTip(!0)}})},updateSupplierSettlementStatus:function(t){var u=r.updateSupplierSettlementStatusUrl+"?settlementStatus="+t+"&async=true";n.ajax({type:"GET",cache:!1,url:u,beforeSend:function(){i.setGlobalLoadTip(!1)},success:function(t){i.valid(t)&&(n("#cart-gift").html(t),i.changed())},complete:function(){i.setGlobalLoadTip(!0)}})},updateShopSettlementStatus:function(t){var u=t,f=r.updateShopSettlementStatusUrl+"?shopID="+u.attr("shopid")+"&settlementStatus="+u.attr("checked")+"&async=true";n.ajax({type:"GET",cache:!1,url:f,beforeSend:function(){i.setGlobalLoadTip(!1)},success:function(t){i.valid(t)&&(n("#cart-gift").html(t),i.changed())},complete:function(){i.setGlobalLoadTip(!0)}})},decrease:function(t){var i=n(t);if(i.is(".decrease-disable"))return!1;this.submitUpdateQty(vancl.addQueryString(i.attr("href"),"async","true"))},increase:function(t){var i=n(t);if(i.is(".increase-disable"))return!1;this.submitUpdateQty(vancl.addQueryString(i.attr("href"),"async","true"))},updateQty:function(n){var t=n,i=t.parent().attr("action")+"?sku="+t.nextAll("input[name='sku']").val()+"&qty="+t.val()+"&isPoint="+t.nextAll("input[name='ispoint']").val()+"&async=true";this.submitUpdateQty(i,t)},submitUpdateQty:function(t,r){n.ajax({type:"GET",cache:!1,url:t,beforeSend:function(){i.setGlobalLoadTip(!1)},success:function(t){i.valid(t)?(n("#cart-gift").html(t),i.changed()):typeof r!="undefined"&&r.val(r.nextAll("input[name='product-qty']").val())},complete:function(){i.setGlobalLoadTip(!0)}})},updateSize:function(t,i){var h=t.closest("li"),f=h.find("input.add-to-cart"),r=f.data("product-colors").colors[t.data("index")],e=t.closest(".choose").find(".choose-gallery"),o=t.find("img").attr("alt"),u;e.attr({href:t.attr("href"),title:o});e.find("img").attr({src:t.data("gallery-image"),alt:o});t.siblings().removeClass("selected");t.addClass("selected");var c=t.attr("href"),l=r.productCode,a=r.promoteeId,v=r.promoteeIndex,y=vancl.getUrlValByName(c,"ref",!0),p=f.data("product-sizes")["p"+l],s=new stringBuilder;n.each(p,function(n,t){s.append(i.replace(/#promotee-id#/gi,a).replace(/#promotee-index#/gi,v).replace(/#sku#/gi,t.sku).replace(/#ref#/gi,y).replace(/#size#/gi,t.size))});u=t.closest(".shangpin").nextAll(".chima");u.html(s.toString());u.children("a:eq(0)").click()},updateSuperPresentSize:function(t){var f=t.closest(".super-present-shangpin").nextAll(".super-present-chima"),i=t.closest(".super-present-content"),o=i.prevAll(".super-present-gallery"),s=i.find(".choose-it").find("span:eq(0)"),h=i.find("div.title:eq(0)>.super-present-name"),c=t.data("product-sizes").sizes,u=t.find("img"),e=new stringBuilder;h.attr({href:t.attr("href"),title:u.attr("alt")}).text(u.attr("alt"));s.text(u.attr("title"));o.attr("src",t.data("bigimg-url"));n.each(c,function(n,t){e.append(r.superPresentSizeHtml.replace(/#url#/gi,t.url).replace(/#size#/gi,t.size))});f.html(e.toString());f.children("a:eq(0)").click()},barSummaryMove:function(){var u=document.documentElement.scrollTop?document.documentElement.scrollTop:document.body.scrollTop,i,r;n(".bar-empty").length>0&&(i=n(".bar-empty").offset().top,r=n(t).height(),i>=r?u+r-i<70?n("#bar-summary").css("top",u+r-i-90):n("#bar-summary").css("top",0):n("#bar-summary").css("top",0))},checkOut:function(){var t=n("#cart-product").find(".btn-panel .checkout"),u;t.is(".checkout-loading")||(u=t.attr("href"),t.addClass("checkout-loading"),i.setmodalLoadTip(t,r.checkOutLoading),a.isCheckOut=!0,n.ajax({type:"GET",cache:!1,url:vancl.addQueryString(u,"async","true"),beforeSend:function(){},success:function(u){i.valid(u)?n("body").data("is-login-status")&&n("body").data("is-login-status",!1):t.removeClass("checkout-loading").text(r.checkOutTxt)},error:function(){t.removeClass("checkout-loading").text(r.checkOutTxt)},complete:function(){}}))},recommendRecentFavoriteCallback:function(n){var t=n.find(".pager-panel"),r=t.prevAll("ul.product-list").children();i.commonPagination(t,r,u.itemsPerPage)},loadMediaVIframe:function(){try{}catch(n){}},loadRecentFavorite:function(t){var u;switch(t){case r.recent:c[0].loaded=!0;u=r.recentUrl;this.setmodalLoadTip(c);break;case r.favorite:f[0].loaded=!0;u=r.favoriteUrl;this.setmodalLoadTip(f)}n.ajax({type:"GET",url:u,cache:!1,global:!1,beforeSend:function(){},success:function(n){if(i.valid(n))switch(t){case r.recent:c.html(n);i.recommendRecentFavoriteCallback(c);break;case r.favorite:f.html(n);i.recommendRecentFavoriteCallback(f)}},error:function(){switch(t){case r.recent:c.html("");break;case r.favorite:f.html("")}}})},loadRecommend:function(){h[0].loaded=!0;this.setmodalLoadTip(h);var t=[];n("#vancl-general-product").find("input[name='product-code']").each(function(i){if(i<10)t.push(n(this).val());else return!1});n.ajax({type:"GET",url:r.recommendUrl,data:{productCodes:t.join(",")},cache:!1,global:!1,beforeSend:function(){},success:function(n){i.valid(n)&&(h.html(n),i.recommendRecentFavoriteCallback(h))},error:function(){h.html(r.emptyRecommendHtml)}})},loadRecent:function(){this.loadRecentFavorite(r.recent)},loadFavorite:function(){this.loadRecentFavorite(r.favorite)},loadCollocate:function(){y.show();i.setmodalLoadTip(s,u.collocateListLoadingHtml);s.show();n("#coudan-differ").text("¥"+n("#collocate").attr("data"));i.commonPosition(n("#cart-collocate"));n.ajax({type:"GET",url:r.loadCollocate,cache:!1,global:!1,beforeSend:function(){},success:function(t){var r,f,e;i.valid(t)&&(s.html(t),r=s.find(".pager-panel"),f=r.prevAll("ul.product-list").children(),i.commonPagination(r,f,u.itemsPerPageOther),r.hide(),i.commonPosition(n("#cart-collocate")),e=f.length,e<5&&n("#collocate-list .prev, #collocate-list .next").css("background-image","none"))},error:function(){s.html("")}})},loadCollocateColors:function(t,i){n.ajax({type:"GET",url:t,cache:!1,global:!1,async:!0,success:function(n){i(n)},error:function(){s.html("")}})}};t.cart=i;t.cartSetting=r;t.account=a;t.globalSetting=u})}(jQuery,window);$(function(){var f=$("#header"),s=$("#point-tip"),i=$("#gift"),t=$("#recom-browse-collect"),n=$("#content"),r=vancl.simpleDialog,e=vancl.dialog.alert,o=vancl.dialog.confirm,u;cart.loadCart(!0);$("body").delegate("#favorite .login","click",function(){return account.LoginOnCart(!1),!1});$("body").click(function(){});f.bind("click",function(n){var t=$(n.target);return t.is(".login,.switch")?(account.LoginOnCart(!1),!1):t.is(".reg")?(account.LoginOnCart(!0),!1):t.is(".logout")?(account.LoginOutOnCart(),!1):void 0});n.bind("click",function(n){var t=$(n.target),i=$("#cart>.tip");return t.is(".login")?(account.LoginOnCart(!1),!1):t.is(".gwqd")?(i.show(),!1):t.is("#cart>.tip>.close")?(i.hide(),!1):void 0});n.delegate("#offline-product thead a","click",function(){return cart.emptyOfflineProduct(),!1});n.delegate("#offline-product tbody .add-faverate","click",function(n){return r(n,{sure:function(){cart.add2Favorite($(n.target),!1)},msg:globalSetting.add2FavoriteMsg}),!1});n.delegate("#point-tip .close","click",function(){return $("#point-tip").slideUp(),!1});n.delegate("#cart-product tbody .decrease,#cart-product tbody .increase,#cart-product tbody .add-faverate,#cart-product tbody .del, #cart-product .checkout","click",function(n){var t=$(this),i,u;if(t.is(".decrease"))cart.decrease(this);else if(t.is(".increase"))cart.increase(this);else if(t.is(".add-faverate"))i=r(n,{sure:function(){cart.add2Favorite(t,!0)},msg:globalSetting.add2FavoriteMsg}),i.find(".sure,.cancel,.cancel-icon").toggleClass("track",!0),i.find(".sure").attr("name","sp_cart_mycart_addfaverate"),i.find(".cancel,.cancel-icon").attr("name","sp_cart_mycart_canclfaverate");else if(t.is(".del"))u=r(n,{sure:function(){cart.del(t)},msg:globalSetting.delMsg}),u.find(".sure,.cancel,.cancel-icon").toggleClass("track",!0),u.find(".sure").attr("name","sp_cart_mycart_delok"),u.find(".cancel,.cancel-icon").attr("name","sp_cart_mycart_delcancl");else if(t.is(".checkout")){if(!cart.hasChecked($("#batchdelcart input[name='p-item']")))return e({title:globalSetting.tipStr,msg:globalSetting.batchCheckOutTip}),!1;if(cart.setPointTip())return!1;cart.checkOut()}return!1});n.delegate("#cart-product input[name='all-products'], #cart-product input[name='p-item'] ,#cart-product input[name='vancl-products'] ,#cart-product input[name='supplier-products'],#cart-product input[name='products-shop']","click",function(n){var t=$(this),i=t.closest("#cart-product"),v=i.find("input[name='all-products']"),y=i.find("input[name='p-item']"),r,u,h,c,f,l,e,a,s;t.is("input[name='all-products']")?(r=t[0].checked,u=t.attr("data-del-tip"),r||u==0?(t.attr("checked",r),h=i.find("input[type='checkbox']"),cart.allCbxClick(t,h,function(){cart.setAllTrStyle(t)}),cart.updateAllSettlementStatus(t[0].checked)):(n.preventDefault(),o({title:globalSetting.tipStr,msg:u,fn:function(){t.attr("checked",r);var n=i.find("input[type='checkbox']");cart.allCbxClick(t,n,function(){cart.setAllTrStyle(t)});cart.updateAllSettlementStatus(t[0].checked)}}))):t.is("input[name = 'vancl-products']")?(c=i.find("#batchdelcart input[name ='products-shop'][issupplier='False']"),f=i.find("#batchdelcart input[name='p-item'][issupplier='False']"),cart.allCbxClick(t,c,null),cart.allCbxClick(t,f,function(){f.each(function(){var n=$(this),t=n.attr("data-del-tip");cart.setTrStyle(n)})}),cart.updateVanclSettlementStatus(t[0].checked)):t.is("input[name = 'supplier-products']")?(l=i.find("#batchdelcart input[name ='products-shop'][issupplier='True']"),e=i.find("#batchdelcart input[name='p-item'][issupplier='True']"),cart.allCbxClick(t,l,null),cart.allCbxClick(t,e,function(){e.each(function(){var n=$(this),t=n.attr("data-del-tip");cart.setTrStyle(n)})}),cart.updateSupplierSettlementStatus(t[0].checked)):t.is("input[name ='products-shop']")?(a=t.attr("shopid"),s=i.find("#batchdelcart input[name='p-item'][shopid='"+a+"']"),cart.allCbxClick(t,s,function(){s.each(function(){var n=$(this),t=n.attr("data-del-tip");cart.setTrStyle(n)})}),cart.updateShopSettlementStatus(t)):t.is("input[name = 'p-item']")&&(cart.updateSettlementStatus(t),cart.singleCbxClick(v,y,t,function(){var n=t.attr("data-del-tip");cart.setTrStyle(t)}))});n.delegate(".batch-del-cart","click",function(){var n=$(this).closest("#batchdelcart").find("table td.bar input[name = 'p-item']"),t=$(this).prevAll("input[name='all-products']");return cart.batchDelCart(t,n),!1});n.delegate("#collocate","click",function(n){n.preventDefault();cart.loadCollocate()});n.delegate("#cart-collocate .coudan-title .close","click",function(){$(".coudan-title,#collocate-list").hide();$(".coudan-content").height("")});n.delegate("#cart-product input[name='qty']","keydown change",function(n){var t=$(this),i=n.which;if(n.type==="keydown"&&i===13||n.type==="change")return parseInt(t.val())<1?vancl.dialog.alert({title:globalSetting.tipStr,msg:globalSetting.updateQtyMsg,modal:!0,fn:function(){$(this).dialog("close");t.val(1);cart.updateQty(t);t.focus()}}):cart.updateQty(t),!1});n.delegate("#cart-product .discount-logo","mouseenter mouseleave",function(n){var t=n.type,r=$(this),i=r.next(".discount-dialog");return t==="mouseenter"?i.show():t==="mouseleave"&&i.hide(),!1});n.delegate("#remove-product .rebuy,#remove-product .addfav","click",function(n){var t=$(this);return t.is(".rebuy")?cart.addItem(t,!0):t.is(".addfav")&&r(n,{sure:function(){cart.add2Favorite(t,!1,!0)},msg:globalSetting.add2FavoriteMsg}),!1});n.delegate("#super-present .super-present-more, #super-present .super-present-add2cart,#super-present .super-present-color,#super-present .super-present-size, #super-present .super-present-sure,#super-present .super-present-close","click",function(n){var t,r,u,i;n.preventDefault();t=$(this);t.is(".super-present-more")?(r=t.parent(),r.is(".super-present-shangpin")&&(u="color"),cart.hideChooseDialogFixIe(),cart.createSuperPresentPopup(u,t)):t.is(".super-present-add2cart")?cart.addItem(t.closest(".super-present-content").find(".super-present-chima .selected")):(n.stopPropagation(),t.is(".super-present-close")||t.is(".super-present-sure")?t.closest(".choose").hide():(t.is(".super-present-color")?(i=t.closest(".super-present-shangpin").find(".super-present-color"),t.is(".selected")||cart.updateSuperPresentSize(t)):(i=t.closest(".super-present-chima").find(".super-present-size"),t.closest(".content").nextAll(".choose-it").find("span:eq(1)").text(t.text())),i.removeClass("selected"),t.addClass("selected")))});n.delegate("#gift-item-panel .tab>li,#gift .list-img-panel,#gift .name,#gift .add-to-cart,#gift .close,#gift .sure,#gift .color,#gift .size,#collocate-list .color,#collocate-list .add-to-cart,#collocate-list .close,#collocate-list .sure,#collocate-list .size","click",function(n){var u,r,h,e,o;n.preventDefault();var c=$(".choose"),t=$(this),s=$(".product-list"),l=$(".product-list").children("li"),i=t.closest("li");if(t.is(".tab>li")){var f=t.parent(),s=f.parent().find(".product-list-panel"),a=f.children("li").index(t);cart.hideChooseDialogFixIe();f.children("li").removeClass("selected");t.addClass("selected");s.hide().eq(a).show();$(window).triggerHandler("scroll")}else if(t.is(".add-to-cart"))i.find(".choose").length<1&&(t.attr("name")==="sp_cart_mycar_collocate-add"?(u=i.find("form").attr("action"),i.append(cart.createPopupProduct({collocate:{productCode:u.substr(38,7),empty:!0}},t)),r=i.find(".choose"),cart.setmodalLoadTip(r,globalSetting.collocateLoadHtml),cart.loadCollocateColors(u,function(n){t.attr("data-product-sizes",n.sizes);t.attr("data-product-colors",n.colors);var i=cart.createPopupProduct({collocate:{productCode:u.substr(38,7),empty:!1,sizes:t.data("product-sizes"),colors:t.data("product-colors")}},t),f=$(i).find(".choose-inner");r.html(f);r.find(".content>.shangpin>a.selected").removeClass("selected").click();cart.collocateColorInit(r.find(".content>.shangpin"),"105")}),i.closest("ul").children().filter(":visible:eq(3),:visible:eq(4),:visible:eq(8),:visible:eq(9)").find(".choose").toggleClass("left",!0)):(h=t.data("product-colors"),i.append(cart.createPopupProduct({present:h},t)),i.closest("ul").children().filter(":visible:gt(2)").find(".choose").toggleClass("left",!0))),i.is(".selected")||(c.hide(),s.removeClass("selected"),l.removeClass("selected"),i.addClass("selected").closest("ul").addClass("selected"),i.find(".content>.shangpin>a:eq(0)").click()),i.find(".choose").show();else if(t.is(".list-img-panel")||t.is(".name"))i.find(".add-to-cart").click();else if(t.is(".close"))t.closest(".choose").hide();else if(t.is(".sure")){if(e=t.closest(".choose").find(".content .chima>.selected"),e.length<=0)return;cart.addItem(e)}else t.is(".color")?t.is(".selected")||(t.siblings().removeClass("selected"),t.addClass("selected"),t.closest(".content").next().children("span:eq(0)").text(t.children("img").attr("title")),t.data("index",t.parent().children().index(t)),o=cartSetting.sizeHtml,t.attr("name")=="sp_cart_mycart_collocate_color"&&(o=cartSetting.sizeHtml4Collocate),cart.updateSize(t,o)):t.is(".size")&&(t.siblings().removeClass("selected"),t.addClass("selected"),t.closest(".content").next().children("span:eq(1)").text(t.text()))});n.delegate("#recom-browse-collect .list-img-panel,#recom-browse-collect .name,#recom-browse-collect .add-to-cart,#recom-browse-collect .close,#recom-browse-collect .sure,#recom-browse-collect .size","click",function(n){var r,u,f;n.preventDefault();var e=$(".choose"),t=$(this),o=$(".product-list").children("li"),i=t.closest("li");t.is(".add-to-cart")?(i.find(".choose").length<1&&(r=t.data("product-sizes"),u=t.data("product-color"),i.append(cart.createPopupProduct({RBC:{sizes:r,color:u}},t))),i.is(".selected")||(e.hide(),o.removeClass("selected"),i.addClass("selected"),i.find(".content>.chima>a:eq(0)").click()),i.closest("ul").children().filter(":visible:gt(2)").find(".choose").toggleClass("left",!0),i.find(".choose").show()):t.is(".list-img-panel")||t.is(".name")?i.find(".add-to-cart").click():t.is(".close")?t.closest(".choose").hide():t.is(".sure")?(f=t.closest(".choose").find(".content .chima>.selected"),cart.addItem(f),t.closest(".product-list-panel").is("#favorite")&&t.closest("li.selected").remove()):t.is(".size")&&(t.siblings().removeClass("selected"),t.addClass("selected"),t.closest(".content").next().children("span:eq(1)").text(t.text()))});n.delegate("#recom-browse-collect .tab>li","click",function(n){n.preventDefault();var u=t.find(".product-list-panel"),r=$(this),f=r.parent(),i=f.children("li").index(r);if(cart.hideChooseDialogFixIe(),f.children("li").removeClass("selected"),r.addClass("selected"),u.filter(":not(:eq("+i+"))").hide(),t.children("div:eq("+i+")").show(),!u.eq(i)[0].loaded)switch(i){case 0:cart.loadRecent();break;case 1:cart.loadRecommend();break;case 2:cart.loadFavorite()}});n.delegate("#gift-shop-panel .tab>li","click",function(n){n.preventDefault();var r=i.find("#gift-item-panel"),t=$(this),u=t.parent(),f=t.data("shop");cart.hideChooseDialogFixIe();u.children("li").removeClass("selected");t.addClass("selected");r.each(function(){var n=$(this);n.data("shop")==f?n.show():n.hide()})});u=null;$(window).bind("scroll",function(){cart.barSummaryMove();clearTimeout(u);u=setTimeout(function(){var n,f;if(i[0].loaded||$.belowthefold(i[0],{threshold:0,container:window})||(cart.loadGift(i),i[0].loaded=!0),n=t.filter(":above-the-fold").length>0,n){var r=t.find(".tab"),u=r.find("li").index(r.find(".selected")),e=t.find(".product-list-panel");e.eq(u)[0].loaded||t.find(".tab>li:eq("+u+")").click()}f=location.protocol==="http:";$("img.lazy:visible").each(function(){var t=$(this),n;t.filter(":above-the-fold").length>0&&!this.loaded&&(n=t.data("origin"),n=f?n.replace(staticResourcePath.sslimg,staticResourcePath.img):n,t.attr("src",n),this.loaded=!0)})},500)});$(window).resize(function(){$(window).triggerHandler("scroll");cart.barSummaryMove();cart.commonPosition($("#cart-collocate"))});n.delegate(".product-list-panel>div.prev,.product-list-panel>div.next,#collocate-list>div.prev,#collocate-list>div.next","click",function(){var n=$(this),t;t=n.is("#collocate-list>div.prev")||n.is("#collocate-list>div.next")?Math.ceil(n.siblings("ul.product-list").children().length/globalSetting.itemsPerPageOther):Math.ceil(n.siblings("ul.product-list").children().length/globalSetting.itemsPerPage);n.is(".prev")?cart.goToPage(t,n.nextAll(".pager-panel"),!1):n.is(".next")&&cart.goToPage(t,n.nextAll(".pager-panel"),!0)})})