text: /*
  Copyright (c) 2007, Caridy Patino. All rights reserved.
  Portions Copyright (c) 2007, Yahoo!, Inc. All rights reserved.
  Code licensed under the BSD License:
  http://www.bubbling-library.com/eng/licence
  version: 1.5.0
  */
  (function(){var $B=YAHOO.Bubbling,$L=YAHOO.lang,$E=YAHOO.util.Event,$D=YAHOO.util.Dom,$=YAHOO.util.Dom.get;YAHOO.widget.Loading=function(){var obj={},_handle='yui-cms-loading',_content='yui-cms-float',_visible=false,_ready=false,_first=true,_timer=null,_backup={},_defStyle={zIndex:10000,left:0,top:0,margin:0,padding:0,opacity:0,overflow:'hidden',visibility:'visible',position:'absolute',display:'block'};_defConf={autodismissdelay:0,opacity:1,closeOnDOMReady:false,closeOnLoad:true,close:false,effect:false,simple:false,fullscreen:false};function _onHide(){if($L.isObject(obj.element)){$D.setStyle(obj.element,'opacity',0);$D.setStyle(obj.element,'display','none');}}function _onShow(){if($L.isObject(obj.element)){$D.setStyle(obj.element,'opacity',_defConf.opacity);}}var actionControl=function(layer,args){if(_visible&&$L.isObject(obj.element)&&((obj.element===args[1].target)||$D.isAncestor(obj.element,args[1].target))){if(window.confirm('Do you want to hide the loading mask?')){obj.hide();}}};$B.on('navigate',actionControl);$B.on('property',actionControl);obj.counter=0;obj.element=null;obj.content=null;obj.proxy=null;obj.anim=null;obj.config=function(userConfig){userConfig=userConfig||{};$L.augmentObject(_defConf,userConfig,true);if(this.element&&_visible){_onShow();}};obj.backup=function(){var el=document.body;_backup.padding=$D.getStyle(el,'padding');_backup.margin=$D.getStyle(el,'margin');_backup.overflow=$D.getStyle(el,'overflow');};obj.restore=function(){var el=document.body,p=document.documentElement;$D.setStyle(el,'padding',_backup.padding);$D.setStyle(el,'padding',_backup.padding);$D.setStyle(el,'overflow',_backup.overflow);$D.setStyle(el,'height','auto');$D.setStyle(el,'width','auto');$D.setStyle(p,'overflow','auto');$D.setStyle(p,'height','auto');$D.setStyle(p,'width','auto');var h=Math.max($D.getViewportHeight(),el.offsetHeight)+'px';$D.setStyle(el,'height',h);$D.setStyle(p,'height',h);window.setTimeout(function(){$D.setStyle(el,'height','auto');$D.setStyle(p,'height','auto');},1);};obj.init=function(){var item;this.element=$(_handle);this.content=$(_content);if(!_ready&&($L.isObject(this.element))){_ready=true;for(item in _defStyle){if(_defStyle.hasOwnProperty(item)){$D.setStyle(this.element,item,_defStyle[item]);}}obj.show();}};obj.adjust=function(){var vp;if(!_defConf.fullscreen&&this.proxy&&$D.inDocument(this.proxy)){vp=$D.getRegion(this.proxy);vp.height=vp.bottom-vp.top;vp.width=vp.right-vp.left;}else{vp={top:$D.getDocumentScrollTop(),left:$D.getDocumentScrollLeft(),width:$D.getViewportWidth(),height:$D.getViewportHeight()};}if(_visible){$D.setStyle(this.element,'height',vp.height+'px');$D.setStyle(this.element,'width',vp.width+'px');$D.setXY(this.element,[vp.left,vp.top]);if(this.content){var size=$D.getRegion(this.content);var oHeight=size.bottom-size.top;var oWidth=size.right-size.left;$D.setXY(this.content,[vp.left+((vp.width-oWidth)/2),vp.top+((vp.height-oHeight)/2)]);}}};obj.show=function(el){if(this.element&&!_visible){_visible=true;this.backup();this.proxy=el;if(!this.proxy||_defConf.fullscreen){$D.setStyle(document.documentElement,'overflow','hidden');$D.setStyle(document.body,'overflow','hidden');}$D.setStyle(this.element,'display','block');if(_first){$B.on('repaint',obj.adjust,obj,true);}obj.adjust();if(_defConf.effect&&!_first){if((this.anim)&&(this.anim.isAnimated())){this.anim.stop();}this.anim=new YAHOO.util.Anim(this.element,{opacity:{to:_defConf.opacity}},1.5,YAHOO.util.Easing.easeIn);this.anim.onComplete.subscribe(_onShow);this.anim.animate();}else{_onShow();}if(_defConf.closeOnDOMReady){$E.onDOMReady(obj.hide,obj,true);}if(_defConf.closeOnLoad){$E.on(window,'load',obj.hide,obj,true);}window.clearTimeout(_timer);_timer=null;if($L.isNumber(_defConf.autodismissdelay)&&(_defConf.autodismissdelay>0)){_timer=window.setTimeout(function(){obj.hide();},Math.abs(_defConf.autodismissdelay));}}};obj.hide=function(){if(this.element&&_visible){_visible=false;if(_defConf.effect){if((this.anim)&&(this.anim.isAnimated())){this.anim.stop();}this.anim=new YAHOO.util.Anim(this.element,{opacity:{to:0}},1.5,YAHOO.util.Easing.easeOut);this.anim.onComplete.subscribe(_onHide);this.anim.animate();}else{_onHide();}obj.counter=0;obj.restore();if(_first){_first=false;YAHOO.Bubbling.fire('onMaskReady',{element:obj.element,content:obj.content,config:_defConf});}}};if($D.inDocument(_handle)){obj.init();}else{$E.onContentReady(_handle,obj.init,obj,true);}if($L.isObject(YAHOO.widget._cLoading)){obj.config(YAHOO.widget._cLoading);}if(!_defConf.simple){$B.on('onAsyncRequestStart',function(layer,args){obj.counter++;obj.show(args[1].element);});$B.on('onAsyncRequestEnd',function(layer,args){obj.counter--;if(obj.counter<=0){obj.hide();obj.counter=0;}});}return obj;}();})();
  YAHOO.register("loading",YAHOO.widget.Loading,{version:"1.5.0",build:"216"});