YUI.add("widget-stdmod",function(i,t){var o,e,n,s,r,h,a=i.Lang,d=i.Node,S=i.UA,l=i.Widget,g="fillHeight",f="Node",u="Content",_="contentBox",M="height",c="offsetHeight",C="contentUpdate",E=i.Widget.UI_SRC;function p(t){}p.HEADER="header",p.BODY="body",p.FOOTER="footer",p.AFTER="after",p.BEFORE="before",p.REPLACE="replace",s=(o=p.HEADER)+u,r=(n=p.FOOTER)+u,h=(e=p.BODY)+u,p.ATTRS={headerContent:{value:null},footerContent:{value:null},bodyContent:{value:null},fillHeight:{value:p.BODY,validator:function(t){return this._validateFillHeight(t)}}},p.HTML_PARSER={headerContent:function(t){return this._parseStdModHTML(o)},bodyContent:function(t){return this._parseStdModHTML(e)},footerContent:function(t){return this._parseStdModHTML(n)}},p.SECTION_CLASS_NAMES={header:l.getClassName("hd"),body:l.getClassName("bd"),footer:l.getClassName("ft")},p.TEMPLATES={header:'<div class="'+p.SECTION_CLASS_NAMES[o]+'"></div>',body:'<div class="'+p.SECTION_CLASS_NAMES[e]+'"></div>',footer:'<div class="'+p.SECTION_CLASS_NAMES[n]+'"></div>'},p.prototype={initializer:function(){this._stdModNode=this.get(_),i.before(this._renderUIStdMod,this,"renderUI"),i.before(this._bindUIStdMod,this,"bindUI"),i.before(this._syncUIStdMod,this,"syncUI")},_syncUIStdMod:function(){var t=this._stdModParsed;t&&t[s]||this._uiSetStdMod(o,this.get(s)),t&&t[h]||this._uiSetStdMod(e,this.get(h)),t&&t[r]||this._uiSetStdMod(n,this.get(r)),this._uiSetFillHeight(this.get(g))},_renderUIStdMod:function(){this._stdModNode.addClass(l.getClassName("stdmod")),this._renderStdModSections(),this.after("headerContentChange",this._afterHeaderChange),this.after("bodyContentChange",this._afterBodyChange),this.after("footerContentChange",this._afterFooterChange)},_renderStdModSections:function(){a.isValue(this.get(s))&&this._renderStdMod(o),a.isValue(this.get(h))&&this._renderStdMod(e),a.isValue(this.get(r))&&this._renderStdMod(n)},_bindUIStdMod:function(){this.after("fillHeightChange",this._afterFillHeightChange),this.after("heightChange",this._fillHeight),this.after(C,this._fillHeight)},_afterHeaderChange:function(t){t.src!==E&&this._uiSetStdMod(o,t.newVal,t.stdModPosition)},_afterBodyChange:function(t){t.src!==E&&this._uiSetStdMod(e,t.newVal,t.stdModPosition)},_afterFooterChange:function(t){t.src!==E&&this._uiSetStdMod(n,t.newVal,t.stdModPosition)},_afterFillHeightChange:function(t){this._uiSetFillHeight(t.newVal)},_validateFillHeight:function(t){return!t||t==p.BODY||t==p.HEADER||t==p.FOOTER},_uiSetFillHeight:function(t){var t=this.getStdModNode(t),e=this._currFillNode;e&&t!==e&&e.setStyle(M,""),t&&(this._currFillNode=t),this._fillHeight()},_fillHeight:function(){var t;this.get(g)&&""!=(t=this.get(M))&&"auto"!=t&&this.fillHeight(this.getStdModNode(this.get(g)))},_uiSetStdMod:function(t,e,i){var d;a.isValue(e)?(d=this.getStdModNode(t,!0),this._addStdModContent(d,e,i),this.set(t+u,this._getStdModContent(t),{src:E})):this._eraseStdMod(t),this.fire(C)},_renderStdMod:function(t){var e=this.get(_),i=(i=this._findStdModSection(t))||this._getStdModTemplate(t);return this._insertStdModSection(e,t,i),this[t+f]=i,this[t+f]},_eraseStdMod:function(t){var e=this.getStdModNode(t);e&&(e.remove(!0),delete this[t+f])},_insertStdModSection:function(t,e,i){var d=t.get("firstChild");e!==n&&d?e===o?t.insertBefore(i,d):(e=this[n+f])?t.insertBefore(i,e):t.appendChild(i):t.appendChild(i)},_getStdModTemplate:function(t){return d.create(p.TEMPLATES[t],this._stdModNode.get("ownerDocument"))},_addStdModContent:function(t,e,i){switch(i){case p.BEFORE:i=0;break;case p.AFTER:i=undefined;break;default:i=p.REPLACE}t.insert(e,i)},_getPreciseHeight:function(t){var e=t?t.get(c):0,i="getBoundingClientRect";return e=t&&t.hasMethod(i)&&(i=t.invoke(i))?i.bottom-i.top:e},_findStdModSection:function(t){return this.get(_).one("> ."+p.SECTION_CLASS_NAMES[t])},_parseStdModHTML:function(t){var e=this._findStdModSection(t);return e?(this._stdModParsed||(this._stdModParsed={},i.before(this._applyStdModParsedConfig,this,"_applyParsedConfig")),this._stdModParsed[t+u]=1,e.get("innerHTML")):null},_applyStdModParsedConfig:function(t,e,i){var d=this._stdModParsed;d&&(d[s]=!(s in e)&&s in d,d[h]=!(h in e)&&h in d,d[r]=!(r in e)&&r in d)},_getStdModContent:function(t){return this[t+f]?this[t+f].get("childNodes"):null},setStdModContent:function(t,e,i){this.set(t+u,e,{stdModPosition:i})},getStdModNode:function(t,e){var i=this[t+f]||null;return i=!i&&e?this._renderStdMod(t):i},fillHeight:function(t){var e,i,d,o,n,s,r;if(t){for(o=this.get(_),n=!(e=[this.headerNode,this.bodyNode,this.footerNode]),s=d=0,r=e.length;s<r;s++)(i=e[s])&&(i!==t?d+=this._getPreciseHeight(i):n=!0);n&&((S.ie||S.opera)&&t.set(c,0),o=o.get(c)-parseInt(o.getComputedStyle("paddingTop"),10)-parseInt(o.getComputedStyle("paddingBottom"),10)-parseInt(o.getComputedStyle("borderBottomWidth"),10)-parseInt(o.getComputedStyle("borderTopWidth"),10),a.isNumber(o)&&0<=(o=o-d)&&t.set(c,o))}}},i.WidgetStdMod=p},"patched-v3.18.4",{requires:["base-build","widget"]});