!function(root,ax_super){var U=ax5.util,axd=ax5.dom,ax_class=function(){var self=this;this.main=function(){ax_super&&ax_super.call(this),this.config={target:axd.get(document.body)[0]},this.mask_content="<h1>AX5 Mask</h1>",this.status="off"}.apply(this,arguments),this.init=function(){this.config.content&&this.set_body(this.config.content)},this.set_body=function(content){this.mask_content=content},this.get_body=function(){return this.mask_content},this.open=function(config){"on"===this.status&&this.close(),config&&config.content&&this.set_body(config.content),self.mask_config={},U.extend(self.mask_config,this.config,!0),U.extend(self.mask_config,config,!0);var css,_mask,cfg=self.mask_config,target=axd.get(cfg.target)[0],po=[],mask_id="ax-mask-"+ax5.get_guid(),css={},that={};if(po.push('<div class="ax-mask" id="'+mask_id+'">'),po.push('<div class="ax-mask-bg"></div>'),po.push('<div class="ax-mask-content">'),po.push('<div class="ax-mask-body">'),po.push(self.get_body()),po.push("</div>"),po.push("</div>"),po.push("</div>"),target==document.body)axd.append(target,po.join(""));else{axd.append(document.body,po.join(""));var box_model=axd.box_model(target);css={position:"absolute",left:box_model.offset.left,top:box_model.offset.top,width:box_model.width,height:box_model.height},axd.class_name(target,"add","ax-masking")}return this._mask=_mask=axd.get("#"+mask_id),this.target=target,this.status="on",axd.css(_mask,css),cfg.onchange&&(that={type:"open"},cfg.onchange.call(that,that)),this},this.close=function(){var cfg=this.mask_config;return axd.remove(this._mask),axd.class_name(this.target,"remove","ax-masking"),cfg.onchange&&(that={type:"close"},cfg.onchange.call(that,that)),this}};U.is_function(ax_super)&&(ax_class.prototype=new ax_super),root.mask=ax_class,"function"==typeof define&&define.amd&&define("_ax5_ui_mask",[],function(){return ax_class})}(ax5.ui,ax5.ui.root);