(function(d){var b=d.document.documentElement,c={animations:Modernizr.cssanimations},a={WebkitAnimation:"webkitAnimationEnd",OAnimation:"oAnimationEnd",msAnimation:"MSAnimationEnd",animation:"animationend"},f=a[Modernizr.prefixed("animation")];function g(i,h){for(var j in h){if(h.hasOwnProperty(j)){i[j]=h[j]}}return i}function e(h){this.options=g({},this.options);g(this.options,h);this._init()}e.prototype.options={wrapper:document.body,message:"yo!",layout:"growl",effect:"slide",type:"error",ttl:6000,onClose:function(){return false},onOpen:function(){return false}};e.prototype._init=function(){this.ntf=document.createElement("div");this.ntf.className="text-center alert-text ns-index ns-box ns-"+this.options.layout+" ns-effect-"+this.options.effect+" ns-type-"+this.options.type;var i='<div class="ns-box-inner">';i+=this.options.message;i+="</div>";i+='<span class="ns-close"></span></div>';this.ntf.innerHTML=i;this.options.wrapper.insertBefore(this.ntf,this.options.wrapper.firstChild);var h=this;this.dismissttl=setTimeout(function(){if(h.active){h.dismiss()}},this.options.ttl);this._initEvents()};e.prototype._initEvents=function(){var h=this;this.ntf.querySelector(".ns-close").addEventListener("click",function(){h.dismiss()})};e.prototype.show=function(){this.active=true;classie.remove(this.ntf,"ns-hide");classie.add(this.ntf,"ns-show");this.options.onOpen()};e.prototype.dismiss=function(){var h=this;this.active=false;clearTimeout(this.dismissttl);classie.remove(this.ntf,"ns-show");setTimeout(function(){classie.add(h.ntf,"ns-hide");h.options.onClose()},25);var i=function(j){if(c.animations){if(j.target!==h.ntf){return false}this.removeEventListener(f,i)}h.options.wrapper.removeChild(this)};if(c.animations){this.ntf.addEventListener(f,i)}else{i()}};d.NotificationFx=e})(window);