Type.registerNamespace("Sys.Extended.UI"),Sys.Extended.UI.ModalPopupRepositionMode=function(){throw Error.invalidOperation()},Sys.Extended.UI.ModalPopupRepositionMode.prototype={None:0,RepositionOnWindowResize:1,RepositionOnWindowScroll:2,RepositionOnWindowResizeAndScroll:3},Sys.Extended.UI.ModalPopupRepositionMode.registerEnum("Sys.Extended.UI.ModalPopupRepositionMode"),Sys.Extended.UI.ModalPopupBehavior=function(e){Sys.Extended.UI.ModalPopupBehavior.initializeBase(this,[e]),this._popupControlID=null,this._popupDragHandleControlID=null,this._backgroundCssClass=null,this._dropShadow=!1,this._drag=!1,this._okControlID=null,this._cancelControlID=null,this._onOkScript=null,this._onCancelScript=null,this._xCoordinate=-1,this._yCoordinate=-1,this._repositionMode=Sys.Extended.UI.ModalPopupRepositionMode.RepositionOnWindowResizeAndScroll,this._onShown=new Sys.Extended.UI.Animation.GenericAnimationBehavior(e),this._onHidden=new Sys.Extended.UI.Animation.GenericAnimationBehavior(e),this._onShowing=new Sys.Extended.UI.Animation.GenericAnimationBehavior(e),this._onHiding=new Sys.Extended.UI.Animation.GenericAnimationBehavior(e),this._backgroundElement=null,this._foregroundElement=null,this._relativeOrAbsoluteParentElement=null,this._popupElement=null,this._dragHandleElement=null,this._showHandler=null,this._okHandler=null,this._cancelHandler=null,this._scrollHandler=null,this._resizeHandler=null,this._windowHandlersAttached=!1,this._dropShadowBehavior=null,this._dragBehavior=null,this._isIE6=!1,this._saveTabIndexes=new Array,this._saveDesableSelect=new Array,this._tagWithTabIndex=new Array("A","AREA","BUTTON","INPUT","OBJECT","SELECT","TEXTAREA","IFRAME"),this._isAnimationJustEnded=!1,this._hidingAnimationEndedHandler=null,this._showingAnimationEndedHandler=null},Sys.Extended.UI.ModalPopupBehavior.prototype={initialize:function(){Sys.Extended.UI.ModalPopupBehavior.callBaseMethod(this,"initialize"),this._isIE6=Sys.Browser.agent==Sys.Browser.InternetExplorer&&Sys.Browser.version<7,this._popupDragHandleControlID&&(this._dragHandleElement=$get(this._popupDragHandleControlID)),this._popupElement=$get(this._popupControlID),this._createDomElements(),this._showHandler=Function.createDelegate(this,this._onShow),$addHandler(this.get_element(),"click",this._showHandler),this._okControlID&&(this._okHandler=Function.createDelegate(this,this._onOk),$addHandler($get(this._okControlID),"click",this._okHandler)),this._cancelControlID&&(this._cancelHandler=Function.createDelegate(this,this._onCancel),$addHandler($get(this._cancelControlID),"click",this._cancelHandler)),this._scrollHandler=Function.createDelegate(this,this._onLayout),this._resizeHandler=Function.createDelegate(this,this._onLayout),this.registerPartialUpdateEvents(),this._resetAnimationsTarget(),this._onHiding.get_animation()&&(this._hidingAnimationEndedHandler=Function.createDelegate(this,function(){this._isAnimationJustEnded=!0,this.hide()}),this._onHiding.get_animation().add_ended(this._hidingAnimationEndedHandler)),this._onShowing.get_animation()&&(this._showingAnimationEndedHandler=Function.createDelegate(this,function(){this._isAnimationJustEnded=!0,this.show()}),this._onShowing.get_animation().add_ended(this._showingAnimationEndedHandler))},dispose:function(){this._hideImplementation(),this._foregroundElement&&this._foregroundElement.parentNode&&(this._foregroundElement.parentNode.removeChild(this._backgroundElement),this._dropShadow&&(this._foregroundElement.parentNode.appendChild(this._popupElement),this._foregroundElement.parentNode.removeChild(this._foregroundElement))),this._scrollHandler=null,this._resizeHandler=null,this._cancelHandler&&$get(this._cancelControlID)&&($removeHandler($get(this._cancelControlID),"click",this._cancelHandler),this._cancelHandler=null),this._okHandler&&$get(this._okControlID)&&($removeHandler($get(this._okControlID),"click",this._okHandler),this._okHandler=null),this._showHandler&&($removeHandler(this.get_element(),"click",this._showHandler),this._showHandler=null),this._hidingAnimationEndedHandler&&this._onHiding.get_animation().remove_ended(this._hidingAnimationEndedHandler),this._showingAnimationEndedHandler&&this._onShowing.get_animation().remove_ended(this._showingAnimationEndedHandler),Sys.Extended.UI.ModalPopupBehavior.callBaseMethod(this,"dispose")},_createDomElements:function(){this._dropShadow?(this._foregroundElement=document.createElement("div"),this._foregroundElement.id=this.get_id()+"_foregroundElement",this._popupElement.parentNode.appendChild(this._foregroundElement),this._foregroundElement.appendChild(this._popupElement)):this._foregroundElement=this._popupElement,this._backgroundElement=document.createElement("div"),this._backgroundElement.setAttribute("data-act-control-type","modalPopupBackground"),this._backgroundElement.id=this.get_id()+"_backgroundElement",this._backgroundElement.style.display="none",this._backgroundElement.style.position="fixed",this._backgroundElement.style.left="0px",this._backgroundElement.style.top="0px",this._backgroundCssClass&&(this._backgroundElement.className=this._backgroundCssClass),this._foregroundElement.parentNode.appendChild(this._backgroundElement),this._foregroundElement.style.display="none",this._foregroundElement.style.position="fixed",this._setZIndex()},_setZIndex:function(){var e=parseInt(this._findTopModalPopupBackgroundZIndex());this._backgroundElement.style.zIndex=e?parseInt(e+1):parseInt(Sys.Extended.UI.zIndex.ModalPopupBackground),this._foregroundElement.style.zIndex=parseInt($common.getCurrentStyle(this._backgroundElement,"zIndex",this._backgroundElement.style.zIndex))+1},_findTopModalPopupBackgroundZIndex:function(){var e=this._getLastPopup();return e?e._backgroundElement.style.zIndex:void 0},_getLastPopup:function(){var e=Sys.Extended.UI.ModalPopupBehavior.popups;return e.length?e[e.length-1]:void 0},_attachPopup:function(){Sys.Extended.UI.ModalPopupBehavior.popups.push(this),this._dropShadow&&!this._dropShadowBehavior&&(this._dropShadowBehavior=$create(Sys.Extended.UI.DropShadowBehavior,{},null,null,this._popupElement)),this._dragHandleElement&&!this._dragBehavior&&(this._dragBehavior=$create(Sys.Extended.UI.FloatingBehavior,{handle:this._dragHandleElement},null,null,this._foregroundElement)),$addHandler(window,"resize",this._resizeHandler),$addHandler(window,"scroll",this._scrollHandler),this._windowHandlersAttached=!0},_detachPopup:function(){this._windowHandlersAttached&&(this._scrollHandler&&$removeHandler(window,"scroll",this._scrollHandler),this._resizeHandler&&$removeHandler(window,"resize",this._resizeHandler),this._windowHandlersAttached=!1),this._dragBehavior&&(this._dragBehavior.dispose(),this._dragBehavior=null),this._dropShadowBehavior&&(this._dropShadowBehavior.dispose(),this._dropShadowBehavior=null),this._getLastPopup()==this&&Sys.Extended.UI.ModalPopupBehavior.popups.pop()},_onShow:function(e){if(!this.get_element().disabled)return this.show(),e.preventDefault(),!1},_onOk:function(e){var t=$get(this._okControlID);if(t&&!t.disabled)return this.hide()&&this._onOkScript&&window.setTimeout(this._onOkScript,0),e.preventDefault(),!1},_onCancel:function(e){var t=$get(this._cancelControlID);if(t&&!t.disabled)return this.hide()&&this._onCancelScript&&window.setTimeout(this._onCancelScript,0),e.preventDefault(),!1},_onLayout:function(e){var t=this.get_repositionMode();(t!==Sys.Extended.UI.ModalPopupRepositionMode.RepositionOnWindowScroll&&t!==Sys.Extended.UI.ModalPopupRepositionMode.RepositionOnWindowResizeAndScroll||"scroll"!==e.type)&&(t!==Sys.Extended.UI.ModalPopupRepositionMode.RepositionOnWindowResize&&t!==Sys.Extended.UI.ModalPopupRepositionMode.RepositionOnWindowResizeAndScroll||"resize"!==e.type)?this._layoutBackgroundElement():this._layout()},show:function(){if(this._isAnimationJustEnded)this._isAnimationJustEnded=!1;else{var e=new Sys.CancelEventArgs;if(this.raise_showing(e),e.get_cancel())return;if(this._onShowing.get_animation())return void this._onShowing.play()}if(this.populate(),this._attachPopup(),this._setZIndex(),this._backgroundElement.style.display="",this._foregroundElement.style.display="",this._popupElement.style.display="",this._isIE6){this._foregroundElement.style.position="absolute",this._backgroundElement.style.position="absolute";for(var t=this._foregroundElement.parentNode;t&&t!=document.documentElement;){if("relative"==t.style.position||"absolute"==t.style.position){this._relativeOrAbsoluteParentElement=t;break}t=t.parentNode}}this.disableTab(),this._layout(),this._layout(),this.raise_shown(Sys.EventArgs.Empty),this._onShown.play()},disableTab:function(){var e,t=0,n=new Array;Array.clear(this._saveTabIndexes);for(var o=0;o