function favorites(){$(".drop").on("click",function(){var o=$(this).parent(".btn-favourites");o.hasClass("open-drop")?o.removeClass("open-drop"):o.addClass("open-drop")}),$("body").on("click",function(o){$(o.target).closest(".drop, .btn-favourites ul").length||$(".btn-favourites").hasClass("open-drop")&&$(".btn-favourites").removeClass("open-drop")})}function select(){var o=$(".selectbox");o.find("option").each(function(){for(var t=$("",{html:this.innerHTML}).css({position:"absolute",top:-9999,left:-9999}).appendTo("body"),s=(t.width(),o.width());t.width()>s;)t.text(function(o,t){return t.replace(/\W*\s(\S)*$/,"...")});this.innerHTML=t.text(),t.remove()})}$(document).ready(function(){$("body").on("click",function(o){$(o.target).closest(".button, .primary").length||$(".navigation").hasClass("open")&&$(".navigation").removeClass("open")}),$("body").on("click",".sort",function(o){$(o.target).closest(".sort").hasClass("open-sort")?$(".sort").removeClass("open-sort"):($(".sort").removeClass("open-sort"),$(o.target).closest(".sort").addClass("open-sort"))}),$("body").on("click",function(o){$(o.target).closest(".sort, strong, .drop").length||$(".sort").hasClass("open-sort")&&$(".sort").removeClass("open-sort")}),select(),favorites()});