YUI.add("widget-stack",function(e,t){var i=e.Lang,s=e.UA,n=e.Node,h=e.Widget,a="zIndex",d="shim",r="visible",_="shimdeferred",c="shimresize",o="visibleChange";function S(e){}S.ATTRS={shim:{value:6==s.ie},zIndex:{value:0,setter:"_setZIndex"}},S.HTML_PARSER={zIndex:function(e){return this._parseZIndex(e)}},S.SHIM_CLASS_NAME=h.getClassName(d),S.STACKED_CLASS_NAME=h.getClassName("stacked"),S.SHIM_TEMPLATE='<iframe class="'+S.SHIM_CLASS_NAME+'" frameborder="0" title="Widget Stacking Shim" src="javascript:false" tabindex="-1" role="presentation"></iframe>',S.prototype={initializer:function(){this._stackNode=this.get("boundingBox"),this._stackHandles={},e.after(this._renderUIStack,this,"renderUI"),e.after(this._syncUIStack,this,"syncUI"),e.after(this._bindUIStack,this,"bindUI")},_syncUIStack:function(){this._uiSetShim(this.get(d)),this._uiSetZIndex(this.get(a))},_bindUIStack:function(){this.after("shimChange",this._afterShimChange),this.after("zIndexChange",this._afterZIndexChange)},_renderUIStack:function(){this._stackNode.addClass(S.STACKED_CLASS_NAME)},_parseZIndex:function(e){e=e.inDoc()&&"static"!==e.getStyle("position")?e.getComputedStyle("zIndex"):"auto";return"auto"===e?null:e},_setZIndex:function(e){return i.isString(e)&&(e=parseInt(e,10)),e=i.isNumber(e)?e:0},_afterShimChange:function(e){this._uiSetShim(e.newVal)},_afterZIndexChange:function(e){this._uiSetZIndex(e.newVal)},_uiSetZIndex:function(e){this._stackNode.setStyle(a,e)},_uiSetShim:function(e){e?(this.get(r)?this._renderShim():this._renderShimDeferred(),6==s.ie&&this._addShimResizeHandlers()):this._destroyShim()},_renderShimDeferred:function(){this._stackHandles[_]=this._stackHandles[_]||[];this._stackHandles[_].push(this.on(o,function(e){e.newVal&&this._renderShim()}))},_addShimResizeHandlers:function(){this._stackHandles[c]=this._stackHandles[c]||[];var e=this.sizeShim,t=this._stackHandles[c];t.push(this.after(o,e)),t.push(this.after("widthChange",e)),t.push(this.after("heightChange",e)),t.push(this.after("contentUpdate",e))},_detachStackHandles:function(e){var t,i=this._stackHandles[e];if(i&&0<i.length)for(;t=i.pop();)t.detach()},_renderShim:function(){var e=this._shimNode,t=this._stackNode;e||(e=this._shimNode=this._getShimTemplate(),t.insertBefore(e,t.get("firstChild")),this._detachStackHandles(_),this.sizeShim())},_destroyShim:function(){this._shimNode&&(this._shimNode.get("parentNode").removeChild(this._shimNode),this._shimNode=null,this._detachStackHandles(_),this._detachStackHandles(c))},sizeShim:function(){var e=this._shimNode,t=this._stackNode;e&&6===s.ie&&this.get(r)&&(e.setStyle("width",t.get("offsetWidth")+"px"),e.setStyle("height",t.get("offsetHeight")+"px"))},_getShimTemplate:function(){return n.create(S.SHIM_TEMPLATE,this._stackNode.get("ownerDocument"))}},e.WidgetStack=S},"patched-v3.18.4",{requires:["base-build","widget"],skinnable:!0});