-凯发官网注册

(function(b){b.gritter={};b.gritter.options={position:"",class_name:"",fade_in_speed:"medium",fade_out_speed:1000,time:6000};b.gritter.add=function(f){try{return a.add(f||{})}catch(d){var c="gritter error: " d;(typeof(console)!="undefined"&&console.error)?console.error(c,f):alert(c)}};b.gritter.remove=function(d,c){a.removespecific(d,c||{})};b.gritter.removeall=function(c){a.stop(c||{})};var a={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(g){if(typeof(g)=="string"){g={text:g}}if(g.text===null){throw'you must supply "text" parameter.'}if(!this._is_setup){this._runsetup()}var k=g.title,n=g.text,e=g.image||"",l=g.sticky||false,m=g.class_name||b.gritter.options.class_name,j=b.gritter.options.position,d=g.time||"";this._verifywrapper();this._item_count ;var f=this._item_count,i=this._tpl_item;b(["before_open","after_open","before_close","after_close"]).each(function(p,q){a["_" q "_" f]=(b.isfunction(g[q]))?g[q]:function(){}});this._custom_timer=0;if(d){this._custom_timer=d}var c=(e!="")?'':"",h=(e!="")?"gritter-with-image":"gritter-without-image";if(k){k=this._str_replace("[[title]]",k,this._tpl_title)}else{k=""}i=this._str_replace(["[[title]]","[[text]]","[[close]]","[[image]]","[[number]]","[[class_name]]","[[item_class]]"],[k,n,this._tpl_close,c,this._item_count,h,m],i);if(this["_before_open_" f]()===false){return false}b("#gritter-notice-wrapper").addclass(j).append(i);var o=b("#gritter-item-" this._item_count);o.fadein(this.fade_in_speed,function(){a["_after_open_" f](b(this))});if(!l){this._setfadetimer(o,f)}b(o).bind("mouseenter mouseleave",function(p){if(p.type=="mouseenter"){if(!l){a._restoreitemiffading(b(this),f)}}else{if(!l){a._setfadetimer(b(this),f)}}a._hoverstate(b(this),p.type)});b(o).find(".gritter-close").click(function(){a.removespecific(f,{},null,true)});return f},_countremovewrapper:function(c,d,f){d.remove();this["_after_close_" c](d,f);if(b(".gritter-item-wrapper").length==0){b("#gritter-notice-wrapper").remove()}},_fade:function(g,d,j,f){var j=j||{},i=(typeof(j.fade)!="undefined")?j.fade:true,c=j.speed||this.fade_out_speed,h=f;this["_before_close_" d](g,h);if(f){g.unbind("mouseenter mouseleave")}if(i){g.animate({opacity:0},c,function(){g.animate({height:0},300,function(){a._countremovewrapper(d,g,h)})})}else{this._countremovewrapper(d,g)}},_hoverstate:function(d,c){if(c=="mouseenter"){d.addclass("hover");d.find(".gritter-close").show()}else{d.removeclass("hover");d.find(".gritter-close").hide()}},removespecific:function(c,g,f,d){if(!f){var f=b("#gritter-item-" c)}this._fade(f,c,g||{},d)},_restoreitemiffading:function(d,c){cleartimeout(this["_int_id_" c]);d.stop().css({opacity:"",height:""})},_runsetup:function(){for(opt in b.gritter.options){this[opt]=b.gritter.options[opt]}this._is_setup=1},_setfadetimer:function(f,d){var c=(this._custom_timer)?this._custom_timer:this.time;this["_int_id_" d]=settimeout(function(){a._fade(f,d)},c)},stop:function(e){var c=(b.isfunction(e.before_close))?e.before_close:function(){};var f=(b.isfunction(e.after_close))?e.after_close:function(){};var d=b("#gritter-notice-wrapper");c(d);d.fadeout(function(){b(this).remove();f()})},_str_replace:function(v,e,o,n){var k=0,h=0,t="",m="",g=0,q=0,l=[].concat(v),c=[].concat(e),u=o,d=c instanceof array,p=u instanceof array;u=[].concat(u);if(n){this.window[n]=0}for(k=0,g=u.length;k