function searchSubmit(){$("#searchbox option:selected").val($(".selectize-input input").val().trim()),$("#searchbox-form").submit()}function getQueryVariable(e){for(var t=window.location.search.substring(1),a=t.split("&"),i=0;i
'+t(e.name)+'
'}},optgroups:[{value:"deal",label:"Deals"},{value:"category",label:"Categories"}],optgroupField:"class",optgroupOrder:["deal","category"],load:function(e,t){return e.length?void $.ajax({url:"/search/get",type:"GET",dataType:"json",data:{keywords:e.trim(),category:$("#search-category").val()},error:function(){t()},success:function(e){t(e.data)}}):t()},onChange:function(){window.location=this.items[0]}}),$(".selectize-dropdown-content").after('See More'),$(".selectize-input").append('');var e=getQueryVariable("keywords");$(".selectize-input input").val(e),$("#search-category").selectmenu({change:function(e,t){var a=$("#searchbox")[0].selectize;a.clear(),a.clearOptions()}}),$(".selectize-input").keypress(function(e){13==e.keyCode&&($("#searchbox option:selected").val($(".selectize-input input").val().trim()),$("#searchbox-form").submit())})});