AdfRichUIPeer.createPeerClass(AdfRichUIPeer,"AdfDhtmlPanelWindowBasePeer");
AdfDhtmlPanelWindowBasePeer.InitSubclass=function(){AdfRichUIPeer.addComponentEventHandlers(this,AdfUIInputEvent.CLICK_EVENT_TYPE,AdfUIInputEvent.KEY_DOWN_EVENT_TYPE,AdfUIInputEvent.KEY_PRESS_EVENT_TYPE,AdfUIInputEvent.KEY_UP_EVENT_TYPE,AdfUIInputEvent.FOCUS_EVENT_TYPE);AdfObject.ensureClassInitialization(AdfRichPanelWindow);AdfRichUIPeer.addComponentPropertyChanges(this,AdfRichPanelWindow.TITLE_ICON_SOURCE,AdfRichPanelWindow.TITLE,AdfRichPanelWindow.CONTENT_HEIGHT,AdfRichPanelWindow.CONTENT_WIDTH);
AdfRichUIPeer.addComponentPropertyGetters(this,AdfRichPanelWindow.CONTENT_HEIGHT,AdfRichPanelWindow.CONTENT_WIDTH);AdfRichUIPeer.addSuppressedPPRAttributes(this,AdfRichPanelWindow.TITLE,AdfRichPanelWindow.CONTENT_HEIGHT,AdfRichPanelWindow.CONTENT_WIDTH);this._HEADER_START_EDGE_SUBID="_hse";this._HEADER_CENTER_EDGE_SUBID="_hce";this._HEADER_END_EDGE_SUBID="_hee";this._CONTENT_START_EDGE_SUBID="_cse";this._CONTENT_END_EDGE_SUBID="_cee";this._FOOTER_START_EDGE_SUBID="_fse";this._FOOTER_CENTER_EDGE_SUBID=
"_fce";this._FOOTER_END_EDGE_SUBID="_fee";this._FOOTER_RESIZE_END_ICON_SUBID="_ree";this._FOOTER_RESIZE_START_ICON_SUBID="_rse";this._RESIZE_DRAG_SOURCE_SUBIDS=[this._HEADER_START_EDGE_SUBID,this._HEADER_CENTER_EDGE_SUBID,this._HEADER_END_EDGE_SUBID,this._CONTENT_START_EDGE_SUBID,this._CONTENT_END_EDGE_SUBID,this._FOOTER_START_EDGE_SUBID,this._FOOTER_CENTER_EDGE_SUBID,this._FOOTER_END_EDGE_SUBID,this._FOOTER_RESIZE_END_ICON_SUBID,this._FOOTER_RESIZE_START_ICON_SUBID];this._FOOTER_CENTER_CONTENT_SUBID=
"_fcc";this._CONTENT_SUBID="contentContainer";this._CONTENT_CENTER_SUBID="_ccntr";this._CONTENT_SIZED_FOR_MINIMUMS_EXPANDO="data-afr-csfm";this._HEADER_TITLE_BAR_SUBID="tb";this._CONTENT_RESIZED_INDICATOR_EXPANDO="data-afr-cri";this._PANEL_WINDOW_RESIZE_GHOST_CLASS="af|panelWindow::resize-ghost";this._RESIZE_ON="on";this._STRETCH_CHILDREN_FIRST="first";this._ANIMATION_DURATION_SKIN_PROPERTY="af|panelWindow-tr-open-animation-duration";this._ANIMATE_SKIN_PROPERTY="af|panelWindow-tr-animate"};
AdfDhtmlPanelWindowBasePeer.prototype.handleEscapeKey=function(a){this.Cancel();AdfAgent.AGENT.eatEvent(a.getNativeEvent())};
AdfDhtmlPanelWindowBasePeer.prototype.HandleComponentKeyDown=function(a){if(!a.isCanceled()){var b=AdfAgent.AGENT,d=a.getNativeEvent(),e=b.getEventTarget(d);d.keyCode==AdfKeyStroke.TAB_KEY?(d.shiftKey?AdfFocusUtils.focusPreviousTabStop(e,this.getDomElement(),null,null,!0):AdfFocusUtils.focusNextTabStop(e,this.getDomElement(),null,null,!0),b.eatEvent(d),a.stopBubbling()):d.keyCode==AdfKeyStroke.ESC_KEY&&(this.handleEscapeKey(a),a.stopBubbling())}};
AdfDhtmlPanelWindowBasePeer.prototype.HandleComponentKeyPress=function(a){a.isCanceled()||(a.getNativeEvent(),a.getKeyCode()==AdfKeyStroke.ENTER_KEY&&(this.IsClose(a)?(a.cancel(),a.stopBubbling(),this.Cancel()):this.IsPin(a)&&this.Pin()))};
AdfDhtmlPanelWindowBasePeer.prototype.HandleComponentKeyUp=function(a){if(!a.isCanceled()){var b=a.getNativeEvent(),d=a.getKeyCode();d==AdfKeyStroke.SPACE_KEY?this.IsClose(a)&&(this.Cancel(),a.cancel(),a.stopBubbling()):b.ctrlKey&&b.altKey&&d==AdfKeyStroke.W_KEY&&!this.getComponent().getModal()&&(AdfDhtmlDialogManager.getInstance().focusNextModelessDialog(),a.cancel(),a.stopBubbling())}};
AdfDhtmlPanelWindowBasePeer.prototype.HandleComponentFocus=function(a){a.getEventPhase()==AdfBaseEvent.AT_TARGET_PHASE&&a instanceof AdfDomComponentFocusEvent&&this._handleActivate(a,!1)};AdfDhtmlPanelWindowBasePeer.prototype._handleActivate=function(a,b){if(!a.isCanceled()){var d=this.getComponent(),e=this.getDomElement(),f=a.getNativeEventTarget();AdfDomUtils.isAncestorOrSelf(e,f)&&(d=this._getPopupWindow(d))&&d.handleActivate(b)&&(a.cancel(),a.stopBubbling())}};
AdfDhtmlPanelWindowBasePeer.prototype._handleMouseDownTouchStart=function(a){this._handleActivate(a,!0);var b=this.getComponent();if(b==a.getSource()&&b.getProperty("resize")==AdfDhtmlPanelWindowBasePeer._RESIZE_ON&&!AdfPage.PAGE.isDragging()){var d=a.getNativeEvent(),e=AdfAgent.AGENT,f=e.getEventTarget(d),g=f.id;g&&(g=g.split("::"),1<g.length&&(g=g[g.length-1],-1<AdfCollections.indexOf(AdfDhtmlPanelWindowBasePeer._RESIZE_DRAG_SOURCE_SUBIDS,g)&&(b=this._getPopupWindow(b))&&!b.isAnimating()&&AdfDomUtils.isAncestorOrSelf(b.getContent(),
f)&&(e.preventDefault(d),this._startResizeDrag(b,d,g),a.cancel())))}};AdfDhtmlPanelWindowBasePeer.prototype.HandleComponentClick=function(a){a.isLeftButtonPressed()&&(this.IsClose(a)?this.Cancel():this.IsPin(a)&&this.Pin())};AdfDhtmlPanelWindowBasePeer.prototype.IsClose=function(a){a=a.getNativeEventTarget();var b=this.getComponent(),b=AdfRichUIPeer.CreateSubId(b.getClientId(),"close");return a.id==b?!0:a.parentNode.id==b};
AdfDhtmlPanelWindowBasePeer.prototype.IsPin=function(a){a=a.getNativeEventTarget();var b=this.getComponent(),b=AdfRichUIPeer.CreateSubId(b.getClientId(),"pin");return a.id==b?!0:a.parentNode.id==b};AdfDhtmlPanelWindowBasePeer.prototype.Hide=function(a){a=this.getComponent().getParent();a instanceof AdfRichPopup?a.hide():this.hideAllPopups(a)};AdfDhtmlPanelWindowBasePeer.prototype.Cancel=function(a){a=this.getComponent().getParent();a instanceof AdfRichPopup?a.cancel():this.cancelAllPopups(a)};
AdfDhtmlPanelWindowBasePeer.prototype.Pin=function(){var a=this.getComponent().getParent();if(a instanceof AdfRichPopup&&a[AdfRichUIPeer._POPUP_LIST]){var b=a[AdfRichUIPeer._POPUP_LIST][a.getClientId()].getElement();AdfPage.PAGE.getAutoDismissalManager().cancelPopupDismissTimeout(a,b)}};
AdfDhtmlPanelWindowBasePeer.prototype.Init=function(a,b){AdfDhtmlPanelWindowBasePeer.superclass.Init.call(this,a,b);this._onResizeDrag=this.createCallback(this._handleResizeDrag);this._onResizeDrop=this.createCallback(this._handleResizeDrop);this._onAbortDrop=this.createCallback(this._handleResizeAbort)};
AdfDhtmlPanelWindowBasePeer.prototype.InitDomElement=function(a,b){var d=a.getParent();null==d&&(d=a);var e={};e[AdfDhtmlPopupHints.MODAL]=a.getModal();e[AdfDhtmlPopupHints.DRAG_ELEMENT]=this.getDragElement();"none"!=a.getInitialFocus()||a.getModal()?e[AdfDhtmlPopupHints.FOCUS]=!0:e[AdfDhtmlPopupHints.FOCUS]=!1;e[AdfDhtmlPopupHints.AUTODISMISS]=AdfDhtmlPopupHints.AUTODISMISS_INACTIVATE;e[AdfDhtmlPopupHints.TYPE]=AdfDhtmlPopupHints.TYPE_DIALOG;e[AdfRichPopup.HINT_ALIGN]=AdfRichPopup.ALIGN_OVERLAP;
e[AdfDhtmlPopupHints.COMPONENT_EVENTS_ENABLED]=!0;AdfDhtmlPopupPeer.setChildHints(d,e)};AdfDhtmlPanelWindowBasePeer.prototype.getDragElement=function(){var a=AdfRichUIPeer.CreateSubId(this.getComponent().getClientId(),AdfDhtmlPanelWindowBasePeer._HEADER_TITLE_BAR_SUBID);return AdfAgent.AGENT.getElementById(a)};
AdfDhtmlPanelWindowBasePeer.prototype.ComponentTitleChanged=function(a,b,d,e){b=AdfAgent.AGENT;a=AdfRichUIPeer.CreateSubId(a.getClientId(),"_ttxt");a=b.getElementById(a);b.setTextContent(a,d);return!0};
AdfDhtmlPanelWindowBasePeer.prototype.ComponentTitleIconSourceChanged=function(a,b,d,e){b=AdfAgent.AGENT;a=AdfRichUIPeer.CreateSubId(a.getClientId(),"_ticn");a=b.getElementById(a);e=b.getDomDocument().createElement("img");e.alt="";b.setImageSource(e,d);d?(a.hasChildNodes()?a.replaceChild(e,a.firstChild):a.appendChild(e),AdfDomUtils.setVisible(a,!0)):AdfDomUtils.setVisible(a,!1)};
AdfDhtmlPanelWindowBasePeer.prototype.ComponentContentWidthChanged=function(a,b,d,e){AdfDhtmlPanelWindowBasePeer._getResizableContentDom(a).style.width=d+"px";b.setAttribute(AdfDhtmlPanelWindowBasePeer._CONTENT_RESIZED_INDICATOR_EXPANDO,"1");return!0};AdfDhtmlPanelWindowBasePeer.prototype.ComponentContentHeightChanged=function(a,b,d,e){AdfDhtmlPanelWindowBasePeer._getResizableContentDom(a).style.height=d+"px";b.setAttribute(AdfDhtmlPanelWindowBasePeer._CONTENT_RESIZED_INDICATOR_EXPANDO,"1");return!0};
AdfDhtmlPanelWindowBasePeer.prototype.GetComponentContentWidth=function(a,b){var d=AdfDhtmlPanelWindowBasePeer._getResizableContentDom(a),e=d.style;return e.width?AdfAgent.getCSSLengthAsInt(e.width):d.offsetWidth};AdfDhtmlPanelWindowBasePeer.prototype.GetComponentContentHeight=function(a,b){var d=AdfDhtmlPanelWindowBasePeer._getResizableContentDom(a),e=d.style;return e.height?AdfAgent.getCSSLengthAsInt(e.height):d.offsetHeight};
AdfDhtmlPanelWindowBasePeer._getResizableContentDom=function(a){var b=a.getClientId(),d=null,d=null;a.getProperty("resize")==AdfDhtmlPanelWindowBasePeer._RESIZE_ON||a.getProperty("stretchChildren")==AdfDhtmlPanelWindowBasePeer._STRETCH_CHILDREN_FIRST?(d=AdfRichUIPeer.createSubId(b,AdfDhtmlPanelWindowBasePeer._CONTENT_CENTER_SUBID),d=AdfAgent.AGENT.getElementById(d),AdfAssert.assertDomElement(d,"DIV")):(d=AdfRichUIPeer.createSubId(b,AdfDhtmlPanelWindowBasePeer._CONTENT_SUBID),d=AdfAgent.AGENT.getElementById(d),
AdfAssert.assertDomElement(d,"TD"));return d};AdfDhtmlPanelWindowBasePeer.prototype._getPopupWindow=function(a){var b=null,d=(a=a.getParent())?a.getPeer():null;if(d)if(d.bind(a),a instanceof AdfRichPopup)b=d.getPopupWindow(a,a.getClientId());else{a=d.getAllPopups(a);for(var e in a)if(d=a[e],d instanceof AdfDhtmlSimpleFloat){b=d;break}}AdfAssert.assertPrototypeOrNull(b,AdfDhtmlSimpleFloat);return b};
AdfDhtmlPanelWindowBasePeer.prototype.BindToComponent=function(a,b){AdfDhtmlPanelWindowBasePeer.superclass.BindToComponent.call(this,a,b);if(AdfPage.PAGE.isCoreBackgroundScriptLoaded()){var d=this._getPopupWindow(a);d&&d.handleBindToComponent()}};AdfDhtmlPanelWindowBasePeer.prototype.ComponentRemoved=function(a){(a=this._getPopupWindow(a))&&a.handleComponentRemoved()};
AdfDhtmlPanelWindowBasePeer.prototype.calculateMinimumContentSize=function(){var a=this.getComponent().getClientId(),b=AdfAgent.AGENT,d=AdfRichUIPeer.createSubId(a,AdfDhtmlPanelWindowBasePeer._CONTENT_CENTER_SUBID),d=b.getElementById(d);AdfAssert.assertDomElement(d,"DIV");if(!d.hasAttribute(AdfDhtmlPanelWindowBasePeer._CONTENT_SIZED_FOR_MINIMUMS_EXPANDO)){var e=AdfRichUIPeer.createSubId(a,AdfDhtmlPanelWindowBasePeer._HEADER_CENTER_EDGE_SUBID),f=b.getElementById(e);AdfAssert.assertDomElement(f,"TD");
for(var e=Math.max(1,f.offsetWidth),g=AdfRichUIPeer.createSubId(a,AdfDhtmlPanelWindowBasePeer._HEADER_TITLE_BAR_SUBID),f=f.getElementsByTagName("TD"),h=a=0;h<f.length;h++){var k=f[h],l=null;k.id&&k.id==g&&(l=k.style.width,k.style.width="1px");for(var m=AdfDomUtils.getChildElements(k),n=0;n<m.length;n++)var q=m[n],a=a+b.getOuterWidth(q,q.offsetWidth);k.id&&k.id==g&&(k.style.width=l)}b=AdfAgent.getCSSLengthAsInt(d.style.minWidth);b=Math.max(b,a);d.style.minWidth=b+"px";b=AdfAgent.getCSSLengthAsInt(d.style.minHeight);
b=Math.max(b,Math.round(a/e*Math.max(1,d.offsetHeight)));d.style.minHeight=b+"px";d.setAttribute(AdfDhtmlPanelWindowBasePeer._CONTENT_SIZED_FOR_MINIMUMS_EXPANDO,"1")}};AdfDhtmlPanelWindowBasePeer.prototype.GetResizeGhostSelector=function(){return AdfDhtmlPanelWindowBasePeer._PANEL_WINDOW_RESIZE_GHOST_CLASS};
AdfDhtmlPanelWindowBasePeer.prototype._startResizeDrag=function(a,b,d){var e=AdfPage.PAGE,f=AdfAgent.AGENT,g=f.getEventTarget(b).style;AdfAssert.assertString(d);this._eventTargetSubId=d;d=a.getContainedComponentClientId();AdfAssert.assertString(d);this._popupWindow=a;AdfAssert.assertPrototype(a,AdfDhtmlSimpleFloat);this.calculateMinimumContentSize();d=AdfRichUIPeer.createSubId(d,AdfDhtmlPanelWindowBasePeer._CONTENT_CENTER_SUBID);var h=this._resizableContentDom=f.getElementById(d);AdfAssert.assertDomElement(h,
"DIV");var k=h.style,l=AdfAgent.getCSSLengthAsInt(k.width),m=AdfAgent.getCSSLengthAsInt(k.height),f=AdfAgent.getCSSLengthAsInt(k.minWidth);d=AdfAgent.getCSSLengthAsInt(k.minHeight);this._initContentWidth=l=0<l?l:h.offsetWidth;this._initContentHeight=m=0<m?m:h.offsetHeight;k.height=m+"px";k.width=l+"px";h=this._ghost=h.ownerDocument.createElement("div");k=e.getLookAndFeel().getStyleClass(this.GetResizeGhostSelector());AdfDomUtils.addCSSClassName(h,k);var k=a.getWidth()-2,n=a.getHeight()-2,l=this._contentToChromeDeltaX=
k-l,m=this._contentToChromeDeltaY=n-m;e.getZOrderManager().addElementToLayer(h,AdfDhtmlZOrderManager.FLOATINGTYPE_WINDOW);e=h.style;e.cursor=g.cursor;e.top=a.getTop()+"px";e.left=a.getLeft()+"px";e.width=k+"px";e.height=n+"px";e.minWidth=f+l+"px";e.minHeight=d+m+"px";a.setDragging(!0);a.setShadowVisibility(!1);AdfPage.PAGE.startDrag(b,this._onResizeDrag,this._onResizeDrop,this._onResizeAbort,!0)};
AdfDhtmlPanelWindowBasePeer.prototype._handleResizeDrag=function(a,b,d){var e=AdfAgent.AGENT,f=e.getBrowserViewportScrollTop(),g=e.getBrowserViewportScrollLeft(),h=e.getWindowWidth(),k=e.getWindowHeight();b=this._eventTargetSubId;AdfAssert.assertString(b);d=this._ghost;AdfAssert.assertDomElement(d,"DIV");d=d.style;var l=AdfAgent.getCSSLengthAsInt(d.width),m=AdfAgent.getCSSLengthAsInt(d.height);a=e.getMousePosition(a);if(!(a.x<g||a.x>h+g||a.y<f||a.y>k+f)){var f=AdfAgent.getCSSLengthAsInt(d.minWidth),
g=AdfAgent.getCSSLengthAsInt(d.minHeight),h=AdfAgent.getCSSLengthAsInt(d.top),k=AdfAgent.getCSSLengthAsInt(d.left),e=h,n=k,q=l,r=m;switch(b){case AdfDhtmlPanelWindowBasePeer._HEADER_START_EDGE_SUBID:h=a.y;m+=e-a.y;k=a.x;l+=n-a.x;m<g&&(h=e,m=r);l<f&&(k=n,l=q);break;case AdfDhtmlPanelWindowBasePeer._HEADER_CENTER_EDGE_SUBID:h=a.y;m+=e-a.y;m<g&&(h=e,m=r);break;case AdfDhtmlPanelWindowBasePeer._HEADER_END_EDGE_SUBID:h=a.y;m+=e-a.y;l=a.x-n;m<g&&(h=e,m=r);l<f&&(l=q);break;case AdfDhtmlPanelWindowBasePeer._CONTENT_START_EDGE_SUBID:k=
a.x;l+=n-a.x;l<f&&(k=n,l=q);break;case AdfDhtmlPanelWindowBasePeer._CONTENT_END_EDGE_SUBID:l=a.x-n;l<f&&(l=q);break;case AdfDhtmlPanelWindowBasePeer._FOOTER_RESIZE_START_ICON_SUBID:case AdfDhtmlPanelWindowBasePeer._FOOTER_START_EDGE_SUBID:k=a.x;l+=n-a.x;m=a.y-e;l<f&&(k=n,l=q);m<g&&(m=r);break;case AdfDhtmlPanelWindowBasePeer._FOOTER_CENTER_EDGE_SUBID:m=a.y-e;m<g&&(m=r);break;case AdfDhtmlPanelWindowBasePeer._FOOTER_RESIZE_END_ICON_SUBID:case AdfDhtmlPanelWindowBasePeer._FOOTER_END_EDGE_SUBID:m=a.y-
e,l=a.x-n,m<g&&(m=r),l<f&&(l=q)}e!=h&&(d.top=h+"px");n!=k&&(d.left=k+"px");r!=m&&(d.height=m+"px");q!=l&&(d.width=l+"px")}};
AdfDhtmlPanelWindowBasePeer.prototype._handleResizeDrop=function(a,b,d){a=AdfPage.PAGE;b=this._ghost;AdfAssert.assertDomElement(b,"DIV");var e=b.style;d=this._popupWindow;AdfAssert.assertPrototype(d,AdfDhtmlSimpleFloat);var f=d.getContainedComponentClientId();AdfAssert.assertString(f);var g=this._initContentWidth;AdfAssert.assertNumeric(g);var h=this._initContentHeight;AdfAssert.assertNumeric(h);var k=this._resizableContentDom;AdfAssert.assertDomElement(k,"DIV");var l=this._contentToChromeDeltaX;
AdfAssert.assertNumeric(l);var m=this._contentToChromeDeltaY;AdfAssert.assertNumeric(m);delete this._eventTargetSubId;delete this._popupWindow;delete this._initContentWidth;delete this._initContentHeight;delete this._resizableContentDom;delete this._contentToChromeDeltaX;delete this._contentToChromeDeltaY;delete this._ghost;var n=AdfAgent.getCSSLengthAsInt(e.top),q=AdfAgent.getCSSLengthAsInt(e.left),l=AdfAgent.getCSSLengthAsInt(e.width)-l,e=AdfAgent.getCSSLengthAsInt(e.height)-m;(f=a.findComponent(f))&&
f.getContentWidth&&f.getContentHeight&&(f.getPeer().bind(f),l!=g&&f.setProperty(AdfRichPanelWindow.CONTENT_WIDTH,l,!0,!0),e!=h&&f.setProperty(AdfRichPanelWindow.CONTENT_HEIGHT,e,!0,!0));a.getZOrderManager().removeElement(b);d.autoSize();a.doResizeNotifyDom(k,!1);d.setDragging(!1);d.setShadowVisibility(!0);d.setPosition(n,q)};
AdfDhtmlPanelWindowBasePeer.prototype._handleResizeAbort=function(){var a=this._ghost;AdfAssert.assertDomElement(a,"DIV");delete this._eventTargetSubId;delete this._popupWindow;delete this._initContentWidth;delete this._initContentHeight;delete this._resizableContentDom;delete this._contentToChromeDeltaX;delete this._contentToChromeDeltaY;delete this._ghost;AdfPage.PAGE.getZOrderManager().removeElement(a)};
AdfDhtmlPanelWindowBasePeer.prototype.isContentResized=function(a){var b=a.getPeer();b.bind(a);return(a=b.getDomElement().getAttribute(AdfDhtmlPanelWindowBasePeer._CONTENT_RESIZED_INDICATOR_EXPANDO))&&"1"==a};AdfDhtmlPanelWindowBasePeer.prototype.getAnimationDurationSkinProperty=function(){return AdfDhtmlPanelWindowBasePeer._ANIMATION_DURATION_SKIN_PROPERTY};AdfDhtmlPanelWindowBasePeer.prototype.getAnimateSkinProperty=function(){return AdfDhtmlPanelWindowBasePeer._ANIMATE_SKIN_PROPERTY};