Type.registerNamespace("Sys.Extended.UI"),Sys.Extended.UI.BoxCorners=function(){throw Error.invalidOperation()},Sys.Extended.UI.BoxCorners.prototype={None:0,TopLeft:1,TopRight:2,BottomRight:4,BottomLeft:8,Top:3,Right:6,Bottom:12,Left:9,All:15},Sys.Extended.UI.BoxCorners.registerEnum("Sys.Extended.UI.BoxCorners",!0),Sys.Extended.UI.RoundedCornersBehavior=function(e){Sys.Extended.UI.RoundedCornersBehavior.initializeBase(this,[e]),this._corners=Sys.Extended.UI.BoxCorners.All,this._radius=5,this._color=null,this._parentDiv=null,this._originalStyle=null,this._borderColor=null,this._isDirty=!0},Sys.Extended.UI.RoundedCornersBehavior.prototype={initialize:function(){Sys.Extended.UI.RoundedCornersBehavior.callBaseMethod(this,"initialize"),this.update()},dispose:function(){this.disposeParentDiv(),Sys.Extended.UI.RoundedCornersBehavior.callBaseMethod(this,"dispose")},update:function(){var e=this.get_element();if(e&&this._isDirty&&!this.get_isUpdating())if(this.disposeParentDiv(),void 0!=e.style.borderRadius)e.style.borderRadius=this._radius+"px",this._borderColor?(e.style.border="solid",e.style.borderWidth="1px",e.style.borderColor=this._borderColor):(e.style.border="none",e.style.borderWidth="0"),this.isCornerSet(Sys.Extended.UI.BoxCorners.TopLeft)||(e.style.borderTopLeftRadius="0"),this.isCornerSet(Sys.Extended.UI.BoxCorners.BottomLeft)||(e.style.borderBottomLeftRadius="0"),this.isCornerSet(Sys.Extended.UI.BoxCorners.TopRight)||(e.style.borderTopRightRadius="0"),this.isCornerSet(Sys.Extended.UI.BoxCorners.BottomRight)||(e.style.borderBottomRightRadius="0");else if(void 0!=e.style.MozBorderRadius)e.style.MozBorderRadius=this._radius+"px",this._borderColor?(e.style.border="solid",e.style.borderWidth="1px",e.style.borderColor=this._borderColor):(e.style.border="none",e.style.borderWidth="0"),this.isCornerSet(Sys.Extended.UI.BoxCorners.TopLeft)||(e.style.MozBorderRadiusTopleft="0"),this.isCornerSet(Sys.Extended.UI.BoxCorners.BottomLeft)||(e.style.MozBorderRadiusBottomleft="0"),this.isCornerSet(Sys.Extended.UI.BoxCorners.TopRight)||(e.style.MozBorderRadiusTopright="0"),this.isCornerSet(Sys.Extended.UI.BoxCorners.BottomRight)||(e.style.MozBorderRadiusBottomright="0");else if(void 0!=e.style.WebkitBorderRadius)e.style.WebkitBorderRadius=this._radius+"px",this._borderColor?(e.style.border="solid",e.style.borderWidth="1px",e.style.borderColor=this._borderColor):(e.style.border="none",e.style.borderWidth="0"),this.isCornerSet(Sys.Extended.UI.BoxCorners.TopLeft)||(e.style.WebkitBorderRadiusTopLeft="0"),this.isCornerSet(Sys.Extended.UI.BoxCorners.BottomLeft)||(e.style.WebkitBorderRadiusBottomLeft="0"),this.isCornerSet(Sys.Extended.UI.BoxCorners.TopRight)||(e.style.WebkitBorderRadiusTopRight="0"),this.isCornerSet(Sys.Extended.UI.BoxCorners.BottomRight)||(e.style.WebkitBorderRadiusBottomRight="0");else{var t=this.getBackgroundColor(),r=e.offsetWidth,o=e.cloneNode(!1);this.moveChildren(e,o),this._originalStyle=e.style.cssText,e.style.backgroundColor="transparent",e.style.verticalAlign="top",e.style.padding="0",e.style.overflow="",e.style.className="",e.style.height&&"auto"!=e.style.height?e.style.height=parseInt($common.getCurrentStyle(e,"height"))+2*this._radius+"px":!e.style.width&&00;l--){var h=Math.acos(l/i),y=i-Math.round(Math.sin(h)*i),a=document.createElement("DIV");if(a.__roundedDiv=!0,a.style.backgroundColor=t,a.style.marginLeft=y+"px",a.style.marginRight=y-(this._borderColor?2:0)+"px",a.style.height="1px",a.style.fontSize="1px",a.style.overflow="hidden",this._borderColor){a.style.borderLeftStyle="solid",a.style.borderRightStyle="solid",a.style.borderLeftColor=this._borderColor,a.style.borderRightColor=this._borderColor;var u=Math.max(0,n-y-1);a.style.borderLeftWidth=u+1+"px",a.style.borderRightWidth=u+1+"px",l==d&&(a.__roundedDivNoBorder=!0,a.style.backgroundColor=this._borderColor)}e.insertBefore(a,s);var C=a;a=a.cloneNode(!0),a.__roundedDiv=!0,e.insertBefore(a,s);var _=a;s=a,n=y,this.isCornerSet(Sys.Extended.UI.BoxCorners.TopLeft)||(C.style.marginLeft="0",this._borderColor&&(C.style.borderLeftWidth="1px")),this.isCornerSet(Sys.Extended.UI.BoxCorners.TopRight)||(C.style.marginRight="0",this._borderColor&&(C.style.borderRightWidth="1px",C.style.marginRight="-2px")),this.isCornerSet(Sys.Extended.UI.BoxCorners.BottomLeft)||(_.style.marginLeft="0",this._borderColor&&(_.style.borderLeftWidth="1px")),this.isCornerSet(Sys.Extended.UI.BoxCorners.BottomRight)||(_.style.marginRight="0",this._borderColor&&(_.style.borderRightWidth="1px",_.style.marginRight="-2px"))}e.insertBefore(o,s),this._parentDiv=o,this._isDirty=!1}},disposeParentDiv:function(){if(this._parentDiv){for(var e=this.get_element(),t=e.childNodes,r=t.length-1;r>=0;r--){var o=t[r];if(o){o==this._parentDiv&&this.moveChildren(o,e);try{e.removeChild(o)}catch(e){}}}this._originalStyle&&(e.style.cssText=this._originalStyle,this._originalStyle=null),this._parentDiv=null}},getBackgroundColor:function(){return this._color?this._color:$common.getCurrentStyle(this.get_element(),"backgroundColor")},moveChildren:function(e,t){for(var r=0;e.hasChildNodes();){var o=e.childNodes[0];o=e.removeChild(o),t.appendChild(o),r++}return r},isCornerSet:function(e){return(this._corners&e)!=Sys.Extended.UI.BoxCorners.None},setCorner:function(e,t){t?this.set_corners(this._corners|e):this.set_corners(this._corners&~e)},get_color:function(){return this._color},set_color:function(e){e!=this._color&&(this._color=e,this._isDirty=!0,this.update(),this.raisePropertyChanged("color"))},get_Color:function(){return Sys.Extended.Deprecated("get_Color()","get_color()"),this.get_color()},set_Color:function(e){Sys.Extended.Deprecated("set_Color(value)","set_color(value)"),this.set_color(e)},get_radius:function(){return this._radius},set_radius:function(e){e!=this._radius&&(this._radius=e,this._isDirty=!0,this.update(),this.raisePropertyChanged("radius"))},get_Radius:function(){return Sys.Extended.Deprecated("get_Radius()","get_radius()"),this.get_radius()},set_Radius:function(e){Sys.Extended.Deprecated("set_Radius(value)","set_radius(value)"),this.set_radius(e)},get_corners:function(){return this._corners},set_corners:function(e){e!=this._corners&&(this._corners=e,this._isDirty=!0,this.update(),this.raisePropertyChanged("corners"))},get_Corners:function(){return Sys.Extended.Deprecated("get_Corners()","get_corners()"),this.get_corners()},set_Corners:function(e){Sys.Extended.Deprecated("set_Corners(value)","set_corners(value)"),this.set_corners(e)},get_borderColor:function(){return this._borderColor},set_borderColor:function(e){e!=this._borderColor&&(this._borderColor=e,this._isDirty=!0,this.update(),this.raisePropertyChanged("borderColor"))},get_BorderColor:function(){return Sys.Extended.Deprecated("get_BorderColor()","get_borderColor()"),this.get_borderColor()},set_BorderColor:function(e){Sys.Extended.Deprecated("set_BorderColor(value)","set_borderColor(value)"),this.set_borderColor(e)}},Sys.Extended.UI.RoundedCornersBehavior.registerClass("Sys.Extended.UI.RoundedCornersBehavior",Sys.Extended.UI.BehaviorBase);