text: ﻿(function(a){a(".mg-option input[type=checkbox]").on("change",function(b){var c=a(this).parents(".thumbnail");if(a(this).is(":checked")){c.addClass("thumbnail-selected")}else{c.removeClass("thumbnail-selected")}});a(".mg-option input[type=checkbox]:checked").trigger("change");a("#mgSelectAll").on("click",function(d){d.preventDefault();var c=a(this),b=c.find("> span");$checks=a(".mg-option input[type=checkbox]");if(c.attr("data-all-selected")){c.removeAttr("data-all-selected");$checks.prop("checked",false).trigger("change");b.html(b.data("all-text"))}else{c.attr("data-all-selected","true");$checks.prop("checked",true).trigger("change");b.html(b.data("none-text"))}});a(".thumb-preview a[href]").magnificPopup({type:"image",closeOnContentClick:true,mainClass:"mfp-img-mobile",image:{verticalFit:true}});a(".thumb-preview .mg-zoom").on("click.lightbox",function(b){b.preventDefault();a(this).closest(".thumb-preview").find("a.thumb-image").triggerHandler("click")});a(".thumbnail .mg-toggle").parent().on("show.bs.dropdown",function(b){a(this).closest(".mg-thumb-options").css("overflow","visible")}).on("hidden.bs.dropdown",function(b){a(this).closest(".mg-thumb-options").css("overflow","")});a(".thumbnail").on("mouseenter",function(){var b=a(this).find(".mg-toggle");if(b.parent().hasClass("open")){b.dropdown("toggle")}});a("[data-sort-source]").each(function(){var c=a(this);var b=a("[data-sort-destination][data-sort-id="+a(this).attr("data-sort-id")+"]");if(b.get(0)){a(window).on("load",function(){b.isotope({itemSelector:".isotope-item",layoutMode:"fitRows"});a(window).on("sidebar-left-toggle inner-menu-toggle",function(){b.isotope()});c.find("a[data-option-value]").click(function(g){g.preventDefault();var f=a(this),h=f.attr("data-option-value");c.find(".active").removeClass("active");f.closest("li").addClass("active");b.isotope({filter:h});if(window.location.hash!=""||h.replace(".","")!="*"){window.location.hash=h.replace(".","")}return false});a(window).bind("hashchange",function(f){var h="."+location.hash.replace("#",""),g=(h=="."||h==".*"?"*":h);c.find(".active").removeClass("active");c.find("[data-option-value='"+g+"']").closest("li").addClass("active");b.isotope({filter:g})});var d="."+(location.hash.replace("#","")||"*");var e=c.find("a[data-option-value='"+d+"']");if(e.get(0)){c.find("[data-option-value='"+d+"']").click()}else{c.find(".active a").click()}})}})}(jQuery));