text: Type.registerNamespace("Sys.Extended.UI"),Sys.Extended.UI.BalloonPopupControlBehavior=function(e){Sys.Extended.UI.BalloonPopupControlBehavior.initializeBase(this,[e]),this._balloonPopupControlID=null,this._position=Sys.Extended.UI.BalloonPopupPosition.Auto,this._balloonStyle=Sys.Extended.UI.BalloonPopupStyle.Rectangle,this._offsetX=0,this._offsetY=0,this._extenderControlID=null,this._displayOnMouseOver=!1,this._displayOnFocus=!1,this._displayOnClick=!0,this._balloonSize="small",this._shadow=!0,this._scrollBars=Sys.Extended.UI.ScrollBars.Auto,this._popupElement=null,this._styleElement=null,this._sizeElement=null,this._shadowElement=null,this._directionElement=null,this._contentElement=null,this._popupBehavior=null,this._popupVisible=!1,this._focusHandler=null,this._mouseOverHandler=null,this._clickHandler=null,this._popupClickHandler=null,this._bodyClickHandler=null,this._onShowJson=null,this._onHideJson=null,this._popupWidth=0,this._popupHeight=0,this._AutoPosition=null,this._directionClassName=null},Sys.Extended.UI.BalloonPopupControlBehavior.prototype={initialize:function(){Sys.Extended.UI.BalloonPopupControlBehavior.callBaseMethod(this,"initialize");var e=this.get_element();this.createPopupElement(),this._popupBehavior=$create(Sys.Extended.UI.PopupBehavior,{id:this.get_id()+"BalloonPopupBehavior",parentElement:e},null,null,this._popupElement),this._onShowJson&&this._popupBehavior.set_onShow(this._onShowJson),this._onHideJson&&this._popupBehavior.set_onHide(this._onHideJson),this._displayOnFocus&&(this._focusHandler=Function.createDelegate(this,this._onFocus)),this._displayOnMouseOver&&(this._mouseOverHandler=Function.createDelegate(this,this._onMouseOver)),this._displayOnClick&&(this._clickHandler=Function.createDelegate(this,this._onFocus)),this._popupClickHandler=Function.createDelegate(this,this._onPopupClick),this._bodyClickHandler=Function.createDelegate(this,this._onBodyClick),this._displayOnFocus&&$addHandler(e,"focus",this._focusHandler),this._displayOnMouseOver&&$addHandler(e,"mouseover",this._mouseOverHandler),this._displayOnClick&&$addHandler(e,"click",this._clickHandler),$addHandler(document,"click",this._bodyClickHandler),$addHandler(this._popupElement,"click",this._popupClickHandler)},dispose:function(){var e=this.get_element();this._onShowJson=null,this._onHideJson=null,this._popupBehavior&&(this._popupBehavior.dispose(),this._popupBehavior=null),this._focusHandler&&($removeHandler(e,"focus",this._focusHandler),this._focusHandler=null),this._mouseOverHandler&&($removeHandler(e,"mouseover",this._mouseOverHandler),this._mouseOverHandler=null),this._clickHandler&&($removeHandler(e,"click",this._clickHandler),this._clickHandler=null),this._bodyClickHandler&&($removeHandler(document,"click",this._bodyClickHandler),this._bodyClickHandler=null),this._popupClickHandler&&($removeHandler(this._popupElement,"click",this._popupClickHandler),this._popupClickHandler=null),Sys.Extended.UI.BalloonPopupControlBehavior.callBaseMethod(this,"dispose")},createPopupElement:function(){var e=this.get_element();if(this._popupElement=$common.createElementFromTemplate({nodeName:"div",properties:{id:this.get_id()+"_balloonPopup",style:{display:"block",position:"absolute"}},cssClasses:["ajax__balloon_popup"]},e.parentNode),this._styleElement=$common.createElementFromTemplate({nodeName:"span",Properties:{id:"ajax__style_wrapper"}},this._popupElement),this._sizeElement=$common.createElementFromTemplate({nodeName:"span",Properties:{id:"ajax__size_wrapper"}},this._styleElement),this._shadowElement=$common.createElementFromTemplate({nodeName:"div",Properties:{id:"ajax__shadow_wrapper"}},this._sizeElement),this._directionElement=$common.createElementFromTemplate({nodeName:"div",Properties:{id:"ajax__direction_wrapper"}},this._shadowElement),this._contentElement=$common.createElementFromTemplate({nodeName:"div",Properties:{id:"ajax__content"},cssClasses:["ajax__content"]},this._directionElement),null==$get(this._balloonPopupControlID))throw"Referred BalloonPopupControlId did not find.";$get(this._balloonPopupControlID).style.display="none",this.setStyle(),this.setSize(),this._directionElement.className=this._directionClassName,this._popupWidth=this._directionElement.offsetWidth,this._popupHeight=this._directionElement.offsetHeight,this.get_balloonPopupPosition()!=Sys.Extended.UI.BalloonPopupPosition.Auto&&(this.setPosition(),this.setContentPadding(),this.setScrollBar())},setStyle:function(){switch(this.get_balloonPopupStyle()){case Sys.Extended.UI.BalloonPopupStyle.Rectangle:this._styleElement.className="rect",this._directionClassName="rect";break;case Sys.Extended.UI.BalloonPopupStyle.Cloud:this._styleElement.className="cloud",this._directionClassName="cloud";break;case Sys.Extended.UI.BalloonPopupStyle.Custom:this._styleElement.className=this.get_customClassName(),this._directionClassName=this.get_customClassName();break;default:this._styleElement.className="rect",this._directionClassName="rect"}},setSize:function(){switch(this.get_balloonSize()){case Sys.Extended.UI.BalloonPopupSize.Small:this._sizeElement.className+=" small",this._directionClassName+=" small";break;case Sys.Extended.UI.BalloonPopupSize.Medium:this._sizeElement.className+=" medium",this._directionClassName+=" medium";break;case Sys.Extended.UI.BalloonPopupSize.Large:this._sizeElement.className+=" large",this._directionClassName+=" large";break;default:this._sizeElement.className+=" small",this._directionClassName+=" small"}},setPosition:function(){var e=null;switch(e=this.get_balloonPopupPosition()==Sys.Extended.UI.BalloonPopupPosition.Auto?this._autoPosition:this.get_balloonPopupPosition()){case Sys.Extended.UI.BalloonPopupPosition.TopLeft:this._directionElement.className=this._directionClassName+" top_left",this._shadowElement.className=this._directionClassName+" top_left_shadow";break;case Sys.Extended.UI.BalloonPopupPosition.TopRight:this._directionElement.className=this._directionClassName+" top_right",this._shadowElement.className=this._directionClassName+" top_right_shadow";break;case Sys.Extended.UI.BalloonPopupPosition.BottomLeft:this._directionElement.className=this._directionClassName+" bottom_left",this._shadowElement.className=this._directionClassName+" bottom_left_shadow";break;case Sys.Extended.UI.BalloonPopupPosition.BottomRight:this._directionElement.className=this._directionClassName+" bottom_right",this._shadowElement.className=this._directionClassName+" bottom_right_shadow";break;default:this._directionElement.className=this._directionClassName+" top_right",this._shadowElement.className=this._directionClassName+" top_right_shadow"}},setContentPadding:function(){var e=$common.getPaddingBox(this._contentElement),o=$get(this._balloonPopupControlID);$common.setBounds(o,{x:this._offsetX+e.left,y:this._offsetY+e.top,width:this._popupWidth-e.left-e.right,height:this._popupHeight-e.top-e.bottom})},setScrollBar:function(){var e=$get(this._balloonPopupControlID);switch(this.get_scrollBars()){case Sys.Extended.UI.ScrollBars.Horizontal:$common.setStyle(e,{overflowX:"scroll",overflowY:"hidden"});break;case Sys.Extended.UI.ScrollBars.Vertical:$common.setStyle(e,{overflowY:"scroll",overflowX:"hidden"});break;case Sys.Extended.UI.ScrollBars.Both:$common.setStyle(e,{overflow:"scroll"});break;case Sys.Extended.UI.ScrollBars.None:$common.setStyle(e,{overflow:"hidden"});break;default:$common.setStyle(e,{overflow:"auto"})}},showPopup:function(){this._contentElement.appendChild($get(this._balloonPopupControlID)),$get(this._balloonPopupControlID).style.display="block",Sys.Extended.UI.BalloonPopupPosition.Auto==this._position&&(this._setAutoPosition(),this.setPosition(),this.setContentPadding(),this.setScrollBar()),this._shadow||(this._shadowElement.className="");var e=Sys.Extended.UI.BalloonPopupControlBehavior.__VisiblePopup;e&&e._popupBehavior&&e.hidePopup(),Sys.Extended.UI.BalloonPopupControlBehavior.callBaseMethod(this,"populate"),this._popupBehavior.set_x(this._getLeftOffset()),this._popupBehavior.set_y(this._getTopOffset()),this._popupBehavior.show(),this._popupVisible=!0,Sys.Extended.UI.BalloonPopupControlBehavior.__VisiblePopup=this;var o=$common.getCurrentStyle(this._directionElement,"backgroundPositionX"),t=$common.getCurrentStyle(this._directionElement,"backgroundPositionY");$common.setStyle(this._styleElement,{backgroundPositionX:o,backgroundPositionY:t})},hidePopup:function(){this._popupBehavior.hide(),this._popupVisible=!1,Sys.Extended.UI.BalloonPopupControlBehavior.__VisiblePopup=null},_onFocus:function(e){this._popupVisible||this.showPopup(),e&&e.stopPropagation()},_onMouseOver:function(e){this._popupVisible||this.showPopup(),e&&e.stopPropagation()},_onPopupClick:function(e){e.stopPropagation()},_onBodyClick:function(){this._popupVisible&&this.hidePopup()},_onPopulated:function(e,o){Sys.Extended.UI.BalloonPopupControlBehavior.callBaseMethod(this,"_onPopulated",[e,o]),this._popupVisible&&this._popupBehavior.show()},_getLeftOffset:function(){var e=0,o=Sys.Extended.UI.BalloonPopupPosition.Auto==this._position?this._autoPosition:this._position;return e=Sys.Extended.UI.BalloonPopupPosition.BottomLeft==o||Sys.Extended.UI.BalloonPopupPosition.TopLeft==o?-1*this._popupWidth+this._offsetX:Sys.Extended.UI.BalloonPopupPosition.BottomRight==o||Sys.Extended.UI.BalloonPopupPosition.TopRight==o?this.get_element().offsetWidth+this._offsetX:this._offsetX},_getTopOffset:function(){var e=0,o=Sys.Extended.UI.BalloonPopupPosition.Auto==this._position?this._autoPosition:this._position;return e=Sys.Extended.UI.BalloonPopupPosition.TopLeft==o||Sys.Extended.UI.BalloonPopupPosition.TopRight==o?-1*this._popupHeight+this._offsetY:Sys.Extended.UI.BalloonPopupPosition.BottomLeft==o||Sys.Extended.UI.BalloonPopupPosition.BottomRight==o?this.get_element().offsetHeight+this._offsetY:this._offsetY},_setAutoPosition:function(){var e=0,o=0,t=this.get_element();if(t.offsetParent)do o+=t.offsetLeft,e+=t.offsetTop,t=t.offsetParent;while(t);var i=this.posTop(),s=this.posLeft(),n=this.pageWidth(),l=this.pageHeight(),a=i+l,p=s+n,h=e-this._popupHeight,r=(o-this._popupWidth,e+this.get_element().offsetHeight+this._popupHeight),d=o+this.get_element().offsetWidth+this._popupWidth;h-i>0&&h-i>a-r?p<d?this._autoPosition=Sys.Extended.UI.BalloonPopupPosition.TopLeft:this._autoPosition=Sys.Extended.UI.BalloonPopupPosition.TopRight:p<d?this._autoPosition=Sys.Extended.UI.BalloonPopupPosition.BottomLeft:this._autoPosition=Sys.Extended.UI.BalloonPopupPosition.BottomRight},get_onShow:function(){return this._popupBehavior?this._popupBehavior.get_onShow():this._onShowJson},set_onShow:function(e){this._popupBehavior?this._popupBehavior.set_onShow(e):this._onShowJson=e,this.raisePropertyChanged("onShow")},get_onShowBehavior:function(){return this._popupBehavior?this._popupBehavior.get_onShowBehavior():null},onShow:function(){this._popupBehavior&&this._popupBehavior.onShow()},get_onHide:function(){return this._popupBehavior?this._popupBehavior.get_onHide():this._onHideJson},set_onHide:function(e){this._popupBehavior?this._popupBehavior.set_onHide(e):this._onHideJson=e,this.raisePropertyChanged("onHide")},get_onHideBehavior:function(){return this._popupBehavior?this._popupBehavior.get_onHideBehavior():null},onHide:function(){this._popupBehavior&&this._popupBehavior.onHide()},get_balloonPopupControlID:function(){return this._balloonPopupControlID},set_balloonPopupControlID:function(e){this._balloonPopupControlID!=e&&(this._balloonPopupControlID=e,this.raisePropertyChanged("balloonPopupControlID"))},get_BalloonPopupControlID:function(){return Sys.Extended.Deprecated("get_BalloonPopupControlID","get_balloonPopupControlID"),this.get_balloonPopupControlID()},set_BalloonPopupControlID:function(e){Sys.Extended.Deprecated("set_BalloonPopupControlID","set_balloonPopupControlID"),this.set_balloonPopupControlID(e)},get_balloonPopupPosition:function(){return this._position},set_balloonPopupPosition:function(e){this._position!=e&&(this._position=e,this.raisePropertyChanged("Position"))},get_balloonPopupStyle:function(){return this._balloonStyle},set_balloonPopupStyle:function(e){this._balloonStyle!=e&&(this._balloonStyle=e,this.raisePropertyChanged("balloonStyle"))},get_extenderControlID:function(){return this._extenderControlID},set_extenderControlID:function(e){this._extenderControlID!=e&&(this._extenderControlID=e,this.raisePropertyChanged("extenderControlID"))},get_ExtenderControlID:function(){return Sys.Extended.Deprecated("get_ExtenderControlID","get_extenderControlID"),this.get_extenderControlID()},set_ExtenderControlID:function(e){Sys.Extended.Deprecated("set_ExtenderControlID","set_extenderControlID"),this.set_extenderControlID(e)},get_offsetX:function(){return this._offsetX},set_offsetX:function(e){this._offsetX!=e&&(this._offsetX=e,this.raisePropertyChanged("offsetX"))},get_OffsetX:function(){return Sys.Extended.Deprecated("get_OffsetX","get_offsetX"),this.get_offsetX()},set_OffsetX:function(e){Sys.Extended.Deprecated("set_OffsetX","set_offsetX"),this.set_offsetX(e)},get_offsetY:function(){return this._offsetY},set_offsetY:function(e){this._offsetY!=e&&(this._offsetY=e,this.raisePropertyChanged("offsetY"))},get_OffsetY:function(){return Sys.Extended.Deprecated("get_OffsetY","get_offsetY"),this.get_offsetY()},set_OffsetY:function(e){Sys.Extended.Deprecated("set_OffsetY","set_offsetY"),this.set_offsetY(e)},get_displayOnMouseOver:function(){return this._displayOnMouseOver},set_displayOnMouseOver:function(e){this._displayOnMouseOver!=e&&(this._displayOnMouseOver=e,this.raisePropertyChanged("displayOnMouseOver"))},get_displayOnFocus:function(){return this._displayOnFocus},set_displayOnFocus:function(e){this._displayOnFocus!=e&&(this._displayOnFocus=e,this.raisePropertyChanged("displayOnFocus"))},get_displayOnClick:function(){return this._displayOnClick},set_displayOnClick:function(e){this._displayOnClick!=e&&(this._displayOnClick=e,this.raisePropertyChanged("displayOnClick"))},get_balloonSize:function(){return this._balloonSize},set_balloonSize:function(e){this._balloonSize!=e&&(this._balloonSize=e,this.raisePropertyChanged("balloonSize"))},get_useShadow:function(){return this._shadow},set_useShadow:function(e){this._shadow!=e&&(this._shadow=e,this.raisePropertyChanged("useShadow"))},get_scrollBars:function(){return this._scrollBars},set_scrollBars:function(e){this._scrollBars!=e&&(this._scrollBars=e,this.raisePropertyChanged("scrollBars"))},get_popupVisible:function(){return this._popupVisible},get_PopupVisible:function(){return Sys.Extended.Deprecated("get_PopupVisible","get_popupVisible"),this.get_popupVisible()},get_customClassName:function(){return this._customClassName},set_customClassName:function(e){this._customClassName!=e&&(this._customClassName=e,this.raisePropertyChanged("customClassName"))},add_showing:function(e){this._popupBehavior&&this._popupBehavior.add_showing(e)},remove_showing:function(e){this._popupBehavior&&this._popupBehavior.remove_showing(e)},raise_showing:function(e){this._popupBehavior&&this._popupBehavior.raise_showing(e)},raiseShowing:function(e){Sys.Extended.Deprecated("raiseShowing(eventArgs)","raise_showing(eventArgs)"),this.raise_showing(e)},add_shown:function(e){this._popupBehavior&&this._popupBehavior.add_shown(e)},remove_shown:function(e){this._popupBehavior&&this._popupBehavior.remove_shown(e)},raise_shown:function(e){this._popupBehavior&&this._popupBehavior.raise_shown(e)},raiseShown:function(e){Sys.Extended.Deprecated("raiseShown(eventArgs)","raise_shown(eventArgs)"),this.raise_shown(e)},add_hiding:function(e){this._popupBehavior&&this._popupBehavior.add_hiding(e)},remove_hiding:function(e){this._popupBehavior&&this._popupBehavior.remove_hiding(e)},raise_hiding:function(e){this._popupBehavior&&this._popupBehavior.raise_hiding(e)},raiseHiding:function(e){Sys.Extended.Deprecated("raiseHiding(eventArgs)","raise_hiding(eventArgs)"),this.raise_hiding(e)},add_hidden:function(e){this._popupBehavior&&this._popupBehavior.add_hidden(e)},remove_hidden:function(e){this._popupBehavior&&this._popupBehavior.remove_hidden(e)},raise_hidden:function(e){this._popupBehavior&&this._popupBehavior.raise_hidden(e)},raiseHidden:function(e){Sys.Extended.Deprecated("raiseHidden(eventArgs)","raise_hidden(eventArgs)"),this.raise_hidden(e)},posTop:function(){var e=0;return"undefined"!=typeof window.pageYOffset?e=window.pageYOffset:document.documentElement&&document.documentElement.scrollTop?e=document.documentElement.scrollTop:document.body.scrollTop&&(e=document.body.scrollTop),e},posLeft:function(){var e=0;return"undefined"!=typeof window.pageXOffset?e=window.pageXOffset:document.documentElement&&document.documentElement.scrollLeft?e=document.documentElement.scrollLeft:document.body.scrollLeft&&(e=document.body.scrollLeft),e},pageHeight:function(){var e=null;return null!=window.innerHeight?e=window.innerHeight:document.documentElement&&document.documentElement.clientHeight?e=document.documentElement.clientHeight:null!=document.body&&(e=document.body.clientHeight),e},pageWidth:function(){var e=null;return null!=window.innerWidth?e=window.innerWidth:document.documentElement&&document.documentElement.clientWidth?e=document.documentElement.clientWidth:null!=document.body&&(e=document.body.clientWidth),e}},Sys.Extended.UI.BalloonPopupControlBehavior.registerClass("Sys.Extended.UI.BalloonPopupControlBehavior",Sys.Extended.UI.DynamicPopulateBehaviorBase),Sys.Extended.UI.BalloonPopupControlBehavior.__VisiblePopup=null,Sys.Extended.UI.BalloonPopupPosition=function(){throw Error.invalidOperation()},Sys.Extended.UI.BalloonPopupPosition.prototype={Auto:0,TopRight:1,TopLeft:2,BottomRight:3,BottomLeft:4},Sys.Extended.UI.BalloonPopupPosition.registerEnum("Sys.Extended.UI.BalloonPopupPosition",!1),Sys.Extended.UI.BalloonPopupStyle=function(){throw Error.invalidOperation()},Sys.Extended.UI.BalloonPopupStyle.prototype={Rectangle:0,Cloud:1,Custom:2},Sys.Extended.UI.BalloonPopupStyle.registerEnum("Sys.Extended.UI.BalloonPopupStyle",!1),Sys.Extended.UI.BalloonPopupSize=function(){throw Error.invalidOperation()},Sys.Extended.UI.BalloonPopupSize.prototype={Small:0,Medium:1,Large:2},Sys.Extended.UI.BalloonPopupSize.registerEnum("Sys.Extended.UI.BalloonPopupSize",!1);