var proModule,banner,multiple,tiaojiao,duoxuan,pajax,getUrlParam,changeURLArg,addmore,select,pro_main_top,shoucang;multiple=function(){$(document).off("click",".tiaojiao-sort .sl .inner .sl-list ul li a").on("click",".tiaojiao-sort .sl .inner .sl-list ul li a",function(t){t.preventDefault();var e=$(this),a=$(this).parent("li").parent("ul").parent(".sl-list").parent(".inner").prev("input"),n=a.is(":checked"),i=window.location.protocol+"//"+window.location.host+window.location.pathname+"?1=1",o=".brand-main-list",r=".brand-main-list";if(n)e.parent("li").toggleClass("selected"),duoxuan(),$(document).off("click",".tiaojiao-sort .sl .sl-list .dx-ctrl a").on("click",".tiaojiao-sort .sl .sl-list .dx-ctrl a",function(t){var e=$(this).parent(".dx-ctrl").parent(".sl-list").find("ul li.selected");if(e.length>0){var n=e.eq(0).find("a").attr("data-type"),l="";e.each(function(t,a){l=l+","+e.eq(t).find("a").attr("data-value")}),i=changeURLArg(window.location.href,n,l.substring(1)),$.support.pjax&&($.pjax({url:i,container:o,fragment:o,timeout:8e3,scrollTo:!1,replace:!0}),$.pjax.click(t,o),pajax(i,o,r,function(){a.attr("checked",!1)}))}});else{var l=$(this).attr("data-type"),s=$(this).attr("data-value");i=changeURLArg(window.location.href,l,s),$.support.pjax&&($.pjax({url:i,container:o,fragment:o,timeout:8e3,scrollTo:!1,replace:!0}),$.pjax.click(t,o),pajax(i,o,r))}})},pajax=function(t,e,a,n){$(document).on("pjax:send",function(t){$("#progress").removeClass("done"),$(".pjaxcontainer").removeClass("on"),$({property:0}).animate({property:100},{duration:1e3,step:function(){var t=Math.round(this.property);$("#progress").css("width",t+"%"),100==t&&$("#progress").addClass("done")}})}),$(document).on("pjax:success",function(t,e,a,n){}),$(document).on("pjax:complete",function(){$("#progress").addClass("done")}),$(document).on("pjax:end",function(t,e,a,i){$(".pjaxcontainer").removeClass("on"),animated_contents(),n&&n()})},getUrlParam=function(t){var e=new RegExp("(^|&)"+t+"=([^&]*)(&|$)"),a=window.location.search.substr(1).match(e);return null!=a?unescape(a[2]):null},changeURLArg=function(url,arg,arg_val){var pattern=arg+"=([^&]*)",replaceText=arg+"="+arg_val;if(url.match(pattern)){var tmp="/("+arg+"=)([^&]*)/gi";return tmp=url.replace(eval(tmp),replaceText)}return url.match("[?]")?url+"&"+replaceText:url+"?"+replaceText},duoxuan=function(){var t=$(".tiaojiao-sort .sl input"),e=(t.is(":checked"),t.next(".inner")),a=e.find("li.selected"),n=e.find(".dx-ctrl a");a.length>0?n.removeClass("disable"):n.addClass("disable")},addmore=function(){$(".tiaojiao-sort .sl").each(function(t){var e=$(this),a=e.find(".sl-list ul li"),n=0;a.each(function(t,e){n=n+$(this).outerWidth()+35}),n<809&&(e.find(".inner .sl-list .ctrl a").hide(),e.find(".inner .sl-list .ctrl label").css("margin-right","20px"))}),$(".tiaojiao-sort .sl .inner .sl-list .ctrl a").click(function(t){var e=$(this).parent().parent().parent();e.toggleClass("on")})},select=function(){$(document).off("click",".select-tit").on("click",".select-tit",function(t){$(this).parent().parent().parent().addClass("on"),$(this).next().fadeToggle()}),$(document).off("click",".tiaojiao-sort .sl .sl-list .select ul li a").on("click",".tiaojiao-sort .sl .sl-list .select ul li a",function(t){$(this).parent().parent().hide();var e=$(this).html()+'<span class="jt-chevron-thin-down"></span>';$(this).parent().parent().prev().html(e)})},pro_main_top=function(){var t=new Swiper("#swiper-container2",{watchSlidesProgress:!0,watchSlidesVisibility:!0,slidesPerView:5,spaceBetween:20,onTap:function(){e.slideTo(t.clickedIndex)}}),e=new Swiper("#swiper-container3",{nextButton:".swiper-right",prevButton:".swiper-left",onSlideChangeStart:function(){updateNavPosition()}});updateNavPosition=function(){$("#swiper-container2 .active-nav").removeClass("active-nav");var a=$("#swiper-container2 .swiper-slide").eq(e.activeIndex).addClass("active-nav");if(!a.hasClass("swiper-slide-visible"))if(a.index()>t.activeIndex){var n=Math.floor(t.width/a.width())-1;t.slideTo(a.index()-n)}else t.slideTo(a.index())}},shoucang=function(){$(".pro_main_top .shoucang a").click(function(t){t.preventDefault(),$(this).find("span").toggleClass("sc-star-outlined").toggleClass("sc-star")})},(proModule=function(){navactive(0),$(".change_duoxuan").attr("checked",!1),duoxuan(),multiple(),addmore(),select(),pro_main_top(),shoucang()})();