Type.registerNamespace("rb");rb.Tooltip=function(a){rb.Tooltip.initializeBase(this,[a]);this._hoverTargets={};this._currentTarget=null;this._hoverDelay=500;this._hoverAction=null;this._side=null;this._hidden=true;this._anim=null;this._initialTarget=null;this._idCount=0;this._delegates={onHover:Function.createDelegate(this,this._onHover),onCollapsed:Function.createDelegate(this,this._onCollapsed)}};rb.Tooltip.prototype={get_hoverDelay:function(){return this._hoverDelay},set_hoverDelay:function(a){this._hoverDelay=a},get_anim:function(){return this._anim},set_anim:function(a){this._anim=a},get_initialTarget:function(){return this._initialTarget},set_initialTarget:function(a){this._initialTarget=a},addTarget:function(b,c,d){if(!b){return}if(!b.id){b.id=String.format("hoverTarget_{0}_{1}",this._id,this._idCount++)}this._hoverTargets[b.id]={ctl:b,refreshFunc:c,data:d};var a={mouseover:this._onTargetMouseOver,mouseout:this._onTargetMouseOut};$addHandlers(b,a,this)},removeTarget:function(a){if(a){$clearHandlers(a);if(a.id){delete this._hoverTargets[a.id]}}},clearTargets:function(){for(var a in this._hoverTargets){this.removeTarget(this._hoverTargets[a].ctl)}},notifyRefreshed:function(a){if(!this._currentTarget){return}if(a){if(a.id!=this._currentTarget.ctl.id){return}}this.show()},show:function(){this._position();if(this._anim){this._animate(true,this._anim.len)}else{this.get_element().style.display=""}this._hidden=false},hide:function(a){if(this._hidden){return}if(this._anim&&!a){this._position();this._animate(false,this._anim.len,this._delegates.onCollapsed)}else{this.get_element().style.display="none"}this._hidden=true},_onTargetMouseOver:function(a){this._currentTarget=this._hoverTargets[a.target.id];this._hoverAction.start()},_onTargetMouseOut:function(a){this.hide();this._currentTarget=null;this._hoverAction.cancel()},_onHover:function(){if(this._currentTarget){var a=true;if(this._currentTarget.refreshFunc){a=this._currentTarget.refreshFunc(this._currentTarget.ctl,this._currentTarget.data)}if(a){this.show()}}},_position:function(){var e=rb.Pos.getBounds(this.get_element());var f=this._currentTarget&&this._currentTarget.ctl;var b=rb.Pos.getBounds(f);var d=rb.Pos.surroundingSpace(f);var c=0;if(d.left>d.right){c=b.left-e.width;this._side="left"}else{c=b.right;this._side="right"}this.get_element().style.left=c+"px";var g=rb.Pos.viewportBounds();var a=b.top>=g.top?b.top:g.top;if((a+e.height)>g.bottom){a=g.bottom-e.height}if(a<g.top){a=g.top}this.get_element().style.top=a+"px"},_onCollapsed:function(){if(this._hidden){this.get_element().style.display="none"}},_animate:function(a,c,b){rb.dom.animate(this.get_element(),this._anim.type,this._side=="left"?rb.motion.animationDir.Left:rb.motion.animationDir.Right,a,this._anim.etype,this._anim.edir,c,this._anim.inte,null,b)},_onLoad:function(){if(this._initialTarget){this.addTarget($get(this._initialTarget))}},initialize:function(){rb.Tooltip.callBaseMethod(this,"initialize");this._hoverAction=new rb.DelayedAction(this._delegates.onHover,this._hoverDelay);this.get_element().style.position="absolute"},dispose:function(){for(id in this._hoverTargets){$clearHandlers(this._hoverTargets[id].ctl)}rb.Tooltip.callBaseMethod(this,"dispose");this._delegates=null}};rb.Tooltip.registerClass("rb.Tooltip",rb.BaseControl);if(typeof(Sys)!=="undefined"){Sys.Application.notifyScriptLoaded()};