YUI.add("aui-modal",function(e,t){var n=e.Lang,r=e.UA,i=e.WidgetStdMod,s="ownerDocument",o=e.getClassName,u=".",a="",f=" ",l="br",c="click",h="destroyOnHide",p="draggable",d="draggableChange",v="fillHeight",m="height",g="modal",y="mousemove",b="resizable",w="resizableChange",E="visibleChange",S="width",x=o("modal-body"),T=o("modal-footer"),N=o("modal-header");e.Modal=e.Base.create(g,e.Widget,[e.WidgetCssClass,e.WidgetPosition,e.WidgetStdMod,e.WidgetToggle,e.WidgetAutohide,e.WidgetToolbars,e.WidgetPositionAlign,e.WidgetPositionConstrain,e.WidgetStack,e.WidgetModality],{initializer:function(){var t=this,n=[e.after(t._afterFillHeight,t,v),e.before(t._beforeFillHeight,t,v),t.after("resize:end",e.bind(t._syncResizeDimensions,t)),t.after(d,t._afterDraggableChange),t.after(w,t._afterResizableChange),t.after(E,t._afterVisibleChange)];t._applyPlugin(t._onUserInitInteraction),t._eventHandles=n},destructor:function(){var t=this;(new e.EventHandle(t._eventHandles)).detach(),t._userInteractionHandle&&t._userInteractionHandle.detach()},_addBubbleTargets:function(t){var r=this;return n.isObject(t)||(t={}),e.mix(t,{bubbleTargets:r})},_afterFillHeight:function(e){var t=this;t._fillMaxHeight(t.get(m))},_afterDraggableChange:function(t){var n=this;t.newVal?n._applyPlugin(n._plugDrag):n.unplug(e.Plugin.Drag)},_afterResizableChange:function(t){var n=this;t.newVal?n._applyPlugin(n._plugResize):n.unplug(e.Plugin.Resize)},_afterVisibleChange:function(e){var t=this;!e.newVal&&t.get(h)&&t.destroy()},_applyPlugin:function(e){var t=this;r.touchEnabled?e.call(t):t._userInteractionHandle||(t._userInteractionHandle=t.once([c,y],t._onUserInitInteraction,t))},_beforeFillHeight:function(){var e=this;e._fillMaxHeight("none")},_fillMaxHeight:function(e){var t=this,n=t.get(v),r=t.getStdModNode(n,!0);r&&r.setStyle("maxHeight",e)},_getStdModTemplate:function(t){return e.Node.create(e.Modal.TEMPLATES[t],this._stdModNode.get(s))},_beforeResizeCorrectDimensions:function(t){var n=this;if(n.resize.proxy)return new e.Do.Prevent},_onUserInitInteraction:function(){var e=this,t=e.get(p),n=e.get(b);e._userInteractionHandle=null,t&&e._plugDrag(),n&&e._plugResize()},_plugDrag:function(){var t=this,n=t.get(p);t.plug(e.Plugin.Drag,t._addBubbleTargets(n))},_plugResize:function(){var t=this,n=t.get(b);t.plug(e.Plugin.Resize,t._addBubbleTargets(n)),e.before(t._beforeResizeCorrectDimensions,t.resize,"_correctDimensions",t)},_syncResizeDimensions:function(e){var t=this,n=t.get("boundingBox"),r=e.info;t.set(S,r.offsetWidth-parseInt(n.getComputedStyle("borderRightWidth"),10)-parseInt(n.getComputedStyle("borderLeftWidth"),10)),t.set(m,r.offsetHeight-parseInt(n.getComputedStyle("borderTopWidth"),10)-parseInt(n.getComputedStyle("borderBottomWidth"),10))}},{CSS_PREFIX:o(g),ATTRS:{bodyContent:{value:a},destroyOnHide:{validator:n.isBoolean,value:!1},draggable:{value:{handles:[u+N],plugins:[{fn:e.Plugin.DDConstrained}]}},resizable:{value:{handles:l}},toolbars:{valueFn:function(){var e=this;return{header:[{cssClass:"close",label:"\u00d7",on:{click:function(t){e.hide(),t.domEvent.stopPropagation()}},render:!0}]}}}},TEMPLATES:{header:'<div class="'+i.SECTION_CLASS_NAMES[i.HEADER]+f+N+'"></div>',body:'<div class="'+i.SECTION_CLASS_NAMES[i.BODY]+f+x+'"></div>',footer:'<div class="'+i.SECTION_CLASS_NAMES[i.FOOTER]+f+T+'"></div>'}})},"2.0.0",{requires:["widget","widget-autohide","widget-buttons","widget-modality","widget-position","widget-position-align","widget-position-constrain","widget-stack","widget-stdmod","dd-plugin","dd-constrain","resize-plugin","aui-classnamemanager","aui-widget-cssclass","aui-widget-toggle","aui-widget-toolbars"]});
