var MessageBox=new Class({options:{delay:1,onFlee:$empty,FxOptions:{}},initialize:function(c,b,a){$extend(this.options,a);this.createBox(c,b)},flee:function(d){if(window.MessageBoxOnShow){window.MessageBoxOnShow(d,d.hasClass("success"));window.MessageBoxOnShow=$empty()}var a=new Fx.Styles(d,this.options.FxOptions);var b=false;var c=this;d.addEvent("click",function(){this.hide()});(function(){b=true;a.start({left:0,opacity:0}).chain(function(){this.element.remove();b=false;if(c.options.onFlee){c.options.onFlee.apply(c,[c])}if(window.MessageBoxOnFlee){window.MessageBoxOnFlee(d,d.hasClass("success"));window.MessageBoxOnFlee=$empty()}})}).delay(this.options.delay*1000)},createBox:function(e,a){var f=/<h4[^>]*>([\s\S]*?)<\/h4>/;var c=e;if(c.test(f)){c.replace(f,function(){e=arguments[1];return""})}var b=new Element("div").setStyles({position:"absolute",visibility:"hidden",width:200,height:"auto",opacity:0,zIndex:65535}).inject(document.body);var d=this;b.addClass(a).setHTML("<h4>",e,"</h4>").amongTo(window).effect("opacity").start(1).chain(function(){d.flee(this.element)});return b}});MessageBox.success=function(b,a){return new MessageBox(b||"操作成功!","success",a)};MessageBox.error=function(b,a){a=a||{};if(!a.delay){a.delay=3}return new MessageBox(b||"操作失败!","error",a)};MessageBox.show=function(b,a){if(b.contains("failedSplash")){return new MessageBox(b||"操作失败!","error",a)}return new MessageBox(b||"操作成功!","success",a)};