")}$(window).load(function(){$("input:checkbox").each(function(){n(this)});$("input:checkbox").change(function(){n(this)})});$("#CbAs").on("click",function(){var t=$(".advanced-search-child").length,n=$(".advanced-search-child").first().clone();n.find("[name^='SpecificationAttributeSearchItems']").each(function(){$(this).attr("name",$(this).attr("name").replace("0",t))});n.find("[id^='SpecificationAttributeSearchItems']").each(function(){$(this).attr("id",$(this).attr("id").replace("0",t))});$(n).find("select").val($(n).find("select option:first").val());$(n).find("span").html($(n).find("select option:first").text());$(n).find("input[type='text']").val("");n.appendTo($("#advanced-search-block"))});$("#call-save-search-dialog").on("click",function(n){n.preventDefault();$("#saved-search-dialog").dialog()});$("#save-search-dialog-button").on("click",function(n){n.preventDefault();var t=$("#saved-search-name").val(),i={savedSearchName:t};addAntiForgeryToken(i);$.ajax({cache:!1,type:"POST",url:"/Catalog/SavedSearchNameExists",data:i,dataType:"json",success:function(n){n.savedSearchNameExists?$("#update-saved-search-dialog").dialog():($('input[name="nameOfSearch"]').val(t),$("#advanced-search").submit())},error:function(){alert("Hiba történt az adatok mentése közben!")}})});$(".update-saved-search").on("click",function(){if($(this).data("value")=="ok"){var n=$("#saved-search-name").val();$('input[name="nameOfSearch"]').val(n);$("#advanced-search").submit()}else $(".ui-dialog-titlebar-close").trigger("click"),$("#saved-search-name").val("")});$("form#advanced-search select#cid").change(function(){let n=$("form#advanced-search").serialize();$.ajax({cache:!1,type:"POST",url:"/ProductSearchAjax/LoadSubCategories",data:n,success:function(n){$("#subcategories_dropdown_container").html(n);handleCustomSelect()},error:function(){alert("Hiba történt az alketóriák betöltése közben")}})})})