/* Copyright  2007 - 2011 YOOtheme GmbH, YOOtheme Proprietary Use License (http://www.yootheme.com/license) */

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