!function(o){function r(){var i,t=parseInt(o(".box-filter .price .price-min").attr("min")),e=parseInt(o(".box-filter .price .price-max").attr("max")),n=parseInt(o(".box-filter .price .price-min").val()),a=parseInt(o(".box-filter .price .price-max").val());o(".box-filter .price .selector").slider({range:!0,min:t,max:e,values:[n,a],slide:function(t,e){n!=e.values[0]?i=0:a!=e.values[1]&&(i=1),o(".box-filter .price .price-min").val(e.values[0]),o(".box-filter .price .price-max").val(e.values[1]),window.category.watcher(t.timeStamp,i)}}),o(".box-filter .price input").on("input",function(t){o(".box-filter .price .selector").slider("values",o(this).hasClass("price-min")?0:1,this.value),window.category.watcher(t.timeStamp)})}function l(){o(".box-filter .options").each(function(){var i=o(this).find(".option:gt(5)");i.hide(),0'+dictionary.TEXT_FILTER_MORE+"").click(function(t){var e=o(this).parents(".options");e.toggleClass("expanded"),e.hasClass("expanded")?(o(this).text(dictionary.TEXT_FILTER_LESS),o(this).addClass("up")):(o(this).text(dictionary.TEXT_FILTER_MORE),o(this).removeClass("up")),i.toggle(),t.preventDefault()}))})}function a(t){"object"==typeof window.history&&"function"==typeof history.replaceState||(location=t),o(".category-products-listing-container").addClass("loading"),history.replaceState(null,null,t),o.get(t,function(t){if(t instanceof Document){var e,i=t.getElementsByTagName("pagination");i&&i.length?(i=i.item(0).textContent,(e=o(".category-listing-params .block-pagination")).length?e.html(i):o(".category-listing-params").append('
'+i+"
"),(e=o(".category-products-listing-container ~ .block-pagination")).length?e.html(i):o(".category-products-listing-container").after('
'+i+"
")):o(".block-pagination").remove();var n=t.getElementsByTagName("products");n&&n.length&&o(".category-products-listing-container").html(n.item(0).textContent).removeClass("loading");var a=t.getElementsByTagName("filters");a&&a.length&&(o(".box-filter").replaceWith(a.item(0).textContent),r(),l())}},"xml")}var t=o(document);o(window),o(document.body);t.ready(function(){window.category={dateStart:null,watcher:function(t,e){this.timeout_id&&this.last_event&&t-this.last_event<1e3&&clearTimeout(this.timeout_id),this.timeout_id=setTimeout(function(){window.category.resetWatcher(),o(".box-filter .price input").eq(e).trigger("change")},1e3),this.last_event=t},resetWatcher:function(){clearTimeout(this.timeout_id),delete this.timeout_id,delete this.last_event}},o(".box-filter").length&&(t.on("click",".box-filter a, .load-more-products-block a",function(t){return a(this.href),!1}),t.on("change",".box-filter .price input, #display-items, #sort-order",function(){for(var t,e=location.search.replace(/^\?/,"").split("&"),i=e.length,n={};i--;)(t=e[i].split("="))[1]&&(n[t[0]]=t[1]||"");for(i in n[this.name]=this.value.trim(),e=[],n)e.push(i+(n[i]&&"=")+(n[i]||""));a(location.origin+location.pathname+(e.length&&"?")+e.join("&"))}),r(),l())})}(window.jQuery);