/*! bellows 2.0.2 2014-09-04 */ (function(t){if("function"==typeof define&&define.amd)define(["$","velocity"],t);else{var e=window.zepto||window.jquery;t(e,e.velocity)}})(function(t,e){function i(t,e){this._init(t,e)}var o="bellows",n=function(){},s="bellows_item",l="bellows--is-open",r="bellows--is-opening",a="bellows--is-closing",h={item_header:"> .bellows_item > .bellows_header",item_content_wrapper:"> .bellows_content-wrapper",item_content:"> .bellows_item > .bellows_content"};return i.version="2.0.0",i.defaults={singleitemopen:!1,event:"click",duration:200,easing:"swing",open:n,opened:n,close:n,closed:n},i.prototype._init=function(e,o){this.options=t.extend(!0,{},i.defaults,o),this.$bellows=t(e),this.$bellows.find(h.item_content).wrap('
').parents(".bellows_item:not(.bellows--is-open)").find(h.item_content_wrapper).attr("aria-hidden",!0),this._bindevents()},i.prototype._bindevents=function(){var e=this;this.$bellows.find(h.item_header).bind(this.options.event,function(i){i.preventdefault(),e.toggle(t(this).parent())})},i.prototype._getheight=function(t){return parsefloat(e.css.getpropertyvalue(t[0],"height"))},i.prototype._setheight=function(t){this.$bellows.css("height",t||"")},i.prototype._item=function(t){return"number"==typeof t&&(t=this.$bellows.find("."+s).eq(t)),t},i.prototype._trigger=function(e,i){e in this.options&&this.options[e].call(this,t.event(o+":"+e,{bubbles:!1}),i)},i.prototype.toggle=function(t){t=this._item(t),this[t.hasclass(l)?"close":"open"](t)},i.prototype.open=function(t){if(t=this._item(t),!t.hasclass(l)){var i=this,o=t.find(h.item_content_wrapper);this.options.singleitemopen&&this.closeall(),this._trigger("open",{item:t}),e.animate(o,"slidedown",{begin:function(){i._setheight(i._getheight(i.$bellows)+i._getheight(o)),t.addclass(r)},duration:this.options.duration,easing:this.options.easing,complete:function(){t.removeclass(r).addclass(l).find(h.item_content_wrapper).removeattr("aria-hidden"),i._setheight(),i._trigger("opened",{item:t})}})}},i.prototype.close=function(t){if(t=this._item(t),t.hasclass(l)){var i=this,o=t.find(h.item_content_wrapper);this._trigger("close",{item:t}),e.animate(o,"slideup",{begin:function(){i._setheight(i._getheight(i.$bellows)),t.removeclass(l).addclass(a)},duration:this.options.duration,easing:this.options.easing,complete:function(){t.removeclass(a).find(h.item_content_wrapper).attr("aria-hidden",!0),i._setheight(),i._trigger("closed",{item:t})}})}},i.prototype.closeall=function(){var e=this;this.$bellows.find("."+l).each(function(){e.close(t(this))})},t.fn.bellows=function(e){var n=array.prototype.slice.call(arguments);return this.each(function(){var s=t(this),l=s.data(o),r="string"==typeof e;if(!l){if(r)throw'cannot call methods on bellows prior to initialization; attempted to call method "'+e+'"';s.data(o,l=new i(this,e))}if(r){if("_"===e.charat(0)||"function"!=typeof l[e])throw'no such method "'+e+'" for bellows';l[e].apply(l,n.length>1?n.slice(1):null)}})},t.fn.bellows.constructor=i,t("[data-bellows]").bellows(),t});