!function(p){p.gritter={},p.gritter.options={position:"",class_name:"",fade_in_speed:"medium",fade_out_speed:1e3,time:6e3},p.gritter.add=function(e){try{return l.add(e||{})}catch(t){var i="Gritter Error: "+t;"undefined"!=typeof console&&console.error?console.error(i,e):alert(i)}},p.gritter.remove=function(t,e){l.removeSpecific(t,e||{})},p.gritter.removeAll=function(t){l.stop(t||{})};var l={position:"",fade_in_speed:"",fade_out_speed:"",time:"",_custom_timer:0,_item_count:0,_is_setup:0,_tpl_close:'
',_tpl_title:'[[title]]',_tpl_item:'',_tpl_wrap:'
',add:function(i){if(null===(i="string"==typeof i?{text:i}:i).text)throw'You must supply "text" parameter.';this._is_setup||this._runSetup();var t=i.title,e=i.text,r=i.image||"",o=i.sticky||!1,s=i.class_name||p.gritter.options.class_name,n=p.gritter.options.position,a=i.time||"",_=(this._verifyWrapper(),this._item_count++,this._item_count),c=this._tpl_item,a=(p(["before_open","after_open","before_close","after_close"]).each(function(t,e){l["_"+e+"_"+_]=p.isFunction(i[e])?i[e]:function(){}}),this._custom_timer=0,a&&(this._custom_timer=a),""!=r?'':""),r=""!=r?"gritter-with-image":"gritter-without-image",t=t?this._str_replace("[[title]]",t,this._tpl_title):"",c=this._str_replace(["[[title]]","[[text]]","[[close]]","[[image]]","[[number]]","[[class_name]]","[[item_class]]"],[t,e,this._tpl_close,a,this._item_count,r,s],c);if(!1===this["_before_open_"+_]())return!1;p("#gritter-notice-wrapper").addClass(n).append(c);t=p("#gritter-item-"+this._item_count);return t.fadeIn(this.fade_in_speed,function(){l["_after_open_"+_](p(this))}),o||this._setFadeTimer(t,_),p(t).bind("mouseenter mouseleave",function(t){"mouseenter"==t.type?o||l._restoreItemIfFading(p(this),_):o||l._setFadeTimer(p(this),_),l._hoverState(p(this),t.type)}),p(t).find(".gritter-close").click(function(){l.removeSpecific(_,{},null,!0)}),_},_countRemoveWrapper:function(t,e,i){e.remove(),this["_after_close_"+t](e,i),0==p(".gritter-item-wrapper").length&&p("#gritter-notice-wrapper").remove()},_fade:function(t,e,i,r){var o=void 0===(i=i||{}).fade||i.fade,i=i.speed||this.fade_out_speed,s=r;this["_before_close_"+e](t,s),r&&t.unbind("mouseenter mouseleave"),o?t.animate({opacity:0},i,function(){t.animate({height:0},300,function(){l._countRemoveWrapper(e,t,s)})}):this._countRemoveWrapper(e,t)},_hoverState:function(t,e){"mouseenter"==e?(t.addClass("hover"),t.find(".gritter-close").show()):(t.removeClass("hover"),t.find(".gritter-close").hide())},removeSpecific:function(t,e,i,r){i=i||p("#gritter-item-"+t),this._fade(i,t,e||{},r)},_restoreItemIfFading:function(t,e){clearTimeout(this["_int_id_"+e]),t.stop().css({opacity:"",height:""})},_runSetup:function(){for(opt in p.gritter.options)this[opt]=p.gritter.options[opt];this._is_setup=1},_setFadeTimer:function(t,e){var i=this._custom_timer||this.time;this["_int_id_"+e]=setTimeout(function(){l._fade(t,e)},i)},stop:function(t){var e=p.isFunction(t.before_close)?t.before_close:function(){},i=p.isFunction(t.after_close)?t.after_close:function(){},t=p("#gritter-notice-wrapper");e(t),t.fadeOut(function(){p(this).remove(),i()})},_str_replace:function(t,e,i,r){var o,s,n,a=0,_=0,c="",p=[].concat(t),l=[].concat(e),u=i,m=l instanceof Array,t=u instanceof Array,u=[].concat(u);for(r&&(this.window[r]=0),a=0,s=u.length;a