function AdfDhtmlSimpleFloat(){this.Init()}AdfObject.createSubclass(AdfDhtmlSimpleFloat,AdfDhtmlPopupWindow);AdfDhtmlSimpleFloat.InitClass=function(){this._DRAG_STYLECLASS="p_AFDrag";this._INACTIVE_STYLECLASS="p_AFInactive";this._CONTENT_ID="contentContainer";this._BACKGROUND_EXPANDO="data-afr-panelwindowbackground";this._TITLE_ID="_ttxt";this._POPUP_INITIAL_FOCUS_LIVE_CONTENT_ID="AFPopupInitialFocusLiveContent"};AdfDhtmlSimpleFloat.prototype.Init=function(){AdfDhtmlSimpleFloat.superclass.Init.call(this)};
AdfDhtmlSimpleFloat.prototype.getContainedComponentClientId=function(){return this._containedComponentId};
AdfDhtmlSimpleFloat.prototype.GetFocusContent=function(){var a=AdfAgent.AGENT;if(a.getDomWindow().AdfSafariMobileAgent&&a instanceof AdfSafariMobileAgent)return AdfDhtmlSimpleFloat.superclass.GetFocusContent.call(this);var a=this._getContainedComponentPeer(),b=AdfRichUIPeer.CreateSubId(a.getComponent().getClientId(),AdfDhtmlSimpleFloat._CONTENT_ID);(b=AdfAgent.AGENT.getElementById(b))&&AdfAgent.AGENT.getPlatform()==AdfAgent.GECKO_PLATFORM&&(b.tabIndex=-1);b&&(b=AdfFocusUtils.containsFocus(b)?AdfPage.PAGE.getActiveDomElement():
AdfFocusUtils.getFirstTabStop(b));b||(a instanceof AdfDhtmlDialogPeer&&(b=a.getDefaultButtonDom(this.getContainedComponentClientId())),b||(b=a.getDomElement()));return b};AdfDhtmlSimpleFloat.prototype.setContent=function(a){AdfDhtmlSimpleFloat.superclass.setContent.call(this,a);a=this._getMainElement(a);this.setShadowAnchor(a);this._containedComponentId=AdfRichUIPeer.getFirstAncestorComponent(a).getClientId()};
AdfDhtmlSimpleFloat.prototype.setAccessibleAttrs=function(a){var b=this.getElement(),d=this._getContainedComponentPeer(),e=AdfRichUIPeer.CreateSubId(d.getComponent().getClientId(),AdfDhtmlSimpleFloat._CONTENT_ID),d=AdfRichUIPeer.CreateSubId(d.getComponent().getClientId(),AdfDhtmlSimpleFloat._TITLE_ID);b.setAttribute("role","dialog");b.setAttribute("aria-describedby",e);b.setAttribute("aria-labelledby",d);a[AdfDhtmlPopupHints.MODAL]&&b.setAttribute("aria-modal","true")};
AdfDhtmlSimpleFloat.prototype.announceOpeningViaLiveRegion=function(a){if(a&&!a[AdfDhtmlPopupHints.FOCUS]){a=AdfPage.PAGE.getLookAndFeel();var b=AdfPage.PAGE.getDocumentClientId(),b=AdfRichUIPeer.CreateSubId(b,AdfDhtmlDocumentPeer._GLOBAL_LIVE_CONTAINER_ID),b=AdfAgent.AGENT.getElementById(b),d=AdfPage.PAGE.getDomWindow().AdfSafariMobileAgent&&AdfAgent.AGENT instanceof AdfSafariMobileAgent?"af_panelWindow.INITIAL_FOCUS_LIVE_TEXT_MOBILE":"af_panelWindow.INITIAL_FOCUS_LIVE_TEXT";a=a.getTranslatedString(d);
AdfAgent.AGENT.setTextContent(b,a)}};AdfDhtmlSimpleFloat.prototype.removeAccessibleAttrs=function(){var a=AdfPage.PAGE.getDocumentClientId(),a=AdfRichUIPeer.CreateSubId(a,AdfDhtmlDocumentPeer._GLOBAL_LIVE_CONTAINER_ID);(a=AdfAgent.AGENT.getElementById(a))&&AdfAgent.AGENT.setTextContent(a,"")};AdfDhtmlSimpleFloat.prototype._getMainElement=function(a){a=a.getElementsByTagName("table")[0];AdfAssert.assert(a,"Main Element of floating window must be a table");return a};
AdfDhtmlSimpleFloat.prototype.setDragElement=function(a){this._dragElement=a;this._repositionable&&(this._repositionable.destroy(),delete this._repositionable)};AdfDhtmlSimpleFloat.prototype.getModal=function(a){return this._modal};AdfDhtmlSimpleFloat.prototype.setModal=function(a){this._modal=a};AdfDhtmlSimpleFloat.prototype.getInitialFocus=function(a){return this._initialFocus};AdfDhtmlSimpleFloat.prototype.setInitialFocus=function(a){this._initialFocus=a};
AdfDhtmlSimpleFloat.prototype.activate=function(){this.raiseToFront();this.showAsActive();var a=this.getShadowAnchor();AdfDhtmlShadowDecorator.hasShadowDecorator(a)&&AdfDhtmlShadowDecorator.moveShadowDecorator(a);AdfFocusUtils.containsFocus(this.GetFocusContent())||AdfFocusUtils.isFocusChangePending()||this.FocusOnFirstElement(!0)};
AdfDhtmlSimpleFloat.prototype.showAsActive=function(){for(var a=this._getContainedComponentDomElement(),b=a.childNodes,d=b.length,e=0;e<d;e++){var f=b[e],g=f.style;null!=f.getAttribute(AdfDhtmlSimpleFloat._BACKGROUND_EXPANDO)&&(g.display="none")}AdfDomUtils.removeCSSClassName(a,AdfDhtmlSimpleFloat._INACTIVE_STYLECLASS);this.raiseToFront();a=this.getShadowAnchor();AdfDhtmlShadowDecorator.hasShadowDecorator(a)&&(AdfDhtmlShadowDecorator.moveShadowDecorator(a),AdfDhtmlShadowDecorator.showShadowDecorator(a,
!0))};
AdfDhtmlSimpleFloat.prototype.showAsInActive=function(){var a=this.getElement().style.zIndex,b=this._getContainedComponentDomElement();if(b){for(var d=b.offsetWidth,e=b.offsetHeight,f=b.childNodes,g=f.length,h=0,k=0;h<g;h++){var l=f[h],m=l.style;null!=l.getAttribute(AdfDhtmlSimpleFloat._BACKGROUND_EXPANDO)?(m.zIndex=a-1,m.marginLeft=k+"px",m.marginTop=3-k+"px",m.width=Math.max(0,d-2-2*k)+"px",m.height=Math.max(0,e-2-2*(3-k))+"px",m.display="block",k++):m.zIndex=a}AdfDomUtils.addCSSClassName(b,AdfDhtmlSimpleFloat._INACTIVE_STYLECLASS);
a=this.getShadowAnchor();AdfDhtmlShadowDecorator.hasShadowDecorator(a)&&(AdfDhtmlShadowDecorator.moveShadowDecorator(a),AdfDhtmlShadowDecorator.showShadowDecorator(a,!0))}};
AdfDhtmlSimpleFloat.prototype.CreateDomElement=function(){var a=AdfPage.PAGE,b=a.getDomDocument(),d=b.createElement("div");if(this.NeedsCloseLink()){var e=b.createElement("div");d.appendChild(e);a=a.getLookAndFeel().getTranslatedString("af_popup.TIP_DISMISS");e.innerHTML='\x3ca href\x3d"javascript:;" style\x3d"position:absolute;top:-999px;" onclick\x3d"var popupDiv \x3d this.parentNode.parentNode;var contentDiv \x3d AdfDomUtils.getChildElements(popupDiv)[1];var label \x3d popupDiv.getAttribute(\'aria-labelledby\');var compId \x3d label.split(\'::\')[0];var comp \x3d AdfPage.PAGE.findComponentByAbsoluteId(compId);var peer \x3d comp.getPeer();peer.bind(comp);peer.Cancel();"\x3e'+a+
"\x3c/a\x3e"}e=b.createElement("div");d.appendChild(e);this.SetContentParent(e);b=b.createElement("div");b.setAttribute("role","presentation");AdfDomUtils.addCSSClassName(b,AdfDhtmlPopupWindow._POPUP_TAIL_STYLECLASS);d.appendChild(b);this._tailElement=b;return d};AdfDhtmlSimpleFloat.prototype.SetContentParent=function(a){this._contentElement=a};AdfDhtmlSimpleFloat.prototype.GetContentParent=function(){return this._contentElement};
AdfDhtmlSimpleFloat.prototype.GetAnimationDurationSkinProperty=function(){var a=this._getContainedComponentPeer();AdfAssert.assertPrototype(a,AdfRichUIPeer);return a.getAnimationDurationSkinProperty()};AdfDhtmlSimpleFloat.prototype.GetAnimateSkinProperty=function(){var a=this._getContainedComponentPeer();AdfAssert.assertPrototype(a,AdfRichUIPeer);return a.getAnimateSkinProperty()};AdfDhtmlSimpleFloat.prototype.ShouldHideOnClip=function(){return!1};
AdfDhtmlSimpleFloat.prototype.handleComponentRemoved=function(){this._bindInited&&(AdfDhtmlShadowDecorator.removeShadowDecorator(this.getShadowAnchor()),this._repositionable&&(this._repositionable.destroy(),delete this._repositionable))};
AdfDhtmlSimpleFloat.prototype.handleBindToComponent=function(){if(!this._repositionable){this.setShadowAnchor(this._getMainElement(this.getContent()));var a=!this.isAnimating();a&&this.CreateShadow(a);if(a=AdfPage.PAGE.findComponent(this._containedComponentId)){var b=a.getPeer();b.bind(a);this.setDragElement(b.getDragElement());this.initializeRepositionable()}}};
AdfDhtmlSimpleFloat.prototype.initializeRepositionable=function(){if(!this._repositionable){var a=this._repositionable=new AdfRepositionable(this,this._dragElement);a.setDragStartHandler(this._dragStartHandler);a.setDragEndHandler(this._dragEndHandler)}};AdfDhtmlSimpleFloat.prototype.HandleEscapeKey=function(a){var b=this._getContainedComponentPeer();b&&b.handleEscapeKey?b.handleEscapeKey(a):AdfDhtmlSimpleFloat.superclass.HandleEscapeKey.call(this.event)};
AdfDhtmlSimpleFloat.prototype.DoShow=function(a){this._bindInited||(this._bindInited=!0,this.handleBindToComponent());this.setDragElement(a[AdfDhtmlPopupHints.DRAG_ELEMENT]);this.setModal(a[AdfDhtmlPopupHints.MODAL]);var b=AdfDhtmlDialogManager.getInstance();b.registerDialog(this);var d=a[AdfDhtmlPopupHints.LEFT_POSITION];d&&isNaN(d)&&(d=parseFloat(d));this._leftPercentage=d;(d=a[AdfDhtmlPopupHints.TOP_POSITION])&&isNaN(d)&&(d=parseFloat(d));this._topPercentage=d;AdfDhtmlSimpleFloat.superclass.DoShow.call(this,
a);this._dragElement&&this.initializeRepositionable();(d=this._modal)&&AdfPage.PAGE.getModalityManager().pushModal(this.getElement());a[AdfDhtmlPopupHints.FOCUS]&&b.activateDialog(this);d&&a[AdfDhtmlPopupHints.RESTORE_IMMEDIATE]&&AdfDhtmlSimpleFloat._isMessageDialogVisible()&&(a=this.getZorderScope(),AdfDhtmlPopupHints.ZORDER_SCOPE_BODY!=a&&AdfPage.PAGE.showMessages())};
AdfDhtmlSimpleFloat.prototype.show=function(a){if(a&&a[AdfRichPopup.HINT_TAIL]&&a[AdfRichPopup.HINT_TAIL]!=AdfRichPopup.TAIL_NONE){var b=this.getInitialPopupTailPosition(a[AdfDhtmlPopupHints.ALIGN]);this._tailPosition=b;AdfDomUtils.addCSSClassName(this._tailElement,b);b=a[AdfRichPopup.HINT_TAIL].charAt(0).toUpperCase()+a[AdfRichPopup.HINT_TAIL].substring(1);AdfDomUtils.addCSSClassName(this.getElement(),"AFDialogTail"+b)}else this._tailElement=null;AdfDhtmlSimpleFloat.superclass.show.call(this,a)};
AdfDhtmlSimpleFloat._isMessageDialogVisible=function(){var a=AdfPage.PAGE,b=a.getDefaultMessageHandlerComponentId(),a=a.findComponent(b),a=a.getPeer().getAllPopups(a),b=0;for(i in a)b++;return 0<b};AdfDhtmlSimpleFloat.prototype.destroy=function(){AdfDhtmlDialogManager.getInstance().unregisterDialog(this);var a=AdfPage.PAGE;this._modal&&a.getModalityManager().popModal(this.getElement());this._repositionable&&(this._repositionable.destroy(),delete this._repositionable);AdfDhtmlSimpleFloat.superclass.destroy.call(this)};
AdfDhtmlSimpleFloat.prototype._getContainedComponentPeer=function(){var a=null;if(null!=this._containedComponentId){var b=AdfPage.PAGE.findComponent(this._containedComponentId);null!=b&&(a=b.getPeer(),a.bind(b))}return a};AdfDhtmlSimpleFloat.prototype._getContainedComponentDomElement=function(){var a=this._getContainedComponentPeer();return null!=a?a.getDomElement():null};
AdfDhtmlSimpleFloat.prototype._dragStartHandler=function(){var a=this._getContainedComponentDomElement();AdfDomUtils.addCSSClassName(a,AdfDhtmlSimpleFloat._DRAG_STYLECLASS);AdfDhtmlShadowDecorator.hasShadowDecorator(this.getShadowAnchor())&&AdfDhtmlShadowDecorator.showShadowDecorator(this.getShadowAnchor(),!1);this._isDragging=!0;this.getAlignElement()&&(this.setAlignElement(null),this.Position(AdfRichPopup.ALIGN_OVERLAP))};
AdfDhtmlSimpleFloat.prototype._dragEndHandler=function(){var a=this._getContainedComponentDomElement();AdfDomUtils.removeCSSClassName(a,AdfDhtmlSimpleFloat._DRAG_STYLECLASS);AdfDhtmlShadowDecorator.hasShadowDecorator(this.getShadowAnchor())&&AdfDhtmlShadowDecorator.showShadowDecorator(this.getShadowAnchor(),!0);delete this._isDragging;this.setPosition(this.getTop(),this.getLeft())};
AdfDhtmlSimpleFloat.prototype.handleActivate=function(a){var b=AdfDhtmlDialogManager.getInstance();return b.getActiveDialog()==this?!1:b.activateDialog(this)?(a&&this.FocusOnFirstElement(),!0):!1};AdfDhtmlSimpleFloat.prototype.isAnimating=function(){return this._isDragging?!0:AdfDhtmlSimpleFloat.superclass.isAnimating.call(this)};AdfDhtmlSimpleFloat.prototype.setDragging=function(a){this._isDragging=a};
AdfDhtmlSimpleFloat.prototype.setShadowVisibility=function(a){var b=this.getShadowAnchor();a?AdfDhtmlShadowDecorator.hasShadowDecorator(b)||AdfDhtmlShadowDecorator.createShadowDecorator(b,this.getElement().parentNode):AdfDhtmlShadowDecorator.hasShadowDecorator(b)&&AdfDhtmlShadowDecorator.removeShadowDecorator(this.getShadowAnchor())};
AdfDhtmlSimpleFloat.prototype.getAlignPosition=function(){if(this.getAlignElement())return null;var a=AdfAgent.AGENT,b=AdfPage.PAGE.getLocaleContext().isRightToLeft(),d=a.getWindowHeight(),e=a.getWindowWidth(),f=a.getBrowserViewportScrollTop(),g=a.getBrowserViewportScrollLeft();0<f&&a.getPlatform()==AdfAgent.GECKO_PLATFORM&&(d=Math.min(d,a.getDomDocument().body.clientHeight));var a=this.getWidth(),h=this.getHeight(),k=this._topPercentage,l=this._leftPercentage;l||(l=.5);k||(k=.5);b=b?-1:1;k=Math.max(0,
Math.round(d*k-h/2))+f;l=Math.max(0,Math.round(e*l-a/2*b))+b*g;d=d+f-(k+h);0>d&&(k=Math.max(f,k+d));e=e+g-(l+b*a);0>e&&(l=Math.max(g,l+e));g={y:k,x:l};this.setAlignPosition(g);return g};
AdfDhtmlSimpleFloat.prototype.setPosition=function(a,b){if(this.getAlignElement())AdfDhtmlSimpleFloat.superclass.setPosition.call(this,a,b);else if(this.isAnimating()){var d=AdfAgent.AGENT,e=d.getWindowHeight(),f=d.getWindowWidth(),g=d.getBrowserViewportScrollTop(),h=d.getBrowserViewportScrollLeft();0<g&&d.getPlatform()==AdfAgent.GECKO_PLATFORM&&(e=Math.min(e,d.getDomDocument().body.clientHeight));var k=this.getHeight(),d=this.getWidth(),l=0;e>k&&(l=(a-g+k/2)/e);e=0;f>d&&(e=(b-h+d/2)/f);!isNaN(l)&&
!isNaN(e)&&1>l&&1>e&&(this._topPercentage=l,this._leftPercentage=e,AdfDhtmlSimpleFloat.superclass.setPosition.call(this,0==l?g:a,0==e?h:b))}else f=this.getPopupClientId(),AdfAssert.assertString(f),(f=AdfPage.PAGE.findComponent(f))&&f instanceof AdfRichPopup&&(g={},g[AdfDhtmlPopupHints.LEFT_POSITION]=this._leftPercentage,g[AdfDhtmlPopupHints.TOP_POSITION]=this._topPercentage,g[AdfRichPopup.HINT_ALIGN]=AdfRichPopup.ALIGN_OVERLAP,g[AdfRichPopup.HINT_ALIGN_ID]="",f.getPeer().syncPrivateProperties(f,g,
!0)),AdfDhtmlSimpleFloat.superclass.setPosition.call(this,a,b)};AdfDhtmlSimpleFloat.prototype.getFirstTabStop=function(){return this.GetFocusContent()};