﻿Type.registerNamespace("Telerik.Web.UI");
(function(){$telerik.toToolTip=function(tooltip){return tooltip;
};
$telerik.findToolTip=$find;
var $=$telerik.$;
var $T=Telerik.Web.UI;
$T.RadToolTipControllerClass=function(){this._tooltipToShow=null;
this._activeToolTip=null;
this._registerGlobalBodyEventHandlers();
};
$T.RadToolTipControllerClass.prototype={_registerGlobalBodyEventHandlers:function(){var escHandler=Function.createDelegate(this,function(e){if(e.keyCode==27){if(this._activeToolTip&&!this._activeToolTip.isModal()){this._hideCurrentToolTipNoAnimation();
}}});
var clickHandler=Function.createDelegate(this,function(e){this._hideOnBodyClick(e);
});
Sys.Application.add_init(function(){$addHandler(document.body,"keydown",escHandler);
$addHandler(document.body,"click",clickHandler);
});
Sys.Application.add_unload(function(){$removeHandler(document.body,"keydown",escHandler);
$removeHandler(document.body,"click",clickHandler);
});
},_hideOnBodyClick:function(e){var wasHidden=false;
if(this._activeToolTip!=null&&!this._activeToolTip.isModal()){var tooltip=this._activeToolTip;
if($telerik.isMouseOverElementEx(tooltip._tableElement,e)){return;
}wasHidden=this._activeToolTip._hideIfNotManualCloseOrFromCode();
}if(wasHidden){this._activeToolTip=null;
}},_cancelLastShowRequest:function(){if(this._tooltipToShow){var tooltip=this._tooltipToShow;
this._tooltipToShow=null;
tooltip.cancelShowDelay();
}},_hideCurrentToolTipNoAnimation:function(){this._cancelLastShowRequest();
if(this._activeToolTip!=null){this._activeToolTip._hideNoAnimation();
}this._activeToolTip=null;
},requestShow:function(newToolTip){this._cancelLastShowRequest();
var active=this._activeToolTip;
if(active==newToolTip){return;
}else{if(active){active._hideIfNotManualCloseOrFromCode();
}}this._tooltipToShow=newToolTip;
},cancelSpecificShowRequest:function(tooltip){if(this._tooltipToShow==tooltip){this._cancelLastShowRequest();
}},showTooltip:function(newToolTip){if(!newToolTip||newToolTip.isVisible()){return;
}this._cancelLastShowRequest();
this.set_activeToolTip(newToolTip);
newToolTip.show();
},notifyToolTipClosed:function(newToolTip){if(this._activeToolTip==newToolTip){this._activeToolTip=null;
}},set_activeToolTip:function(newToolTip){var active=this._activeToolTip;
if(active&&newToolTip!=active){this._hideCurrentToolTipNoAnimation();
}this._activeToolTip=newToolTip;
},get_activeToolTip:function(){return this._activeToolTip;
},getInstance:function(){return this;
}};
$T.RadToolTipControllerClass.registerClass("Telerik.Web.UI.RadToolTipControllerClass",null);
if(!$T.RadToolTipController){$T.RadToolTipController=new $T.RadToolTipControllerClass();
}$.registerEnum($T,"ToolTipPosition",{TopLeft:11,TopCenter:12,TopRight:13,MiddleLeft:21,Center:22,MiddleRight:23,BottomLeft:31,BottomCenter:32,BottomRight:33});
$.registerEnum($T,"ToolTipHorizontalPosition",{Left:1,Center:2,Right:3});
$.registerEnum($T,"ToolTipVerticalPosition",{Top:1,Middle:2,Bottom:3});
$.registerEnum($T,"ToolTipRelativeDisplay",{Mouse:0,Element:1,BrowserWindow:2});
$.registerEnum($T,"ToolTipScrolling",{Auto:0,None:1,X:2,Y:3,Both:4,Default:5});
$.registerEnum($T,"ToolTipAnimation",{None:0,Resize:1,Fade:2,Slide:4,FlyIn:8});
$.registerEnum($T,"ToolTipShowEvent",{OnMouseOver:1,OnClick:2,OnRightClick:4,OnFocus:8,FromCode:16});
$.registerEnum($T,"ToolTipHideEvent",{Default:1,LeaveToolTip:2,ManualClose:4,LeaveTargetAndToolTip:8,FromCode:16});
Type.registerNamespace("Telerik.Web.UI");
$T.RadToolTip=function(element){$T.RadToolTip.initializeBase(this,[element]);
this._position=$T.ToolTipPosition.BottomCenter;
this._horizontalPosition=null;
this._verticalPosition=null;
this._targetControlID=null;
this._targetControl=null;
this._popupElement=null;
this._tableElement=null;
this._contentCell=null;
this._titleElement=null;
this._contentElement=null;
this._calloutElement=null;
this._closeLink=null;
this._manualCloseButton=null;
this._popupBehavior=null;
this._modal=false;
this._overlay=false;
this._onModalShowHandler=null;
this._onModalCloseHandler=null;
this._title="";
this._text="";
this._manualCloseButtonText="";
this._mouseTrailing=false;
this._showDelayRef=null;
this._autoCloseRef=null;
this._zIndex=8000;
this._cssClass=null;
};
$T.RadToolTip.getCurrent=function(){var controller=$T.RadToolTipController.getInstance();
if(!controller){return null;
}return controller.get_activeToolTip();
};
$T.RadToolTip.prototype={get_zIndex:function(){return this._zIndex;
},set_zIndex:function(value){var zIndex=parseInt(value);
if(isNaN(value)){return;
}if(this._zIndex!=value){this._zIndex=value;
}},initialize:function(){$T.RadToolTip.callBaseMethod(this,"initialize");
this.set_position(this._position);
this._getToolTipAltText(this._targetControl);
var declarativeIndex=$telerik.getCurrentStyle(this.get_element(),"zIndex");
if(null!=declarativeIndex){this.set_zIndex(declarativeIndex);
}if(this.get_visibleOnPageLoad()){setTimeout(Function.createDelegate(this,function(){this.show();
}),0);
}},dispose:function(){var tooltipController=this._getToolTipController();
if(this==tooltipController.get_activeToolTip()){tooltipController.set_activeToolTip(null);
}if(this._showRef){window.clearTimeout(this._showRef);
this._showRef=null;
}if(this._popupBehavior){this._popupBehavior.dispose();
this._popupBehavior=null;
}this._registerPopupHandlers(false);
this._registerMouseHandlers(this._targetControl,false);
this._makeModal(false);
if(this._closeLinkHandler&&this._closeLink){$clearHandlers(this._closeLink);
this._closeLinkHandler=null;
}if(this._popupElement){var thisId=this.get_id();
if(thisId){var serverElement=$get(thisId);
if(serverElement){serverElement.appendChild(this._popupElement);
}}}$T.RadToolTip.callBaseMethod(this,"dispose");
},isCreated:function(){return this._popupElement!=null;
},get_leaveTargetAndToolTip:function(){return this.isHideEventEnabled($T.ToolTipHideEvent.LeaveTargetAndToolTip);
},isHideEventEnabled:function(hideEventValue){return hideEventValue&this.get_hideEvent();
},hide:function(){this._hideUnconditionally();
},_hideIfNotManualCloseOrFromCode:function(){var fromCode=this.isHideEventEnabled($T.ToolTipHideEvent.FromCode);
var manualClose=this.get_manualClose();
if(manualClose||fromCode){return false;
}this._hideUnconditionally();
return true;
},_hideUnconditionally:function(){if(!this.isVisible()){return;
}this._hide();
},_hideNoAnimation:function(){this._hide(false);
},_hide:function(playAnimation){if(this.get_animation()!=$T.ToolTipAnimation.None){$telerik.$(this._popupElement).stop();
}this.cancelHideDelay();
this.cancelShowDelay();
this.cancelAutoCloseDelay();
var popupElement=this._popupElement;
if(!popupElement){return;
}var cancelArgs=new Sys.CancelEventArgs();
this.raiseEvent("beforeHide",cancelArgs);
if(cancelArgs.get_cancel()){return;
}if(this.get_animation()!=$T.ToolTipAnimation.None&&playAnimation!=false){if(this._enableShadow&&$telerik.isIE){Sys.UI.DomElement.removeCssClass(this._tableElement,"rtShadow");
Sys.UI.DomElement.removeCssClass(popupElement,"rtShadow");
}var callout=this._calloutElement;
if(callout){callout.style.visibility="hidden";
}var fnc=Function.createDelegate(this,this._afterHide);
$telerik.$(popupElement).fadeOut(this.get_animationDuration(),fnc);
}else{this._afterHide();
}},_afterHide:function(){try{if(this._popupBehavior){this._popupBehavior.hide();
this._popupBehavior.pin(false);
}}catch(ex){}this._getToolTipController().notifyToolTipClosed(this);
this.raiseEvent("hide");
this._registerPopupHandlers(false);
},clone:function(id){var span=document.createElement("span");
if(id){span.setAttribute("id",id);
}return $telerik.cloneControl(this,$T.RadToolTip,span);
},show:function(){if(!this.get_element()){return;
}this._createUI();
var cancelArgs=new Sys.CancelEventArgs();
this.raiseEvent("beforeShow",cancelArgs);
if(cancelArgs.get_cancel()){return;
}this._popupBehavior.pin(false);
this._showRef=window.setTimeout(Function.createDelegate(this,function(){this._getToolTipController().set_activeToolTip(this);
if(this.get_animation()==$T.ToolTipAnimation.None){this._show();
this._afterShow();
}else{window.setTimeout(Function.createDelegate(this,function(){this._playAnimation();
}),100);
}}),0);
},updateLocation:function(){this._show();
},showLoadingMessage:function(toShow){var skinName=this._getFullSkinName();
var loading="rtLoading";
if(toShow){Sys.UI.DomElement.addCssClass(this._contentCell,skinName);
Sys.UI.DomElement.addCssClass(this._contentCell,loading);
}else{Sys.UI.DomElement.removeCssClass(this._contentCell,skinName);
Sys.UI.DomElement.removeCssClass(this._contentCell,loading);
}},_getToolTipAltText:function(target){var targetControl=target?target:this.get_targetControl();
if(targetControl){var title=targetControl.getAttribute("title");
var ignoreAlt=this.get_ignoreAltAttribute();
var alt=ignoreAlt?null:targetControl.getAttribute("alt");
if(title||alt){if(!ignoreAlt){targetControl.removeAttribute("alt");
}targetControl.removeAttribute("title");
if(!this.get_text()){var content=title?title:alt;
this.set_text(content);
}}}},isModal:function(){return this._modal;
},set_contentElement:function(contentElement){this._contentCell.innerHTML="";
if(contentElement.parentNode&&contentElement.parentNode.removeChild){contentElement.parentNode.removeChild(contentElement);
}this._contentCell.appendChild(contentElement);
contentElement.style.display="";
this._contentElement=contentElement;
this._setOverflow();
this.showLoadingMessage(false);
},get_contentElement:function(){return this._contentElement;
},set_content:function(text){this._text=text;
if(this.isCreated()){var textElement=document.createElement("div");
textElement.innerHTML=text;
this.set_contentElement(textElement);
}},get_content:function(){return this._contentElement?this._contentElement.innerHTML:"";
},cancelHideDelay:function(){if(this._hideDelayRef){window.clearTimeout(this._hideDelayRef);
this._hideDelayRef=0;
}},cancelAutoCloseDelay:function(){if(this._autoCloseRef){window.clearTimeout(this._autoCloseRef);
this._autoCloseRef=0;
}},cancelShowDelay:function(){if(this._showDelayRef){window.clearTimeout(this._showDelayRef);
this._showDelayRef=null;
}this._getToolTipController().cancelSpecificShowRequest(this);
},_getToolTipController:function(){return $T.RadToolTipController.getInstance();
},_resetAutoCloseDelay:function(){this.cancelAutoCloseDelay();
if(this.get_manualClose()||this.get_sticky()){return;
}if(this.get_autoCloseDelay()){this._autoCloseRef=window.setTimeout(Function.createDelegate(this,function(){this._hideIfNotManualCloseOrFromCode();
}),this.get_autoCloseDelay());
}},_resetShowDelay:function(){this.cancelShowDelay();
var fnRef=Function.createDelegate(this,function(){this._getToolTipController().showTooltip(this);
this.cancelShowDelay();
});
this._showDelayRef=window.setTimeout(fnRef,this.get_showDelay());
},_resetHideDelay:function(){this.cancelHideDelay();
if(this.get_hideDelay()>0){this._hideDelayRef=window.setTimeout(Function.createDelegate(this,function(){this._hideIfNotManualCloseOrFromCode();
}),this.get_hideDelay());
}else{this._hideIfNotManualCloseOrFromCode();
}},_show:function(){var bounds=null;
try{bounds=this.getToolTipBounds();
}catch(e){var _this=this;
window.setTimeout(function(){_this._addToolTipToDocument();
},10);
return;
}this._setPopupVisible(bounds.x,bounds.y);
var contentElem=this.get_contentElement();
if(contentElem){$telerik.repaintChildren(contentElem);
}},_afterShow:function(){this._registerPopupHandlers(true);
this._popupBehavior.pin(this._isRelativeToBrowserWindow());
this._resetAutoCloseDelay();
if(this.get_animation()==$T.ToolTipAnimation.None){this._adjustCallout();
}this.raiseEvent("show");
},_isRelativeToBrowserWindow:function(){if(!this._targetControl||this.get_relativeTo()==$T.ToolTipRelativeDisplay.BrowserWindow){return true;
}return false;
},_playAnimation:function(){if(this!=$T.RadToolTip.getCurrent()){return;
}var commonResizeAnimationConfiguration=Function.createDelegate(this,function(){var relativeBounds=this.getToolTipBounds();
this._setPopupVisible(relativeBounds.x,relativeBounds.y);
this._adjustCallout();
var endBounds=$telerik.getBounds(this._tableElement);
$telerik.$(this._popupElement).hide();
return endBounds;
});
var endBounds=commonResizeAnimationConfiguration();
var onAnimationStart=Function.createDelegate(this,function(){if(this._isRelativeToBrowserWindow()){this._documentOverflowX=document.documentElement.style.overflowX;
document.documentElement.style.overflowX="hidden";
}if(this.get_showCallout()&&this._calloutElement){this._calloutElement.style.visibility="hidden";
}if(this._enableShadow&&$telerik.isIE){Sys.UI.DomElement.removeCssClass(this._tableElement,"rtShadow");
Sys.UI.DomElement.removeCssClass(this.get_popupElement(),"rtShadow");
}});
var onAnimationEnd=Function.createDelegate(this,function(){var popupElement=this.get_popupElement();
popupElement.style.filter="";
popupElement.style.opacity="";
if(this.get_showCallout()&&this._calloutElement){this._calloutElement.style.visibility="";
}if(this._enableShadow&&$telerik.isIE&&!$telerik.isIE6){Sys.UI.DomElement.addCssClass(this._tableElement,"rtShadow");
Sys.UI.DomElement.addCssClass(popupElement,"rtShadow");
}this._show();
if(null!=this._documentOverflowX){document.documentElement.style.overflowX=this._documentOverflowX;
this._documentOverflowX=null;
}this._afterShow();
});
var animatedElement=this.get_popupElement();
var animationType=this.get_animation();
var position=""+this._position;
var relativeToBrowser=this._isRelativeToBrowserWindow();
if(relativeToBrowser&&this._verticalPosition!=2){vp=(this._verticalPosition==1?3:1);
position=parseInt(vp+""+this._horizontalPosition);
}var sourceElement=relativeToBrowser?document.documentElement:this._targetControl;
var startBounds=sourceElement?$telerik.getBounds(sourceElement):new Sys.UI.Bounds(1,1,1,1);
var animationDuration=this.get_animationDuration();
window.setTimeout(function(){$T.Animations.playJQueryAnimation(animatedElement,animationType,startBounds,endBounds,position,onAnimationStart,onAnimationEnd,animationDuration);
},0);
},_makeModal:function(bModal){if(this._onModalShowHandler){this.remove_show(this._onModalShowHandler);
this._onModalShowHandler=null;
}if(this._onModalCloseHandler){this.remove_hide(this._onModalCloseHandler);
this._onModalCloseHandler=null;
}if(this._modalExtender){this._modalExtender.dispose();
this._modalExtender=null;
}if(!bModal){return;
}this._onModalShowHandler=function(sender){if(!sender._modalExtender){sender._modalExtender=new $T.ModalExtender(sender._popupElement);
}sender._modalExtender.show();
};
this.add_show(this._onModalShowHandler);
this._onModalCloseHandler=function(sender){if(sender._modalExtender){sender._modalExtender.hide();
}};
this.add_hide(this._onModalCloseHandler);
},_onMouseOver:function(e){this._logMousePosition(e);
this._resetShowDelay();
this.cancelHideDelay();
this.cancelAutoCloseDelay();
this._getToolTipController().requestShow(this);
},_onMouseMove:function(e){this._logMousePosition(e);
this._resetAutoCloseDelay();
if(this._mouseTrailing&&this.isVisible()){this._show();
}},_onMouseOut:function(e){if(!this.isVisible()){this.cancelShowDelay();
return;
}var toKeep=$telerik.isMouseOverElementEx(this._targetControl,e);
if(!toKeep){this.cancelShowDelay();
if(!this.get_sticky()){this._resetHideDelay();
}}},_onClick:function(e){this._onMouseOver(e);
return $telerik.cancelRawEvent(e);
},_onRightClick:function(e){this._onMouseOver(e);
return $telerik.cancelRawEvent(e);
},_registerMouseHandlers:function(targetElement,attachEvent){if(true==attachEvent){var handlers={};
var showEnum=$T.ToolTipShowEvent;
var showEvent=this.get_showEvent();
if(showEvent==showEnum.OnMouseOver){this._onMouseOverDelegate=Function.createDelegate(this,this._onMouseOver);
this._onMouseMoveDelegate=Function.createDelegate(this,this._onMouseMove);
this._onMouseOutDelegate=Function.createDelegate(this,this._onMouseOut);
$telerik.addExternalHandler(targetElement,"mouseover",this._onMouseOverDelegate);
$telerik.addExternalHandler(targetElement,"mousemove",this._onMouseMoveDelegate);
$telerik.addExternalHandler(targetElement,"mouseout",this._onMouseOutDelegate);
}if(showEvent==showEnum.OnClick){this._onClickDelegate=Function.createDelegate(this,this._onClick);
$telerik.addExternalHandler(targetElement,"click",this._onClickDelegate);
}if(showEvent==showEnum.OnRightClick){this._onRightClickDelegate=Function.createDelegate(this,this._onRightClick);
$telerik.addExternalHandler(targetElement,"contextmenu",this._onRightClickDelegate);
}if(showEvent==showEnum.OnFocus){this._onFocusDelegate=Function.createDelegate(this,this._onMouseOver);
this._onBlurDelegate=Function.createDelegate(this,this._onMouseOut);
$telerik.addExternalHandler(targetElement,"focus",this._onFocusDelegate);
$telerik.addExternalHandler(targetElement,"blur",this._onBlurDelegate);
}}else{if(targetElement){var handlersArray=[["mouseover",this._onMouseOverDelegate],["mousemove",this._onMouseMoveDelegate],["mouseout",this._onMouseOutDelegate],["click",this._onClickDelegate],["contextmenu",this._onRightClickDelegate],["focus",this._onFocusDelegate],["blur",this._onBlurDelegate]];
for(var i=0;
i<handlersArray.length;
i++){var item=handlersArray[i];
try{if(null!=item[1]){$telerik.removeExternalHandler(targetElement,item[0],item[1]);
}}catch(e){}}this._onMouseOverDelegate=null;
this._onMouseMoveDelegate=null;
this._onMouseOutDelegate=null;
this._onClickDelegate=null;
this._onRightClickDelegate=null;
this._onFocusDelegate=null;
this._onBlurDelegate=null;
}}},_registerPopupHandlers:function(attachEvent){if(true==attachEvent){if(this.get_sticky()){this._popupStickyHandler=Function.createDelegate(this,this._onPopupStickyMouseOut);
$addHandler(this._tableElement,"mouseout",this._popupStickyHandler);
}else{if(this.get_leaveTargetAndToolTip()){this._popupEnterHandler=Function.createDelegate(this,this._onPopupEnterToolTip);
$addHandler(this._tableElement,"mouseover",this._popupEnterHandler);
this._popupLeaveHandler=Function.createDelegate(this,this._onPopupLeaveToolTip);
$addHandler(this._tableElement,"mouseout",this._popupLeaveHandler);
}}}else{if(this._popupStickyHandler||this._popupEnterHandler||this._popupLeaveHandler){$clearHandlers(this._tableElement);
this._popupStickyHandler=null;
this._popupEnterHandler=null;
this._popupLeaveHandler=null;
}}},_onPopupStickyMouseOut:function(e){var toKeep=$telerik.isMouseOverElementEx(this._tableElement,e);
if(!toKeep){this._hideIfNotManualCloseOrFromCode();
}},_onPopupEnterToolTip:function(e){var toKeep=$telerik.isMouseOverElementEx(this._tableElement,e);
if(toKeep){this.cancelHideDelay();
this.cancelAutoCloseDelay();
}},_onPopupLeaveToolTip:function(e){var toKeep=$telerik.isMouseOverElementEx(this._tableElement,e);
if(!toKeep){this._resetHideDelay();
this._resetAutoCloseDelay();
}},_getPosRelativeToMouse:function(targetBounds){var elemX=targetBounds.x;
var elemY=targetBounds.y;
var pos=this._getMousePosition();
var mouseX=pos.clientX;
var mouseY=pos.clientY;
var standard=$telerik.standardsMode;
if(!$telerik.isIE&&document.compatMode!="CSS1Compat"){standard=false;
}else{if($telerik.isSafari){standard=false;
}}if(standard){elemX-=$telerik.getCorrectScrollLeft(document.documentElement);
elemY-=document.documentElement.scrollTop;
}else{elemX-=$telerik.getCorrectScrollLeft(document.body);
elemY-=document.body.scrollTop;
}var deltaX=mouseX-elemX;
var deltaY=mouseY-elemY;
return{x:deltaX,y:deltaY};
},_logMousePosition:function(e){if(!e){return;
}this._mouseX=e.clientX;
this._mouseY=e.clientY;
},_getMousePosition:function(){var obj={};
obj.clientX=this._mouseX;
obj.clientY=this._mouseY;
return obj;
},_getCalloutBounds:function(){var bounds={width:0,height:0,marginLeft:0,marginTop:0};
if(this.get_showCallout()&&this._calloutElement){bounds.marginLeft=parseInt($telerik.getCurrentStyle(this._calloutElement,"marginLeft"));
bounds.marginTop=parseInt($telerik.getCurrentStyle(this._calloutElement,"marginTop"));
if(isNaN(bounds.marginLeft)){bounds.marginLeft=0;
}if(isNaN(bounds.marginTop)){bounds.marginTop=0;
}var calloutBounds=$telerik.getBounds(this._calloutElement);
if(calloutBounds){if(calloutBounds.width){bounds.width=calloutBounds.width;
}if(calloutBounds.height){bounds.height=calloutBounds.height;
}}}return bounds;
},_getBoundsRelativeToBrowser:function(popupBounds,calloutBounds,targetBounds){var horSide=this._horizontalPosition;
var verSide=this._verticalPosition;
var x=0;
var y=0;
var offsetX=this.get_offsetX();
var offsetY=this.get_offsetY();
if(!targetBounds){targetBounds=$telerik.getClientBounds();
}var scrolls=$telerik.getScrollOffset(document.compatMode&&document.compatMode!="BackCompat"?document.documentElement:document.body);
if("fixed"!=this._popupElement.style.position){x+=scrolls.x;
y+=scrolls.y;
}switch(horSide){case 2:x+=-parseInt(popupBounds.width/2-targetBounds.width/2);
x+=offsetX;
break;
case 3:x+=targetBounds.width;
x-=popupBounds.width;
x-=offsetX;
break;
case 1:default:x+=-popupBounds.width;
x+=(-calloutBounds.width-calloutBounds.marginLeft);
x+=offsetX;
break;
}switch(verSide){case 2:y+=-parseInt((popupBounds.height-targetBounds.height)/2);
break;
case 1:y+=offsetY;
break;
case 3:default:y+=targetBounds.height;
y-=offsetY;
y-=popupBounds.height;
break;
}return new Sys.UI.Bounds(x,y,popupBounds.width,popupBounds.height);
},_getBoundsRelativeToElement:function(popupBounds,calloutBounds,targetBounds){var horSide=this._horizontalPosition;
var verSide=this._verticalPosition;
var x=0;
var y=0;
var offsetX=this.get_offsetX();
var offsetY=this.get_offsetY();
if(!targetBounds){targetBounds=$telerik.getBounds(this._targetControl);
}switch(horSide){case 2:x+=-parseInt(popupBounds.width/2-targetBounds.width/2);
x+=offsetX;
break;
case 3:x+=targetBounds.width;
x-=calloutBounds.marginLeft;
x+=offsetX;
break;
case 1:default:x+=-popupBounds.width;
x+=(-calloutBounds.width-calloutBounds.marginLeft);
x-=offsetX;
break;
}switch(verSide){case 2:y+=-parseInt(popupBounds.height/2-targetBounds.height/2);
y+=offsetY;
break;
case 1:y-=popupBounds.height;
y-=calloutBounds.height+calloutBounds.marginTop;
y-=offsetY;
break;
case 3:default:y+=targetBounds.height;
y-=calloutBounds.marginTop;
y+=offsetY;
break;
}return new Sys.UI.Bounds(x,y,popupBounds.width,popupBounds.height);
},_getBoundsRelativeToMouse:function(popupBounds,calloutBounds,targetBounds){var targetBounds=this._targetControl?$telerik.getBounds(this._targetControl):$telerik.getClientBounds();
var pos=this._getPosRelativeToMouse(targetBounds);
if(isNaN(pos.x)){pos.x=0;
pos.y=0;
}else{targetBounds.width=0;
targetBounds.height=0;
}var relativeToElement=this._getBoundsRelativeToElement(popupBounds,calloutBounds,targetBounds);
var bounds=new Sys.UI.Bounds(pos.x+relativeToElement.x,pos.y+relativeToElement.y,popupBounds.width,popupBounds.height);
return bounds;
},getToolTipBounds:function(){var popupElement=this._popupElement;
var tempHide=(popupElement.style.display=="none")?true:false;
if(tempHide){popupElement.style.visibility="hidden";
}popupElement.style.display="";
this._setOverflow();
if(this._firstShow!=true){this._fixIeHeight(this._tableElement,this.get_height());
this._firstShow=true;
}var parent=this._isRelativeToBrowserWindow()?document.documentElement:this._targetControl;
this._popupBehavior.set_parentElement(parent);
var popupBounds=$telerik.getBounds(this._tableElement);
var calloutBounds=this._getCalloutBounds();
if(tempHide){this._popupElement.style.display="none";
popupElement.style.visibility="";
}var displayEnum=$T.ToolTipRelativeDisplay;
var showEnum=$T.ToolTipShowEvent;
var bounds=null;
if(this.get_relativeTo()==displayEnum.BrowserWindow){bounds=this._getBoundsRelativeToBrowser(popupBounds,calloutBounds);
}else{if(!this._targetControl&&this.get_showEvent()==showEnum.FromCode){bounds=this._getBoundsRelativeToBrowser(popupBounds,calloutBounds);
}else{if(this._targetControl&&this.get_showEvent()==showEnum.FromCode){bounds=this._getBoundsRelativeToElement(popupBounds,calloutBounds);
}else{if((this._mouseTrailing||this.get_relativeTo()==displayEnum.Mouse)){bounds=this._getBoundsRelativeToMouse(popupBounds,calloutBounds);
}else{if(this.get_relativeTo()==displayEnum.Element){bounds=this._getBoundsRelativeToElement(popupBounds,calloutBounds);
}}}}}return bounds;
},_fixIeHeight:function(oElem,height){if("CSS1Compat"==document.compatMode){var difference=(oElem.offsetHeight-parseInt(height));
if(difference>0){var newHeight=(parseInt(oElem.style.height)-difference);
if(newHeight>0){oElem.style.height=newHeight+"px";
}}}},_refreshTitle:function(){if(null==this._titleElement){return;
}this._titleElement.innerHTML=this._title;
this._titleElement.style.display=(this._title)?"":"none";
},getManualCloseButton:function(){return this._manualCloseButton;
},_createManualCloseButton:function(titleCell){if(this.get_manualClose()){var _closeElement=document.createElement("a");
_closeElement.href="javascript: void(0);";
_closeElement.className="rtCloseButton";
this._closeLinkHandler=Function.createDelegate(this,function(e){this._hideUnconditionally();
return $telerik.cancelRawEvent(e);
});
$addHandler(_closeElement,"click",this._closeLinkHandler);
this._closeLink=_closeElement;
var _span=document.createElement("span");
_span.innerHTML=this._manualCloseButtonText;
_closeElement.title=this._manualCloseButtonText;
this._manualCloseButton=_closeElement;
_closeElement.appendChild(_span);
titleCell.appendChild(_closeElement);
}},_createUI:function(){if(!this._popupElement){var tooltipId=this.get_id();
var wrapperId="RadToolTipWrapper_"+tooltipId;
var rootDiv=document.createElement("div");
rootDiv.id=wrapperId;
var element=this.get_element();
var rtlElement=element.parentNode?element:this._getDefaultParent();
var isRightToLeft=$telerik.isRightToLeft(rtlElement);
rootDiv.className=this._getFullSkinName()+(this.get_showCallout()?" rtVisibleCallout":"")+(isRightToLeft?" RadToolTip_rtl":"")+(this._cssClass?" "+this._cssClass:" ");
rootDiv.setAttribute("unselectable","on");
this._popupElement=rootDiv;
var childDiv=document.createElement("div");
childDiv.className="rtCallout "+this._getCalloutPosition(this._position);
childDiv.innerHTML="&nbsp;";
this._calloutElement=childDiv;
var table=document.createElement("table");
table.className="rtWrapper";
table.style.width=this.get_width();
table.style.height=this.get_height();
this._tableElement=table;
var classNames=[];
if(isRightToLeft){classNames=["rtWrapperTopRight","rtWrapperTopCenter","rtWrapperTopLeft","rtWrapperRightMiddle","rtWrapperContent","rtWrapperLeftMiddle","rtWrapperBottomRight","rtWrapperBottomCenter","rtWrapperBottomLeft"];
}else{classNames=["rtWrapperTopLeft","rtWrapperTopCenter","rtWrapperTopRight","rtWrapperLeftMiddle","rtWrapperContent","rtWrapperRightMiddle","rtWrapperBottomLeft","rtWrapperBottomCenter","rtWrapperBottomRight"];
}if(this._enableShadow&&!$telerik.isIE6){Sys.UI.DomElement.addCssClass(this._tableElement,"rtShadow");
Sys.UI.DomElement.addCssClass(rootDiv,"rtShadow");
}var index=0;
for(var i=1;
i<=3;
i++){var _row=table.insertRow(-1);
for(var j=1;
j<=3;
j++){var cell=_row.insertCell(-1);
cell.innerHTML="&nbsp;";
cell.className=classNames[index];
index++;
}}var titleCell=table.rows[0].cells[1];
titleCell.innerHTML="";
if(isRightToLeft){this._createManualCloseButton(titleCell);
}var titleElement=document.createElement("div");
titleElement.className="rtTitlebar";
titleElement.style.display="none";
this._titleElement=titleElement;
this._refreshTitle();
titleCell.appendChild(titleElement);
if(!isRightToLeft){this._createManualCloseButton(titleCell);
}var contentCell=table.rows[1].cells[1];
contentCell.vAlign="top";
contentCell.innerHTML="";
this._contentCell=contentCell;
var serverElement=null;
var serverElement=null;
if(this._text){this.set_content(this._text);
}else{var thisId=this.get_id();
if(thisId){serverElement=$get(thisId);
}if(serverElement&&serverElement.innerHTML){var newElem=this._transferNodeChildren(serverElement);
this.set_contentElement(newElem);
}}rootDiv.appendChild(childDiv);
rootDiv.appendChild(table);
this._popupElement.style.display="none";
this._popupElement.style.position="absolute";
this._addToolTipToDocument(serverElement);
}if(!this._popupBehavior){this._popupBehavior=$create(Telerik.Web.PopupBehavior,{id:(new Date()-100)+"PopupBehavior",parentElement:this._targetControl,overlay:this._overlay},null,null,this._popupElement);
}},_transferNodeChildren:function(elem){if(!elem){return null;
}var newElem=elem.ownerDocument.createElement(elem.tagName);
var childIndexToMove=0;
while(elem.childNodes&&elem.childNodes.length>childIndexToMove){var curElem=elem.childNodes[childIndexToMove];
if(this._clientStateFieldID&&curElem.id==this._clientStateFieldID){childIndexToMove=1;
continue;
}elem.removeChild(curElem);
newElem.appendChild(curElem);
}return newElem;
},_getDefaultParent:function(){var formID=this.get_formID();
var parent=formID?document.getElementById(formID):null;
if(!parent){if(document.forms&&document.forms.length>0){parent=document.forms[0];
}else{parent=document.body;
}}return parent;
},_addToolTipToDocument:function(elem){if(null!=elem&&!this.get_renderInPageRoot()){elem.parentNode.insertBefore(this._popupElement,elem);
return;
}var parent=this._getDefaultParent();
parent.appendChild(this._popupElement);
},_getParentByTagName:function(elem,tagName){var parent=elem;
tagName=tagName.toUpperCase();
while(parent.tagName.toUpperCase()!=tagName){parent=parent.parentNode;
if(!parent){break;
}}return parent;
},_getFullSkinName:function(){return"RadToolTip RadToolTip_"+this.get_skin();
},_getUniqueString:function(){return""+(new Date()-100);
},_getCalloutPosition:function(oPos){with($T.ToolTipPosition){switch(oPos){case TopLeft:return"rtCalloutBottomRight";
case TopCenter:return"rtCalloutBottomCenter";
case TopRight:return"rtCalloutBottomLeft";
case MiddleLeft:return"rtCalloutMiddleRight";
case Center:return"rtCalloutCenter";
case MiddleRight:return"rtCalloutMiddleLeft";
case BottomLeft:return"rtCalloutTopRight";
case BottomCenter:return"rtCalloutTopCenter";
case BottomRight:return"rtCalloutTopLeft";
}}return"";
},_getHorizontalSide:function(oPos){return parseInt((oPos+"").charAt(1));
},_getVerticalSide:function(oPos){return parseInt((oPos+"").charAt(0));
},_setPopupVisible:function(x,y){this._popupElement.style.zIndex=this._zIndex;
this._popupBehavior.set_x(x);
this._popupBehavior.set_y(y);
this._popupBehavior.show();
if(!this.get_width()){this._popupElement.style.width="";
}},_reSetToolTipPosition:function(){var bounds=this.getToolTipBounds();
this._setPopupVisible(bounds.x,bounds.y);
},_setOverflow:function(){var flow=this.get_contentScrolling();
if(flow==$T.ToolTipScrolling.Default){return;
}var el=this._contentElement;
if(!el||el.parentNode!=this._contentCell||((!el.document||!el.document.documentElement)&&$telerik.isIE)){return;
}var overflow="";
with($T.ToolTipScrolling){switch(flow){case Auto:overflow="auto";
break;
case None:overflow="hidden";
break;
case X:overflow="";
el.style.overflowX="scroll";
el.style.overflowY="hidden";
break;
case Y:overflow="";
el.style.overflowY="scroll";
el.style.overflowX="hidden";
break;
case Both:overflow="scroll";
}}var parent=el.parentNode;
el.style.display="none";
var paddingBox=$telerik.getPaddingBox(el);
var bounds=$telerik.getBounds(parent);
el.style.width=Math.abs(bounds.width-paddingBox.vertical)+"px";
el.style.height=Math.abs(bounds.height-paddingBox.horizontal)+"px";
if(!el.style.overflowX&&!el.style.overflowY){el.style.overflow=overflow;
}el.style.display="";
},_getLeftOffset:function(){var posEnum=$T.ToolTipPosition;
var offsetX=this.get_offsetX();
if(posEnum.Left==this._position){return(-1*this._targetControl.offsetWidth)+offsetX;
}else{if(posEnum.Right==this._position){return this._targetControl.offsetWidth+offsetX;
}else{return offsetX;
}}},_getTopOffset:function(){var yoffSet;
var posEnum=$T.ToolTipPosition;
var offsetY=this.get_offsetY();
if(posEnum.Top==this._position){yoffSet=(-1*this._targetControl.offsetHeight)+offsetY;
}else{if(posEnum.Bottom==this._position){yoffSet=this._targetControl.offsetHeight+offsetY;
}else{yoffSet=offsetY;
}}return yoffSet;
},_adjustCallout:function(){if(this._originalPosition){this.set_position(this._originalPosition);
this.updateLocation();
this._originalPosition=null;
}if(this.get_showCallout()&&this.get_position()!=22&&this.get_relativeTo()==$T.ToolTipRelativeDisplay.Element){var targetControl=this.get_targetControl();
if(!targetControl){return;
}var targetBounds=$telerik.getBounds(targetControl);
var popup=this.get_popupElement();
var callout=popup.getElementsByTagName("DIV")[0];
callout.style.left="";
callout.style.top="";
var calloutBounds=$telerik.getBounds(callout);
var viewPort=$telerik.getViewPortSize();
var visibleHeight=Math.min(viewPort.height-targetBounds.y,targetBounds.height);
var visibleWidth=Math.min(viewPort.width-targetBounds.x,targetBounds.width);
callout.style.visibility="hidden";
this._fixToolTipPosition(targetBounds,calloutBounds,visibleWidth,visibleHeight,true);
calloutBounds=$telerik.getBounds(callout);
this._fixToolTipPosition(targetBounds,calloutBounds,visibleWidth,visibleHeight,false);
callout.style.visibility="visible";
this._fixCalloutPosition(targetBounds,visibleWidth,visibleHeight);
}},_fixCalloutPosition:function(targetBounds,visibleWidth,visibleHeight){var popup=this.get_popupElement();
var callout=popup.getElementsByTagName("DIV")[0];
callout.style.left="";
callout.style.top="";
var calloutBounds=$telerik.getBounds(callout);
var toolPos=$telerik.getBounds(popup);
var left=null;
var top=null;
if(this._verticalPosition==$T.ToolTipVerticalPosition.Middle){top=Math.floor(targetBounds.y+visibleHeight/2-toolPos.y+calloutBounds.width/2);
}else{var hpos=this._horizontalPosition;
if(hpos!=$T.ToolTipHorizontalPosition.Center){return;
}left=Math.floor(targetBounds.x+visibleWidth/2-toolPos.x+calloutBounds.width/2);
}if(top){callout.style.top=top+"px";
}if(left){callout.style.left=left+"px";
}},_fixToolTipPosition:function(targetBounds,calloutBounds,visibleWidth,visibleHeight,isHorizontal){var toReposition=false;
var position=this.get_position();
var delta;
var boolExp1;
var boolExp2;
if(isHorizontal){delta=2;
boolExp1=(targetBounds.x+visibleWidth>calloutBounds.x&&this._horizontalPosition==$T.ToolTipHorizontalPosition.Right);
boolExp2=(targetBounds.x<calloutBounds.x&&this._horizontalPosition==$T.ToolTipHorizontalPosition.Left);
}else{delta=20;
boolExp1=(targetBounds.y+visibleHeight>calloutBounds.y&&this._verticalPosition==$T.ToolTipVerticalPosition.Bottom);
boolExp2=(targetBounds.y<calloutBounds.y&&this._verticalPosition==$T.ToolTipVerticalPosition.Top);
}if(boolExp1){toReposition=true;
delta=(-1)*(delta);
}if(boolExp2){toReposition=true;
}if(toReposition){position+=delta;
this._originalPosition=this.get_position();
this.set_position(position);
this.updateLocation();
}},isVisible:function(){var popup=this._popupElement;
return(popup&&popup.style.display!="none");
},get_targetControlID:function(){return this._targetControlID;
},set_targetControlID:function(value){if(this._targetControlID!=value){this._targetControlID=value;
var targetControl=(this._targetControlID?$get(this._targetControlID):null);
this.set_targetControl(targetControl);
}},get_value:function(){return this.get_serverValue();
},set_value:function(value){this.set_serverValue(value);
},get_position:function(){return this._position;
},set_position:function(value){if(this._position!=value){this._position=value;
if(this._calloutElement){this._calloutElement.className="rtCallout "+this._getCalloutPosition(this._position);
}}this._horizontalPosition=this._getHorizontalSide(this._position);
this._verticalPosition=this._getVerticalSide(this._position);
},get_title:function(){return this._title;
},set_title:function(value){if(this._title!=value){this._title=value;
}this._refreshTitle();
},get_text:function(){return this._text;
},set_text:function(value){if(this._text!=value){this._text=value;
}if(this.isCreated()){this.set_content(this._text);
}},get_sticky:function(){return this.isHideEventEnabled($T.ToolTipHideEvent.LeaveToolTip);
},set_sticky:function(value){if(value){this.set_hideEvent($T.ToolTipHideEvent.LeaveToolTip);
}},get_manualClose:function(){return this.isHideEventEnabled($T.ToolTipHideEvent.ManualClose);
},set_manualClose:function(value){if(value){this.set_hideEvent($T.ToolTipHideEvent.ManualClose);
}},get_mouseTrailing:function(){return this._mouseTrailing;
},set_mouseTrailing:function(value){if(this._mouseTrailing!=value){this._mouseTrailing=value;
if(true==value){this.set_relativeTo($T.ToolTipRelativeDisplay.Mouse);
}}},get_modal:function(){return this._modal;
},set_modal:function(value){if(this._modal!=value){this._modal=value;
}this._makeModal(this._modal);
},get_overlay:function(){return this._overlay;
},set_overlay:function(value){this._overlay=value;
if(this._popupBehavior){this._popupBehavior.set_overlay(this._overlay);
}if(this.isVisible()){this._reSetToolTipPosition();
}},get_targetControl:function(){return this._targetControl;
},set_targetControl:function(value){if(this._targetControl!=value){if(this._targetControl&&(this._targetControl!=value)){this._registerMouseHandlers(this._targetControl,false);
}var targetControl=this._ensureRadControlsCompatTarget(value);
this._targetControl=targetControl;
if(targetControl){this._getToolTipAltText(targetControl);
this._registerMouseHandlers(targetControl,true);
if(this._popupBehavior){this._popupBehavior.set_parentElement(targetControl);
}}}},_ensureRadControlsCompatTarget:function(target){var decoratedID=null;
if(target!=null){this._getToolTipAltText(target);
decoratedID=target.getAttribute("_rfddecoratedID");
if(decoratedID){target=$get(decoratedID);
}}var targetID=decoratedID?decoratedID:this.get_targetControlID();
var realInput=$get(targetID+"_text");
if(realInput&&targetID){var targetObject=$find(targetID);
if(targetObject&&Object.getType(targetObject).inheritsFrom($T.RadInputControl)){target=$get(targetID+"_text");
}}return target;
},get_popupElement:function(){return this._popupElement;
}};
$.registerControlProperties($T.RadToolTip,{serverTargetControlID:null,serverValue:"",formID:null,offsetX:0,offsetY:6,width:"",height:"",relativeTo:$T.ToolTipRelativeDisplay.Mouse,contentScrolling:$T.ToolTipScrolling.Default,showCallout:true,renderInPageRoot:false,showDelay:400,autoCloseDelay:3000,hideDelay:300,visibleOnPageLoad:false,animation:$T.ToolTipAnimation.None,animationDuration:500,showEvent:$T.ToolTipShowEvent.OnMouseOver,hideEvent:$T.ToolTipHideEvent.Default,skin:"Default",enableShadow:false,ignoreAltAttribute:false});
$.registerControlEvents($T.RadToolTip,["beforeShow","show","beforeHide","hide"]);
$T.RadToolTip.registerClass("Telerik.Web.UI.RadToolTip",$T.RadWebControl);
})();

if(typeof(Sys)!=='undefined')Sys.Application.notifyScriptLoaded();