(function($){"use strict";$.fn.magicaccordion=function(options){var defaults={accordion:!0,mouseType:!1,speed:300,closedSign:"collapse",openedSign:"expand",openedActive:!1},methods={init:function(){return this.each(function(){var self=$(this);methods.menuLoad(self)})},menuLoad:function(self){var opts=$.extend(defaults,options);if(!self.hasClass("menu-init")){self.addClass("menu-init"),self.find("li").each(function(){$(this).find("ul").length&&($(this).find("ul").hide(),$(this).find("a:first").after("<span class='"+opts.closedSign+"'>"+opts.closedSign+"</span>"),$(this).find("a:first").attr("href")=="#"&&$(this).find("a:first").click(function(){return!1}))}),opts.openedActive&&methods.openedActive(self),opts.mouseType?self.find("li a").mouseenter(function(){methods.menuAction(self,$(this))}):self.find("li span").click(function(){methods.menuAction(self,$(this))});var catplus=self.find(".nav-accordion >.level0:hidden").not(".all-cat");catplus.length?self.find(".all-cat").show().click(function(event){$(this).children().toggle(),catplus.slideToggle("slow")}):self.find(".all-cat").hide()}},menuAction:function(self,item){var opts=$.extend(defaults,options),parent=item.parent();if(parent.find("ul").length){if(opts.accordion&&!parent.find("ul").is(":visible")){var parents=parent.parents("ul"),visible=self.find("ul:visible");visible.each(function(visibleIndex){var close=!0;parents.each(function(parentIndex){if(parents[parentIndex]==visible[visibleIndex])return close=!1,!1}),close&&$(this).parent().find("ul")!=visible[visibleIndex]&&$(visible[visibleIndex]).slideUp(opts.speed,function(){$(this).parent("li").find("a:first").next().html(opts.closedSign).addClass(opts.closedSign)})})}var parentFirst=parent.find("ul:first");parentFirst.is(":visible")?parentFirst.slideUp(opts.speed,function(){$(this).parent("li").find("a:first").next().delay(opts.speed+1e3).html(opts.closedSign).removeClass(opts.openedSign).addClass(opts.closedSign)}):parentFirst.slideDown(opts.speed,function(){$(this).parent("li").find("a:first").next().delay(opts.speed+1e3).html(opts.openedSign).removeClass(opts.closedSign).addClass(opts.openedSign)})}},openedActive:function(self){var opts=$.extend(defaults,options);self.find("li.active").each(function(){$(this).parents("ul").slideDown(opts.speed,opts.easing),$(this).parents("ul").parent("li").find("a:first").next().html(opts.openedSign).removeClass(opts.closedSign).addClass(opts.openedSign),$(this).find("ul:first").slideDown(opts.speed,opts.easing),$(this).find("a:first").next().html(opts.openedSign).removeClass(opts.closedSign).addClass(opts.openedSign)})}};if(methods[options])return methods[options].apply(this,Array.prototype.slice.call(arguments,1));if(typeof options=="object"||!options)return methods.init.apply(this);$.error('Method "'+method+'" does not exist in magicaccordion plugin!')}})(jQuery);
//# sourceMappingURL=/cdn/shop/t/4/assets/magicaccordion.js.map
