$(document).ready(function(){$("ul#applyFilter").frescaFilter()});(function(a){a.fn.frescaFilter=function(j){var h=a(this);var c;var g={};var f=0+a("div.productCont").length;h.find("li a").click(function(k){k.preventDefault();if(!a(this).hasClass("filterDisabled")){e(a(this));i();d()}});function e(k){k.toggleClass("filterSelected");if(k.parents("li.filterGroup").find("a.filterSelected").length>0){k.parents("li.filterGroup").addClass("filterGroupActive")}else{k.parents("li.filterGroup").removeClass("filterGroupActive")}}function i(){a("div.productCont").removeClass("filterExclude","partialExclude");h.find(".filterGroupActive").each(function(){a("div.productCont").addClass("partialExclude");a(this).find("a.filterSelected").each(function(){a("div."+a(this).attr("id")).removeClass("partialExclude")});a("div.partialExclude").addClass("filterExclude")})}function b(){var l,k;a("div.productCont").removeClass("priceExclude").each(function(n,m){l=parseInt(a(this).attr("class").split(" ")[1].replace(/fMAXPRICE/,"")*100);k=parseInt(a(this).attr("class").split(" ")[2].replace(/fMINPRICE/,"")*100);if(g.currentMinPrice>l||g.currentMaxPrice<k){a(this).addClass("priceExclude")}})}function d(n){var l,o,k,m;var p=a("div.productCont");h.find("a").not(".sort").each(function(q){m=a(p).filter("."+a(this).attr("id")).not(".priceExclude");k=a(this).parents("li.filterGroup");a(k).siblings(".filterGroupActive").each(function(){a(this).find("a.filterSelected").each(function(){a(m).filter("."+a(this).attr("id")).addClass("partialInclude")});m=a(m).filter(".partialInclude").removeClass("partialInclude")});l=0+m.length;if(n!="priceFilter"&&l==0){a(this).removeClass("filterSelected")}(l>=1)?a(this).removeClass("filterDisabled").find("span").html(l):a(this).addClass("filterDisabled").find("span").html("0")});f=0+a(p).filter(":visible").length;(f==0)?a("p#filterNoProducts").show():a("p#filterNoProducts").hide();a("span.counterNumber").html(""+f+"");a("div#categoryCMSCont").hide()}}})(jQuery);