﻿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._toolTipZoneID=null;
this._autoTooltipify=true;
this._updatePanelParent=null;
this._tooltips=[];
this._idCounter=100;
this._webServiceSettings=null;
};
Telerik.Web.UI.RadToolTipManager.prototype={initialize:function(_2){
this.set_zIndex($telerik.getCurrentStyle(this.get_element(),"zIndex"));
var _3=this.get_updatePanel();
if(_3){
this._updatePanelParent=_3.parentNode;
}
var _4=this.get_visibleOnPageLoad();
this.set_visibleOnPageLoad(false);
var _5=this.get_toolTipZoneID();
this.tooltipify(_5?$get(_5):document,_5?this._isDescendant:null);
if(_4&&this._tooltips[0]){
this._tooltips[0].show();
}
window.setTimeout(Function.createDelegate(this,function(){
this._trackPageUpdates();
}),0);
},get_updatePanel:function(){
return $get(this._getUpdatePanelID());
},dispose:function(){
this._moveUpdatePanel();
this._disposeToolTips();
var _6=Sys.WebForms.PageRequestManager.getInstance();
_6.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;
},_isDescendant:function(_9,_a){
return $telerik.isDescendant(_9,_a);
},_trackPageUpdates:function(){
this._pageLoadedHandler=Function.createDelegate(this,function(_b,_c){
var _d=_c.get_panelsUpdated();
if(!_d){
return;
}
for(var i=0;i<_d.length;i++){
if(_d[i].id==this._getUpdatePanelID()){
continue;
}
this.tooltipify(_d[i],this._isDescendant);
}
});
var _f=Sys.WebForms.PageRequestManager.getInstance();
_f.add_pageLoaded(this._pageLoadedHandler);
},get_toolTips:function(){
return this._tooltips;
},get_tooltips:function(){
return this.get_toolTips();
},createToolTip:function(_10,_11,_12){
var _13=_10.getAttribute("title");
_10.removeAttribute("title");
var _14=this.clone(_10,this._getUniqueToolTipID());
this._tooltips[this._tooltips.length]=_14;
if(_11&&_11!=_10.getAttribute("id")){
_14.set_serverTargetControlID(_11);
}
if(_12){
_14.set_serverValue(_12);
}
if(this._loadOnDemand){
this._initializeAjaxToolTip(_14);
}else{
if(this._webServiceSettings){
this._initializeWebServiceToolTip(_14);
}else{
var _15=this.get_text();
if(!_15){
_15=_13;
}
_14.set_text(_15);
}
}
},tooltipify:function(_16,_17){
if(!_16){
_16=document;
}
if(!_17){
_17=function(_18,_19){
return true;
};
}
var _1a=this.get_targetControls();
if(_1a.length>0){
for(var i=0;i<_1a.length;i++){
var _1c=_1a[i];
var _1d=$get(_1c[0]);
if(_1d&&_17(_16,_1d)){
this.createToolTip(_1d,_1c[1],_1c[2]);
}
}
}else{
if(_16==document&&!this.get_autoTooltipify()){
return;
}
var _1a=_16.getElementsByTagName("*");
for(var i=0;i<_1a.length;i++){
var _1d=_1a[i];
var _1e=_1d.getAttribute("title");
var alt=_1d.getAttribute("alt");
if(_1d&&(_1e||alt)){
if(!_1e){
_1d.setAttribute("title",alt);
_1d.removeAttribute("alt");
}else{
if(alt){
_1d.removeAttribute("alt");
}
}
this.createToolTip(_1d);
}
}
}
},_initializeWebServiceLoader:function(){
this._webServiceLoader=new Telerik.Web.UI.WebServiceLoader(this.get_webServiceSettings());
this._webServiceLoader.add_loadingError(function(_20,_21){
var _22=_21.get_message();
alert(_22);
});
this._webServiceLoader.add_loadingSuccess(Function.createDelegate(this,this._onWebServiceResponse));
},_onWebServiceResponse:function(_23,_24){
var _25=_24.get_data();
var div=document.createElement("DIV");
div.innerHTML=_25;
if(this._currentServicedToolTip){
this._currentServicedToolTip.set_contentElement(div);
}
},_initializeWebServiceToolTip:function(_27){
_27.add_beforeShow(Function.createDelegate(this,function(_28,_29){
if(!this._webServiceLoader){
this._initializeWebServiceLoader();
}
var _2a={TargetControlID:_27.get_targetControlID(),Value:_27.get_serverValue()};
this._currentServicedToolTip=_28;
this._webServiceLoader.loadData({context:_2a});
_28.showLoadingMessage(true);
}));
},_initializeAjaxToolTip:function(_2b){
_2b.add_beforeShow(Function.createDelegate(this,function(_2c,_2d){
this._doLoadOnDemand(_2c);
}));
_2b.add_hide(Function.createDelegate(this,function(_2e,_2f){
var _30=this.get_updatePanel();
var _31=_2e.get_popupElement();
var _32=$telerik.isDescendant(_31,_30);
if(_32){
this._moveUpdatePanel();
}
}));
},_doLoadOnDemand:function(_33){
var _34=document.getElementById(_33.get_formID());
if(!_34){
_34=document.forms[0];
}
var _35=this._moveUpdatePanel(_34,true);
_33.showLoadingMessage(true);
var prm=Sys.WebForms.PageRequestManager.getInstance();
prm.add_endRequest(EndRequestHandler);
function EndRequestHandler(_37,_38){
_33.set_contentElement(_35);
prm.remove_endRequest(EndRequestHandler);
}
var _39=_33.get_serverTargetControlID();
if(!_39){
_39=_33.get_targetControlID();
}
this._ajaxControlID=_39;
this._ajaxValue=_33.get_serverValue();
this.updateClientState();
__doPostBack(this._getUpdatePanelID());
},saveClientState:function(){
var _3a={AjaxTargetControl:this._ajaxControlID,Value:this._ajaxValue};
return Sys.Serialization.JavaScriptSerializer.serialize(_3a);
},_getUpdatePanelID:function(){
return this.get_id()+"RTMPanel";
},_getUniqueToolTipID:function(){
this._idCounter++;
return (this.get_id()+(new Date()-this._idCounter));
},_moveUpdatePanel:function(_3b,_3c){
if(!_3b){
_3b=this._updatePanelParent;
}
if(_3b&&_3b.appendChild){
var _3d=this.get_updatePanel();
if(_3d){
if(false!=_3c){
_3d.style.display="none";
}
_3b.appendChild(_3d);
}
return _3d;
}
},get_webServiceSettings:function(){
return this._webServiceSettings;
},set_webServiceSettings:function(_3e){
var _3f=Sys.Serialization.JavaScriptSerializer.deserialize(_3e);
this._webServiceSettings=new Telerik.Web.UI.WebServiceSettings(_3f);
},get_autoTooltipify:function(){
return this._autoTooltipify;
},set_autoTooltipify:function(_40){
if(this._autoTooltipify!=_40){
this._autoTooltipify=_40;
}
},get_toolTipZoneID:function(){
return this._toolTipZoneID;
},set_toolTipZoneID:function(_41){
if(this._toolTipZoneID!=_41){
this._toolTipZoneID=_41;
}
},get_isToolTipFactory:function(){
return this._isToolTipFactory;
},set_isToolTipFactory:function(_42){
if(this._isToolTipFactory!=_42){
this._isToolTipFactory=_42;
}
},get_loadOnDemand:function(){
return this._loadOnDemand;
},set_loadOnDemand:function(_43){
if(this._loadOnDemand!=_43){
this._loadOnDemand=_43;
}
},get_targetControls:function(){
return this._targetControls;
},set_targetControls:function(_44){
if(!_44){
this._targetControls=[];
}else{
this._targetControls=eval(_44);
}
}};
Telerik.Web.UI.RadToolTipManager.registerClass("Telerik.Web.UI.RadToolTipManager",Telerik.Web.UI.RadToolTip);


if(typeof(Sys)!=='undefined')Sys.Application.notifyScriptLoaded();