var mBox=new Class({Implements:[Options,Events],options:{id:"",theme:"",addClass:{wrapper:"",container:"",content:"",title:"",footer:""},setStyles:{wrapper:{},container:{},content:{},title:{},footer:{}},target:$(window),attach:null,event:"click",preventDefault:!1,width:"auto",height:"auto",zIndex:8e3,content:null,setContent:"data-setContent",load:null,url:"",reload:!1,title:null,footer:null,draggable:!1,position:{x:"center",y:"center"},fixed:null,offset:{x:0,y:0},pointer:!1,fade:{open:!0,close:!0},fadeDuration:{open:200,close:300},fadeWhenOpen:!1,overlay:!1,overlayStyles:{color:"black",opacity:.75},overlayFadeDuration:100,transition:{open:null,close:null},closeOnEsc:!0,closeOnClick:!1,closeOnBoxClick:!1,closeOnWrapperClick:!1,closeOnBodyClick:!0,closeOnMouseleave:!1,closeInTitle:!1,delayOpen:0,delayClose:0,delayOpenOnce:!0,constructOnInit:!0,openOnInit:!1},initialize:function(t){this.block=!1,this.ignoreDelay=!1,this.ignoreDelayOnce=!1,this.setOptions(t),this.fixOptions(),this.getPosition(),this.target=this.getTarget(),null==this.options.fixed&&(this.options.fixed=[$(window),$(document),$(document.body)].contains(this.target)),"mouse"==this.target&&(this.options.pointer=!1),this.targets=[],this.id=this.options.id||"mBox"+ ++mBox.currentId,this.addListeners(),this.options.constructOnInit&&this.construct(),this.fireEvent("init").fireEvent("systemInit"),this.options.openOnInit&&this.open(),mBox.instances.push(this)},reInit:function(){this.addListeners()},fixOptions:function(){"string"==typeof this.options.addClass&&(this.options.addClass={wrapper:this.options.addClass}),"object"!=typeof this.options.setStyles||this.options.setStyles.wrapper||this.options.setStyles.container||this.options.setStyles.content||this.options.setStyles.title||this.options.setStyles.footer||(this.options.setStyles={wrapper:this.options.setStyles}),this.options.fade={open:this.options.fade.open||1==this.options.fade,close:this.options.fade.close||1==this.options.fade},this.options.fadeDuration={open:this.options.fadeDuration.open||this.options.fadeDuration,close:this.options.fadeDuration.close||this.options.fadeDuration}},construct:function(){if(this.wrapper)return null;this.wrapper=new Element("div",{id:this.id,class:"mBox "+(this.defaultTheme||"Core")+(this.options.theme?"-"+this.options.theme:"")+" "+(this.options.addClass.wrapper||""),styles:{zIndex:this.options.zIndex,position:0==this.options.fixed||Browser.ie6||Browser.ie7?"absolute":"fixed",display:"none",opacity:1e-5,top:-12e3,left:-12e3,zoom:1}}).setStyles(this.options.setStyles.wrapper||{});var t=$(t)||t||this.target||$(this.options.target)||this.options.target||$(this.options.attach);t&&"element"===typeOf(t)?this.wrapper.inject(t,"after"):this.wrapper.inject(document.body,"bottom"),this.options.closeOnMouseleave&&this.wrapper.addEvents({mouseenter:function(t){this.open()}.bind(this),mouseleave:function(t){this.close()}.bind(this)}),this.container=new Element("div",{class:"mBoxContainer "+(this.options.addClass.container||"")}).setStyles(this.options.setStyles.container||{}).inject(this.wrapper),this.content=new Element("div",{class:"mBoxContent "+(this.options.addClass.content||""),styles:{width:this.options.width,height:this.options.height}}).setStyles(this.options.setStyles.content||{}).inject(this.container),this.load(this.options.content,this.options.title,this.options.footer,!0),this.fireEvent("systemBoxReady").fireEvent("boxReady")},addListeners:function(t){if(t=t||this.options.attach,elements=Array.convert($(t)).combine(Array.convert($$("."+t))).combine(Array.convert($$(t))).clean(),!elements||0==elements.length)return this;switch(this.targets.combine(elements),this.options.event){case"mouseenter":case"mouseover":var e={mouseenter:function(t){this.target=this.getTargetFromEvent(t),this.source=this.getTargetElementFromEvent(t),this.open()}.bind(this),mouseleave:function(t){this.close()}.bind(this)};break;default:e={click:function(t){this.options.preventDefault&&t.preventDefault(),this.isOpen?this.close():(this.target=this.getTargetFromEvent(t),this.source=this.getTargetElementFromEvent(t),this.open())}.bind(this)}}$$(elements).each(function(t){t.retrieve("mBoxElementEventsAdded"+this.id)||t.addEvents(e).store("mBoxElementEventsAdded"+this.id,!0)}.bind(this))},loadAjax:function(t){this.ajaxRequest||(this.ajaxRequest=new Request.HTML({link:"cancel",update:this.content,onRequest:function(){this.setContent(""),this.wrapper.addClass("mBoxLoading")}.bind(this),onComplete:function(){this.wrapper.removeClass("mBoxLoading"),"auto"!=this.options.width&&"auto"!=this.options.height||this.setPosition(),this.fireEvent("ajaxComplete")}.bind(this)}).send()),this.ajaxRequest.send(t),this.ajaxLoaded=!0},open:function(t){if(this.wrapper||this.construct(),"object"!=typeof t&&(t={}),clearTimeout(this.timer),!this.isOpen&&!this.block){var e=function(){this.ignoreDelayOnce=!1,this.fireEvent("systemOpenComplete").fireEvent("openComplete")}.bind(this),i=function(e){if(this.isOpen=!0,"ajax"!=this.options.load||!this.options.url||this.ajaxLoaded&&!this.options.reload||this.loadAjax({url:this.options.url}),this.target=this.getTarget(t.target||null),this.options.setContent&&this.source&&this.source.getAttribute(this.options.setContent))if($(this.source.getAttribute(this.options.setContent)))this.content.getChildren().setStyle("display","none"),$(this.source.getAttribute(this.options.setContent)).setStyle("display","");else{var i=this.source.getAttribute(this.options.setContent).split("|"),o=i[0]||null,n=i[1]||null,s=i[2]||null;this.load(o,n,s)}this.wrapper&&this.wrapper.inject(document.body,"bottom"),this.setPosition(null,t.position||null,t.offset||null),this.fireEvent("systemOpen").fireEvent("open"),this.fx&&this.fx.cancel(),this.wrapper.setStyles({display:""}),this.options.fadeWhenOpen&&this.wrapper.setStyle("opacity",0),this.fx=new Fx.Tween(this.wrapper,{property:"opacity",duration:this.options.fadeDuration.open,link:"cancel",onComplete:e})[t.instant||!this.options.fade.open?"set":"start"](1),!t.instant&&this.options.fade.open||e();var r=this.getTransition();r.open&&new Fx.Tween(this.wrapper,{property:r.open.property||"top",duration:r.open.duration||this.options.fadeDuration.open,transition:r.open.transition||null,onStart:r.open.onStart||null,onComplete:r.open.onComplete||null}).start(r.open.start||this.wrapper.getStyle(r.open.property||"top").toInt()+(r.open.difference_start||0),r.open.end||this.wrapper.getStyle(r.open.property||"top").toInt()+(r.open.difference_end||0));this.attachEvents(),this.options.overlay&&this.addOverlay(t.instant||!this.options.fade.open),this.options.delayOpenOnce&&(this.delayOpenOnce=!0)}.bind(this);this.options.delayOpen>0&&!this.ignoreDelay&&!this.ignoreDelayOnce&&!this.delayOpenOnce?this.timer=i.delay(this.options.delayOpen,this,e):i(e)}return this},close:function(t){if("object"!=typeof t&&(t={}),clearTimeout(this.timer),this.isOpen&&!this.block){var e=function(){if(this.delayOpenOnce=!1,this.ignoreDelayOnce=!1,this.wrapper.setStyle("display","none"),this.fireEvent("systemCloseComplete").fireEvent("closeComplete"),this.wrapper){var t=this.target||$(this.options.target)||this.options.target||$(this.options.attach);t&&"element"===typeOf(t)&&this.wrapper.inject(t)}}.bind(this),i=function(e){this.isOpen=!1,this.fireEvent("systemClose").fireEvent("close"),this.detachEvents(),this.options.overlay&&this.removeOverlay(t.instant||!this.options.fade.close),this.fx&&this.fx.cancel(),this.fx=new Fx.Tween(this.wrapper,{property:"opacity",duration:this.options.fadeDuration.close,link:"cancel",onComplete:e})[t.instant||!this.options.fade.close?"set":"start"](0),!t.instant&&this.options.fade.close||e();var i=this.getTransition();i.close&&new Fx.Tween(this.wrapper,{property:i.close.property||"top",duration:i.close.duration||this.options.fadeDuration.close,transition:i.close.transition||null,onStart:i.open.onStart||null,onComplete:i.open.onComplete||null}).start(i.close.start||this.wrapper.getStyle(i.close.property||"top").toInt()+(i.close.difference_start||0),i.close.end||this.wrapper.getStyle(i.close.property||"top").toInt()+(i.close.difference_end||0))}.bind(this);this.options.delayClose>0&&!this.ignoreDelay&&!this.ignoreDelayOnce?this.timer=i.delay(this.options.delayClose,this,e):i(e)}return this},addOverlay:function(t){return this.overlay||(this.overlay=new Element("div",{styles:{position:"fixed",top:0,left:0,width:"100%",height:"100%",zIndex:this.wrapper.getStyle("zIndex")-1,background:this.options.overlayStyles.color||"white",opacity:.001,display:"none"}}).set("tween",{duration:this.options.overlayFadeDuration,link:"cancel"}).inject($(document.body),"bottom")),this.overlay.setStyle("display","block")[t?"set":"tween"]("opacity",this.options.overlayStyles.opacity||.001),this},removeOverlay:function(t){return this.overlay&&this.overlay[t?"set":"tween"]("opacity",0).get("tween").chain(function(){this.overlay.setStyle("display","none")}.bind(this)),this},getTarget:function(t){return"mouse"==(t=$(t)||t||this.target||$(this.options.target)||this.options.target||$(this.options.attach))?"mouse":this.fixOperaPositioning($(t))},getTargetFromEvent:function(t){return this.options.target?this.fixOperaPositioning($(this.options.target)):this.getTargetElementFromEvent(t)},getTargetElementFromEvent:function(t){if(t&&t.target){if(this.targets.contains(t.target))return this.fixOperaPositioning(t.target);for(var e=t.target.getParent();null!=e;){if(this.targets.contains(e))return this.fixOperaPositioning(e);e=e.getParent()}}return null},fixOperaPositioning:function(t){if($(t)&&!$(t).retrieve("OperaBugFixed")&&t!=window){try{$(t).getStyle("border-top-width").toInt()+$(t).getStyle("border-right-width").toInt()+$(t).getStyle("border-bottom-width").toInt()+$(t).getStyle("border-left-width").toInt()||$(t).setStyle("border",0)}catch(t){}$(t).store("OperaBugFixed")}return t},getPosition:function(t){return!t&&this.position||(t=t||this.options.position,this.position={},this.position.x="object"==typeof t&&"number"==typeof t.x?[t.x.toInt(),null]:"object"!=typeof t||!t.x||"center"==t.x||"object"==typeof t.x&&"center"==t.x[0]?["center",null]:["right","left"].contains(t.x)?[t.x,this.defaultInOut||"inside"]:"object"==typeof t.x&&["right","left"].contains(t.x[0])?[t.x[0],["inside","center","outside"].contains(t.x[1])?t.x[1]:this.defaultInOut||"inside"]:["center",null],this.position.xAttribute="right"==this.position.x[3]||"inside"==this.position.x[1]&&"right"==this.position.x[0]?"right":"left",this.position.y="object"==typeof t&&"number"==typeof t.y?[t.y.toInt(),null]:"object"!=typeof t||!t.y||"center"==t.y||"object"==typeof t.y&&"center"==t.y[0]?["center",null]:["top","bottom"].contains(t.y)?[t.y,this.defaultInOut||"inside"]:"object"==typeof t.y&&["top","bottom"].contains(t.y[0])?[t.y[0],["inside","center","outside"].contains(t.y[1])?t.y[1]:this.defaultInOut||"inside"]:["center",null],this.position.yAttribute="bottom"==this.position.x[3]||"inside"==this.position.y[1]&&"bottom"==this.position.y[0]?"bottom":"top"),this.position},getOffset:function(t){return!t&&this.offset||(t=t||this.options.offset,this.offset={},this.offset.x="number"==typeof t?t:t.x&&(t.x.toInt()>=0||t.x.toInt()<0)?t.x.toInt():0,this.offset.y="number"==typeof t?t:t.y&&(t.y.toInt()>=0||t.y.toInt()<0)?t.y.toInt():0),this.offset},getPointer:function(t){if(!t&&this.pointer)return this.pointer;if(!(t=t||this.options.pointer))return!1;var e=this.getPosition();if(this.pointer={},"outside"==e.y[1])this.pointer.position="bottom"==e.y[0]?"top":"bottom",this.pointer.adjustment="object"==typeof t&&["center","right","left"].contains(t[0])?t[0]:["center","right","left"].contains(t)?t:"center";else{if("outside"!=e.x[1])return null;this.pointer.position="left"==e.x[0]?"right":"left",this.pointer.adjustment="object"==typeof t&&["center","top","bottom"].contains(t[0])?t[0]:["center","top","bottom"].contains(t)?t:"center"}return this.pointer.offset="object"==typeof t&&t[1]&&"number"==typeof t[1].toInt()?t[1].toInt():0,this.pointer.offset=this.pointer.offset<0?-1*this.pointer.offset:this.pointer.offset,this.pointer.offset="right"==this.pointer.adjustment||"bottom"==this.pointer.adjustment?-1*this.pointer.offset:this.pointer.offset,this.pointer},getTransition:function(){if(this.transition)return this.transition;if(this.options.transition&&["flyin","flyout","flyinout","flyoutin","bounce","bouncein","bounceout","bounceinout","bouncefly"].contains(this.options.transition)){this.transition={},this.transition.open={property:"top"==this.position.yAttribute||"bottom"==this.position.yAttribute?this.position.yAttribute:this.position.xAttribute,transition:"quad:out",duration:300},this.transition.close=Object.clone(this.transition.open);var t=20*("bottom"==this.position.yAttribute||"right"==this.position.xAttribute?-1:1);switch(this.options.transition){case"flyin":case"flyout":this.transition.open.difference_start=this.transition.close.difference_end=t*("flyin"==this.options.transition?-1:1);break;case"flyinout":case"flyoutin":t*="flyinout"==this.options.transition?1:-1,this.transition.open.difference_start=-1*t,this.transition.close.difference_end=t;break;case"bounce":case"bouncefly":case"bouncein":case"bounceout":case"bounceinout":this.transition.open.transition="bounce:out",this.transition.open.duration=450,this.transition.open.difference_start=-1*t,"bounceinout"!=this.options.transition&&"bounceout"!=this.options.transition&&"bouncefly"!=this.options.transition||(this.transition.close.difference_end=-1*t)}}else this.transition={},this.transition.open=null!=typeof this.options.transition.open?this.options.transition.open:this.options.transition,this.transition.close=null!=typeof this.options.transition.close?this.options.transition.close:this.options.transition;return this.transition},setPosition:function(t,e,i){if(t=this.getTarget(t),e=this.getPosition(e),i=this.getOffset(i),pointer=this.getPointer(),"mouse"==t)return r=(this.mouseX||0)+15+i.x,h=(this.mouseY||0)+15+i.y,this.wrapper.setStyles({left:Math.floor(r),top:Math.floor(h)}),this;if(!t||[$(window),$(document),$(document.body)].contains(t)){var o="fixed"==this.wrapper.getStyle("position")?{x:0,y:0}:$(window).getScroll();(s=$(window).getSize()).width=s.totalWidth=s.x,s.height=s.totalHeight=s.y;var n={top:o.y,left:o.x,right:o.x+s.width,bottom:o.y+s.height}}else{1!=!this.options.fixed&&this.wrapper.setStyle("position","absolute");var s=t.getDimensions({computeSize:!0});n=t.getCoordinates();0==s.totalWidth&&(s.width=s.totalWidth=n.width,s.height=s.totalHeight=n.height)}var r=n.left||0,h=n.top||0,a=this.wrapper.getDimensions({computeSize:!0});if(pointer&&!this.pointerElement){if(this.pointerElement=new Element("div",{class:"mBoxPointer mBoxPointer"+pointer.position.capitalize(),styles:{position:"absolute"}}).setStyle(pointer.position,0).inject(this.wrapper,"top"),Browser.opera){var p=new Element("div",{class:"mBox "+(this.defaultTheme||"Core")+(this.options.theme?"-"+this.options.theme:"")}).inject(document.body).grab(this.pointerElement);this.pointerDimensions=this.pointerElement.getDimensions({computeSize:!0}),this.pointerElement.inject(this.wrapper,"top"),p.destroy()}else this.pointerDimensions=this.pointerElement.getDimensions({computeSize:!0});this.container.setStyle("margin-"+pointer.position,"left"==pointer.position||"right"==pointer.position?this.pointerDimensions.width-this.container.getStyle("border-"+pointer.position).toInt():this.pointerDimensions.height-this.container.getStyle("border-"+pointer.position).toInt())}if(pointer&&this.pointerElement){if("outside"==e.x[1]&&"outside"==e.y[1]&&"center"==pointer.adjustment)switch(pointer.adjustment="left"==e.x[0]?"right":"left",e.x[0]){case"left":r+=a.totalWidth-this.pointerDimensions.width/2;break;case"right":r-=this.pointerDimensions.width/2}var l=0,c=0,d=0;switch(pointer.adjustment){case"center":l="top"==pointer.position||"bottom"==pointer.position?a.totalWidth/2-this.pointerDimensions.width/2:a.totalHeight/2-this.pointerDimensions.height/2;break;case"left":case"right":switch(e.x[1]){case"inside":c+=this.pointerDimensions.width/2*-1+("right"==e.x[0]?a.totalWidth:0);break;default:"center"==e.x[0]&&(c+=a.totalWidth/2-this.pointerDimensions.width/2)}r+=c-("right"==pointer.adjustment?a.totalWidth-this.pointerDimensions.width:0),l="right"==pointer.adjustment?a.totalWidth-this.pointerDimensions.width:0;break;case"top":case"bottom":switch(e.y[1]){case"inside":d+=this.pointerDimensions.height/2*-1+("bottom"==e.y[0]?a.totalHeight:0);break;default:"center"==e.y[0]&&(d+=a.totalHeight/2-this.pointerDimensions.height/2)}h+=d-("bottom"==pointer.adjustment?a.totalHeight-this.pointerDimensions.height:0),l="bottom"==pointer.adjustment?a.totalHeight-this.pointerDimensions.height:0}switch(pointer.position){case"top":case"bottom":r+=-1*pointer.offset;break;case"left":case"right":h+=-1*pointer.offset}this.pointerElement.setStyle("top"==pointer.position||"bottom"==pointer.position?"left":"top",l+pointer.offset)}switch(a=this.wrapper.getDimensions({computeSize:!0}),e.x[0]){case"center":r+=s.totalWidth/2-a.totalWidth/2;break;case"right":r+=s.totalWidth-("inside"==e.x[1]?a.totalWidth:"center"==e.x[1]?a.totalWidth/2:0);break;case"left":r-="outside"==e.x[1]?a.totalWidth:"center"==e.x[1]?a.totalWidth/2:0;break;default:r=e.x}switch(e.y[0]){case"center":h+=s.totalHeight/2-a.totalHeight/2;break;case"bottom":h+=s.totalHeight-("inside"==e.y[1]?a.totalHeight:"center"==e.y[1]?a.totalHeight/2:0);break;case"top":h-="outside"==e.y[1]?a.totalHeight:"center"==e.y[1]?a.totalHeight/2:0;break;default:r=e.y}this.wrapper.setStyles({top:null,right:null,bottom:null,left:null});var u=$(window).getSize();return"right"==e.xAttribute&&(r=u.x-(r+a.totalWidth)),"bottom"==e.yAttribute&&(h=u.y-(h+a.totalHeight)),r=r||0,r+=i.x,h+=i.y,this.wrapper.setStyle(e.xAttribute,r.floor()),this.wrapper.setStyle(e.yAttribute,h.floor()),this},setContent:function(t,e){return null!=t&&($(t)||$$("."+t).length>0?(this[e||"content"].grab($(t)||$$("."+t)),$(t)&&$(t).setStyle("display","")):null!=t&&(t=(t=t.replace(/(?:)|(?:\/>))/gim,"")).replace(/<[^>]+/gim,(function(t){return t.replace(/ on\w+=[\"\'\S][^"]*[\"\'\S]/gim,"").replace(/javascript/gim,"")})),this[e||"content"].set("html",t))),this},setTitle:function(t){return null==t||this.titleContainer||(this.titleContainer=new Element("div",{class:"mBoxTitleContainer"}).inject(this.container,"top"),this.title=new Element("div",{class:"mBoxTitle "+(this.options.addClass.title||""),styles:this.options.setStyles.title||{}}).inject(this.titleContainer),this.wrapper.addClass("hasTitle"),this.options.draggable&&null!=window.Drag&&(new Drag(this.wrapper,{handle:this.titleContainer}),this.titleContainer.addClass("mBoxDraggable")),this.options.closeInTitle&&new Element("div",{class:"mBoxClose",events:{click:function(){this.close()}.bind(this)}}).grab(new Element("div")).inject(this.titleContainer)),null!=t&&this.setContent(t,"title"),this},setFooter:function(t){return null==t||this.footerContainer||(this.footerContainer=new Element("div",{class:"mBoxFooterContainer"}).inject(this.container,"bottom"),this.footer=new Element("div",{class:"mBoxFooter "+(this.options.addClass.footer||""),styles:this.options.setStyles.footer||{}}).inject(this.footerContainer),this.wrapper.addClass("hasFooter")),null!=t&&this.setContent(t,"footer"),this},load:function(t,e,i){return this.setContent(t),this.setTitle(e),this.setFooter(i),this},getHTML:function(t,e,i){return this.load(t,e,i),"
"+this.wrapper.get("html")+"
"},attachEvents:function(){this.escEvent=function(t){"esc"==t.key&&(this.ignoreDelayOnce=!0,this.close())}.bind(this),this.options.closeOnEsc&&$(window).addEvent("keyup",this.escEvent),this.resizeEvent=function(t){this.setPosition()}.bind(this),$(window).addEvent("resize",this.resizeEvent),this.options.fixed&&(Browser.ie6||Browser.ie7)&&$(window).addEvent("scroll",this.resizeEvent),this.closeOnClickEvent=function(t){this.isOpen&&$(this.options.attach)!=t.target&&!$$("."+this.options.attach).contains(t.target)&&(this.ignoreDelayOnce=!0,this.close())}.bind(this),this.options.closeOnClick&&$(document).addEvent("mouseup",this.closeOnClickEvent),this.closeOnBoxClickEvent=function(t){this.isOpen&&(this.wrapper==t.target||this.wrapper.contains(t.target))&&(this.ignoreDelayOnce=!0,this.close())}.bind(this),this.options.closeOnBoxClick&&$(document).addEvent("mouseup",this.closeOnBoxClickEvent),this.closeOnWrapperClickEvent=function(t){this.isOpen&&this.wrapper==t.target&&(this.ignoreDelayOnce=!0,this.close())}.bind(this),this.options.closeOnWrapperClick&&$(document).addEvent("mouseup",this.closeOnWrapperClickEvent),this.closeOnBodyClickEvent=function(t){!this.isOpen||$(this.options.attach)==t.target||$$("."+this.options.attach).contains(t.target)||t.target==this.wrapper||this.wrapper.contains(t.target)||(this.ignoreDelayOnce=!0,this.close())}.bind(this),this.options.closeOnBodyClick&&$(document).addEvent("mouseup",this.closeOnBodyClickEvent),this.mouseMoveEvent=function(t){this.mouseX=t.page.x,this.mouseY=t.page.y,this.setPosition("mouse")}.bind(this),"mouse"==this.target&&$(document).addEvent("mousemove",this.mouseMoveEvent)},detachEvents:function(){this.options.fixed&&(Browser.ie6||Browser.ie7)&&$(window).removeEvent("scroll",this.resizeEvent),$(window).removeEvent("keyup",this.keyEvent),$(window).removeEvent("resize",this.resizeEvent),$(document).removeEvent("mouseup",this.closeOnClickEvent),$(document).removeEvent("mouseup",this.closeOnBoxClickEvent),$(document).removeEvent("mouseup",this.closeOnWrapperClickEvent),$(document).removeEvent("mouseup",this.closeOnBodyClickEvent),$(document).removeEvent("mousemove",this.mouseMoveEvent)},destroy:function(){mBox.instances.erase(this),this.detachEvents(),this.wrapper.dispose(),delete this.wrapper}});mBox.instances=[],mBox.currentId=0,mBox.reInit=function(){mBox.addConfirmEvents&&mBox.addConfirmEvents(),mBox.instances.each((function(t){try{t.reInit()}catch(t){}}))},mBox.Notice=new Class({Extends:mBox,options:{type:"Default",position:{x:["left","inside"],y:["bottom","inside"]},offset:{x:30,y:30},fixed:!0,move:!0,moveDuration:500,delayClose:4e3,fade:!0,fadeDuration:{open:250,close:400},target:$(window),zIndex:1e6,closeOnEsc:!1,closeOnBoxClick:!0,closeOnBodyClick:!1,openOnInit:!0},initialize:function(t){this.defaultInOut="inside",this.defaultTheme="Notice",t.onSystemBoxReady=function(){if(this.container.addClass("mBoxNotice"+(this.options.type.capitalize()||"Default")),this.options.move&&("inside"==this.position.x[1]||"center"==this.position.x[0])&&"inside"==this.position.y[1]&&("top"==this.position.y[0]||"bottom"==this.position.y[0])){var t=this.wrapper.getDimensions({computeSize:!0});this.container.setStyle("position","absolute"),this.container.setStyle("top"==this.position.y[0]?"bottom":"top",0),this.wrapper.setStyles({height:0,width:t.totalWidth,overflowY:"hidden"}),this.options.transition={open:{transition:"linear",property:"height",duration:this.options.moveDuration,start:0,end:t.totalHeight+this.options.offset.y}},this.options.offset.y=0,this.options.delayClose+=this.options.moveDuration}},t.onSystemOpen=function(){$(window).retrieve("mBoxNotice")&&($(window).retrieve("mBoxNotice").ignoreDelay=!0,$(window).retrieve("mBoxNotice").close()),$(window).store("mBoxNotice",this)},t.onSystemOpenComplete=function(){this.close()},t.onSystemCloseComplete=function(){this.destroy()},this.parent(t)}}),mBox.Tooltip=new Class({Extends:mBox,options:{target:null,event:"mouseenter",position:{x:["center"],y:["top","outside"]},pointer:"center",fixed:!1,delayOpenOnce:!0},initialize:function(t){this.defaultInOut="outside",this.defaultTheme="Tooltip",this.parent(t)}});