(function(a,b){a.widget("accordiona.accordionA",{options:{section:"> section",header:"> header",content:"> .content",},_create:function(){this.$window=a(window);this.$document=a(document);this.sections=this.element.find(this.options.section);this.html=a("html").addClass("js");this.element.attr("role","tablist").delegate(this.sections.prop("nodeName")+" "+this.options.header,"click focus blur".split(" ").concat("").join("."+this.namespace+" "),a.proxy(function(d){var e=a(d.target).closest(this.sections),f=e.find(this.options.header),c=e.find(this.options.content);switch(d.type){case"click":f.addClass("no-outline");this.toggle(e);break;case"focusin":e.bind("keydown."+this.namespace,a.proxy(function(g){switch(g.keyCode){case 9:f.removeClass("no-outline");break;case 32:g.preventDefault();this.toggle(e);break}},this));break;case"focusout":e.unbind("keydown."+this.namespace);break}},this));this.sections.filter('[aria-expanded="true"]:not(:first)').removeAttr("aria-expanded");this.sections.each(a.proxy(function(c,f){var e=a(f),d=e.find(this.options.content);e.find(this.options.header).attr({role:"tab",tabindex:0,});d.attr("role","tabpanel").data(this.namespace,{height:d.height(),}).addClass("no-transition");this.toggle(e,e.attr("aria-expanded")==="true");setTimeout(function(){d.removeClass("no-transition")})},this));this._hash()},destroy:function(){this.$window.unbind(this.namespace);this.$document.undelegate(this.namespace);this.element.undelegate(this.namespace);a.Widget.prototype.destroy.call(this)},toggle:function(c,d){if(!c.jquery){switch(typeof c){case"object":c=a(c);break;case"string":c=this.element.find(c);break;case"number":c=this.sections.eq(c);break}}if(c.length){if(typeof d!=="boolean"){d=c.attr("aria-expanded")!=="true"}if(d){this.toggle(this.sections.filter('[aria-expanded="true"]'),false)}var e=c.attr("aria-expanded",d).toggleClass("expanded",d).find(this.options.content);e.height(d?e.data(this.namespace).height:0);this._trigger("toggle",null,{expand:d})}return this},_hash:function(){if(location.hash){this._expandHash(location.hash)}this.$document.delegate('a[href^="#"]:not([href="#"])',"click."+this.namespace,a.proxy(function(c){this._expandHash(a(c.target).attr("href"))},this));this.$window.bind("hashchange."+this.namespace,a.proxy(function(){this._expandHash(location.hash)},this))},_expandHash:function(e){var d=this.element.find(e);if(d.length){var c=this.$document.height()>this.$window.height();c&&this.element.addClass("no-transition");this.toggle(d.closest(this.sections),true);c&&setTimeout(a.proxy(function(){this.element.removeClass("no-transition")},this))}},})})(jQuery);
