!function(t){"use strict";window.Filter=function(t){this.base_url=t,this.attributes={},this.other_params={}},window.Filter.prototype={addAttribute:function(t,e){t=parseInt(t),e=parseInt(e),isNaN(t)||isNaN(e)||(t in this.attributes&&this.attributes[t]instanceof Array||(this.attributes[t]=[]),this.attributes[t].indexOf(e)<0&&this.attributes[t].push(e))},removeAttribute:function(t,e){if(t=parseInt(t),e=parseInt(e),!isNaN(t)&&!isNaN(e)){if(t in this.attributes&&this.attributes[t]instanceof Array){var i=this.attributes[t].indexOf(e);i>=0&&this.attributes[t].splice(i,1)}this.attributes[t].length||delete this.attributes[t]}},filter:function(t){this.filterAjax(t)},filterAjax:function(e){if("object"==typeof window.history&&history.replaceState){var i=this.buildRequestURI();history.replaceState(null,null,i),"function"==typeof e&&t.get(i,e)}else this.filterReload()},filterReload:function(){window.location=this.buildRequestURI()},buildRequestURI:function(){var t=this.base_url||window.base_url||"/",e=[];for(var i in this.attributes)this.attributes[i].length&&e.push(i+"="+this.attributes[i].unique().join("-"));this.price_min&&e.push("rmin="+this.price_min),this.price_max&&e.push("rmax="+this.price_max),this.sort&&e.push("sort="+this.sort),this.row_by_page&&e.push("row_by_page="+this.row_by_page),this.display&&e.push("display="+this.display),this.search&&e.push("keywords="+encodeURIComponent(this.search)),this.search_name&&e.push("filter_slov="+encodeURIComponent(this.search_name));for(var r in this.other_params)e.push(encodeURIComponent(r)+(this.other_params[r]?"=":"")+encodeURIComponent(this.other_params[r]));return this.other_params.language&&window.language&&e.push("language="+encodeURIComponent(window.language)),t+=(e.length>0?"?":"")+e.join("&")}},window.Filter.prototype.constructor=window.Filter,window.Filter.fromCurrent=function(){var t=new Filter(location.origin+location.pathname);if(location.search)for(var e,i,r,n=location.search.replace(/^\?/,"").split("&"),o=n.length;o--;)if(n[o])if(e=n[o].split("="),e[0]=decodeURIComponent(e[0]),isNaN(parseInt(e[0]))){if("rmin"===e[0]){if(e.length<1||!e[1])continue;i=parseInt(e[1]),isNaN(i)||(t.price_min=i)}else if("rmax"===e[0]){if(e.length<1||!e[1])continue;i=parseInt(e[1]),isNaN(i)||(t.price_max=i)}else if("sort"===e[0]){if(e.length<1||!e[1])continue;t.sort=e[1]}else if("row_by_page"===e[0]){if(e.length<1||!e[1])continue;i=parseInt(e[1]),isNaN(i)||(t.row_by_page=i)}else if("display"===e[0])t.display="list"===e[1]?"list":"columns";else if("keywords"===e[0]){if(e.length<1||!e[1])continue;(i=decodeURIComponent(e[1]).trim())&&(t.search=i)}else if("filter_slov"===e[0]){if(e.length<1||!e[1])continue;(i=decodeURIComponent(e[1]).trim())&&(t.search_name=i)}}else{if(e.length<1||!e[1])continue;for(i=e[1].split("-"),r=0;r'+r+""),(i=$(".category-products-listing-container ~ .block-pagination")).length?i.html(r):$(".category-products-listing-container").after('
'+r+"
")):$(".block-pagination").remove();var n=t.getElementsByTagName("products");n&&n.length&&$(".category-products-listing-container").html(n.item(0).textContent).removeClass("loading");var o=t.getElementsByTagName("filters");o&&o.length&&($(".box-filter").replaceWith(o.item(0).textContent),e())}}},$(document).on("change","#sort-order, #display-items",function(){return window.category.filter[this.name]=this.value,window.category.onBeforeFilter(),window.category.filter.filter(window.category.onAfterFilter),!0}),$(document).on("click",".view-switch button",function(){return window.category.filter[this.name]=this.value,window.category.onBeforeFilter(),window.category.filter.filter(window.category.onAfterFilter),!1}),$(document).on("change","#currency",function(){return window.category.filter.other_params[this.name]=this.value,delete window.category.filter.price_min,window.category.filter.price_max,window.category.filter.filterReload(),!1}),t.on("click",".load-more-products-block .button",function(){return window.category.filter.row_by_page=$(this).attr("data-row-by-page"),window.category.onBeforeFilter(),window.category.filter.filter(window.category.onAfterFilter),!1}),$(".box-filter").length&&e()})}(jQuery);