﻿Type.registerNamespace("Telerik.Web.UI");
Telerik.Web.UI.RadToolTipManager=function(_1){
Telerik.Web.UI.RadToolTipManager.initializeBase(this,[_1]);
this._targetControls=null;
this._isToolTipFactory=false;
this._loadOnDemand=false;
this._updatePanelParent=null;
this._tooltips=[];
};
Telerik.Web.UI.RadToolTipManager.prototype={initialize:function(_2){
var _3=this.get_UpdatePanel();
if(_3){
this._updatePanelParent=_3.parentNode;
}
this._tooltipifyPage();
var _4=this;
window.setTimeout(function(){
_4._trackPageUpdates();
},0);
},dispose:function(){
this._moveUpdatePanel();
this._disposeTooltips();
var _5=Sys.WebForms.PageRequestManager.getInstance();
_5.remove_pageLoaded(this._pageLoadedHandler);
this._pageLoadedHandler=null;
this._updatePanelParent=null;
Telerik.Web.UI.RadToolTipManager.callBaseMethod(this,"dispose");
},_disposeTooltips:function(){
for(var i=0;i<this._tooltips.length;i++){
var t=this._tooltips[i];
t.dispose();
}
this._tooltips=null;
},_trackPageUpdates:function(){
var _8=this;
function testFunction(_9,_a){
var _b=Telerik.Web.DomUtility.isDescendant(_9,_a);
if(_b){
return true;
}
}
this._pageLoadedHandler=function pageLoaded(_c,_d){
var _e=_d.get_panelsUpdated();
if(!_e){
return;
}
for(var i=0;i<_e.length;i++){
if(_e[i].id==_8.get_id()+"Panel"){
continue;
}
_8._tooltipifyPage(_e[i],testFunction);
}
};
var prm=Sys.WebForms.PageRequestManager.getInstance();
prm.add_pageLoaded(this._pageLoadedHandler);
},_initializeSingleAjaxifiedTooltip:function(_11,_12,_13){
var _14=this;
if(_13&&_13!=_12.getAttribute("id")){
_11.set_ServerTargetControlID(_13);
}
_11.add_BeforeShow(function(){
_14._doLoadOnDemand(_11);
});
_11.add_Hide(function(_15,_16){
var _17=_14.get_UpdatePanel();
var _18=_15.get_PopupElement();
var _19=Telerik.Web.DomUtility.isDescendant(_18,_17);
if(_19){
_14._moveUpdatePanel();
}
});
},_initializeTooltip:function(_1a,_1b){
var _1c=_1a.getAttribute("title");
_1a.removeAttribute("title");
var _1d=this.clone(_1a);
this._tooltips[this._tooltips.length]=_1d;
if(this._loadOnDemand){
this._initializeSingleAjaxifiedTooltip(_1d,_1a,_1b);
}else{
var _1e=this.get_Text();
if(!_1e){
_1e=_1c;
}
_1d.set_Text(_1e);
}
},_tooltipifyPage:function(_1f,_20){
if(!_1f){
_1f=document;
}
if(!_20){
_20=function(_21,_22){
return true;
};
}
var _23=this.get_TargetControls();
if(_23.length>0){
for(var i=0;i<_23.length;i++){
var _25=_23[i][0];
var _26=$get(_25);
if(_26&&_20(_1f,_26)){
this._initializeTooltip(_26,_23[i][1]);
}
}
}else{
var _23=_1f.getElementsByTagName("*");
for(var i=0;i<_23.length;i++){
var _26=_23[i];
var _27=_26.getAttribute("title");
var alt=_26.getAttribute("alt");
if(_26&&(_27||alt)){
if(!_27){
_26.setAttribute("title",alt);
_26.removeAttribute("alt");
}else{
if(alt){
_26.removeAttribute("alt");
}
}
this._initializeTooltip(_26);
}
}
}
},_moveUpdatePanel:function(_29,_2a){
if(!_29){
_29=this._updatePanelParent;
}
if(_29&&_29.appendChild){
var _2b=this.get_UpdatePanel();
if(_2b){
if(false!=_2a){
_2b.style.display="none";
}
_29.appendChild(_2b);
}
return _2b;
}
},_doLoadOnDemand:function(_2c){
var _2d=document.getElementById(_2c.get_FormID());
if(!_2d){
_2d=document.forms[0];
}
var _2e=this._moveUpdatePanel(_2d,true);
_2c.showLoadingMessage(true);
var prm=Sys.WebForms.PageRequestManager.getInstance();
prm.add_endRequest(EndRequestHandler);
function EndRequestHandler(_30,_31){
_2c.set_ContentElement(_2e);
prm.remove_endRequest(EndRequestHandler);
}
var _32=_2c.get_ServerTargetControlID();
if(!_32){
_32=_2c._targetControlID;
}
this.AjaxRequestID=_32;
this.updateClientState();
__doPostBack(this.get_id()+"Panel");
},saveClientState:function(){
var _33={};
if(this.AjaxRequestID){
_33["AjaxTargetControl"]=this.AjaxRequestID;
}
return Sys.Serialization.JavaScriptSerializer.serialize(_33);
},get_UpdatePanel:function(){
return $get(this.get_id());
},get_IsToolTipFactory:function(){
return this._isToolTipFactory;
},set_IsToolTipFactory:function(_34){
if(this._isToolTipFactory!=_34){
this._isToolTipFactory=_34;
}
},get_LoadOnDemand:function(){
return this._loadOnDemand;
},set_LoadOnDemand:function(_35){
if(this._loadOnDemand!=_35){
this._loadOnDemand=_35;
}
},get_TargetControls:function(){
return this._targetControls;
},set_TargetControls:function(_36){
if(!_36){
this._targetControls=[];
}else{
this._targetControls=eval(_36);
}
}};
Telerik.Web.UI.RadToolTipManager.registerClass("Telerik.Web.UI.RadToolTipManager",Telerik.Web.UI.RadToolTip);


if(typeof(Sys)!=='undefined')Sys.Application.notifyScriptLoaded();