
(function($){$.jGrowl=function(message,o){var o=$.extend({},$.jGrowl.defaults,o);if($('div#jGrowl').size()==0)$.jGrowl.startup();$('<div class="jGrowl"><div class="close">&times;</div><div class="header">'+o.header+'</div><div class="message">'+message+'</div></div>').data("jGrowl",o).addClass(o.theme).children('div.close').bind("click.jGrowl",function(){$(this).unbind('click.jGrowl').parent().trigger('jGrowl.beforeClose').animate(o.animateClose,o.speed,o.easing,function(){$(this).trigger('jGrowl.close').remove();});}).parent().insertAfter('div#jGrowl div.jGrowl:last');$('div#jGrowl div.jGrowl:last').bind("mouseover.jGrowl",function(){$(this).data("jGrowl").pause=true;}).bind("mouseout.jGrowl",function(){$(this).data("jGrowl").pause=false;}).bind('jGrowl.beforeOpen',function(){o.beforeOpen.apply(this,[this,message]);}).bind('jGrowl.open',function(){o.open.apply(this,[this,message]);}).bind('jGrowl.beforeClose',function(){o.beforeClose.apply(this,[this,message]);}).bind('jGrowl.close',function(){o.close.apply(this,[this,message]);}).trigger('jGrowl.beforeOpen').animate(o.animateOpen,o.speed,o.easing,function(){$(this).data("jGrowl").created=new Date();}).trigger('jGrowl.open');if($.fn.corner!=undefined)$('div#jGrowl div.jGrowl:last').children().corner(o.corners);if($('div#jGrowl div.jGrowl:parent').size()>1&&$('div#jGrowl div.closer').size()==0&&$.jGrowl.defaults.closer!=false){$('<div class="closer">[ close all ]</div>').addClass($.jGrowl.defaults.theme).appendTo("div#jGrowl").animate($.jGrowl.defaults.animateOpen,$.jGrowl.defaults.speed,$.jGrowl.defaults.easing).bind("click.jGrowl",function(){$(this).siblings().children('div.close').trigger("click.jGrowl");if($.isFunction($.jGrowl.defaults.closer))$.jGrowl.defaults.closer.apply($(this).parent()[0],[$(this).parent()[0]]);});};};$.extend($.jGrowl,{defaults:{header:'',sticky:false,position:'top-right',theme:'default',corners:'10px',check:1000,life:3000,speed:'normal',easing:'swing',closer:true,beforeOpen:function(e,m){},open:function(e,m){},beforeClose:function(e,m){},close:function(e,m){},animateOpen:{opacity:'show'},animateClose:{opacity:'hide'}},interval:null,update:function(){$('div#jGrowl div.jGrowl').each(function(){if($(this).data("jGrowl")!=undefined&&$(this).data("jGrowl").created!=undefined&&($(this).data("jGrowl").created.getTime()+$(this).data("jGrowl").life)<(new Date()).getTime()&&$(this).data("jGrowl").sticky!=true&&($(this).data("jGrowl").pause==undefined||$(this).data("jGrowl").pause!=true)){$(this).children('div.close').trigger('click.jGrowl');}});if($('div#jGrowl > div.jGrowl:parent').size()<2){$('div#jGrowl div.closer').animate(this.defaults.animateClose,this.defaults.speed,this.defaults.easing,function(){$(this).remove();});};if($('div#jGrowl > div.jGrowl:parent').children().size()==0)this.shutdown();},startup:function(){this.interval=setInterval("jQuery.jGrowl.update()",this.defaults.check);$('<div id="jGrowl"><div class="jGrowl"></div></div>').addClass(this.defaults.position).appendTo('body');if($.browser.msie&&parseInt($.browser.version)<7)$('div#jGrowl').addClass('ie6');},shutdown:function(){clearInterval(this.interval);$('div#jGrowl').remove();}});})(jQuery);