/* Copyright  2007 - 2011 YOOtheme GmbH, YOOtheme Proprietary Use License (http://www.yootheme.com/license) */

(function(c){var a=function(){};c.extend(a.prototype,{name:"accordionMenu",options:{mode:"default",display:null,collapseall:!1},initialize:function(a,b){var b=c.extend({},this.options,b),f=a.find("ul.accordion"),g=a.find("li.toggler");if(g.length){var i=[];g.each(function(a){var h=c(this),e=h.find("span:first"),d=c(f[a]).parent().css("overflow","hidden"),j=d.height();i.push(d);h.hasClass("active")||a==b.display?d.show():d.hide().css("height",0);e.bind("click",function(){b.collapseall&&(c(i).each(function(){c(this).hide().css("height",
0)}),g.each(function(b){b!=a&&c(this).removeClass("active").find("span:first").removeClass("active")}));b.mode=="slide"?h.hasClass("active")?d.stop().animate({height:0},function(){d.hide()}):d.stop().show().animate({height:j}):h.hasClass("active")?d.hide().css("height",0):d.show().css("height",j);e.toggleClass("active");h.toggleClass("active")})})}}});c.fn[a.prototype.name]=function(){var e=arguments,b=e[0]?e[0]:null;return this.each(function(){var f=c(this);if(a.prototype[b]&&f.data(a.prototype.name)&&
b!="initialize")f.data(a.prototype.name)[b].apply(f.data(a.prototype.name),Array.prototype.slice.call(e,1));else if(!b||c.isPlainObject(b)){var g=new a;a.prototype.initialize&&g.initialize.apply(g,c.merge([f],e));f.data(a.prototype.name,g)}else c.error("Method "+b+" does not exist on jQuery."+a.name)})}})(jQuery);

