Type.registerNamespace("Telerik.Web.UI");
$telerik.toToolTipManager=function(a){return a;
};
$telerik.findToolTipManager=$find;
Telerik.Web.UI.RadToolTipManager=function(a){Telerik.Web.UI.RadToolTipManager.initializeBase(this,[a]);
this._targetControls=null;
this._isToolTipFactory=false;
this._loadOnDemand=false;
this._toolTipZoneID=null;
this._autoTooltipify=false;
this._updatePanelUniqueId="";
this._updatePanelParent=null;
this._tooltips=[];
this._idCounter=100;
this._webServiceSettings=null;
this._cssClass=null;
};
Telerik.Web.UI.RadToolTipManager.prototype={initialize:function(a){this.set_zIndex($telerik.getCurrentStyle(this.get_element(),"zIndex"));
var b=this.get_updatePanel();
if(b){this._updatePanelParent=b.parentNode;
}var d=this.get_visibleOnPageLoad();
this.set_visibleOnPageLoad(false);
var c=this.get_toolTipZoneID();
this.tooltipify(c?$get(c):document,c?this._isDescendant:null);
if(d&&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();
if(this._pageLoadedHandler){var a=Sys.WebForms.PageRequestManager.getInstance();
a.remove_pageLoaded(this._pageLoadedHandler);
this._pageLoadedHandler=null;
}this._updatePanelParent=null;
Telerik.Web.UI.RadToolTipManager.callBaseMethod(this,"dispose");
},_disposeToolTips:function(){for(var a=0;
a<this._tooltips.length;
a++){var b=this._tooltips[a];
b.dispose();
}this._tooltips=null;
},_isDescendant:function(a,b){return $telerik.isDescendant(a,b);
},_trackPageUpdates:function(){if(Sys.WebForms){this._pageLoadedHandler=Function.createDelegate(this,function(b,e){var c=e.get_panelsUpdated();
if(!c){return;
}for(var d=0;
d<c.length;
d++){if(c[d].id==this._getUpdatePanelID()){continue;
}this.tooltipify(c[d],this._isDescendant);
}});
var a=Sys.WebForms.PageRequestManager.getInstance();
a.add_pageLoaded(this._pageLoadedHandler);
}},get_toolTips:function(){return this._tooltips;
},get_tooltips:function(){return this.get_toolTips();
},getToolTipByElement:function(a){if(!a){return null;
}var d=this.get_tooltips();
try{for(var c=0;
c<d.length;
c++){if(d[c].get_targetControl()==a){return d[c];
}}}catch(b){}return null;
},clearCloneCache:function(){this.__clonedProperties__=null;
},createToolTip:function(d,b,c){if(!d){alert("clone error: No target element specified");
return;
}var e=this.clone(this._getUniqueToolTipID());
e._manualCloseButtonText=this._manualCloseButtonText;
e.set_modal(e.isModal());
e._cssClass=this._cssClass;
var a=d.getAttribute("id");
if(a){e.set_targetControlID(a);
}else{e.set_targetControl(d);
}this._tooltips[this._tooltips.length]=e;
if(b&&b!=d.getAttribute("id")){e.set_serverTargetControlID(b);
}if(c){e.set_serverValue(c);
}if(this._loadOnDemand){this._initializeAjaxToolTip(e);
}else{if(this._webServiceSettings){this._initializeWebServiceToolTip(e);
}}return e;
},tooltipify:function(j,h){if(!j){j=document;
}if(!h){h=function(k,i){return true;
};
}var g=this.get_targetControls();
if(g.length>0){var c=g.length;
for(var f=0;
f<c;
f++){var e=g[f];
var b=$get(e[0]);
if(b&&h(j,b)){this.createToolTip(b,e[1],e[2]);
}}}else{if(!this.get_autoTooltipify()){return;
}var g=j.getElementsByTagName("*");
var c=g.length;
for(var f=0;
f<c;
f++){var b=g[f];
var d=b.getAttribute("title");
var a=b.getAttribute("alt");
if(d||a){this.createToolTip(b);
}}}},_initializeWebServiceLoader:function(){this._webServiceLoader=new Telerik.Web.UI.WebServiceLoader(this.get_webServiceSettings());
this._webServiceLoader.add_loadingError(Function.createDelegate(this,this._onWebServiceError));
this._webServiceLoader.add_loadingSuccess(Function.createDelegate(this,this._onWebServiceResponse));
},_onWebServiceError:function(a,b){this._onError(b.get_message());
},_onWebServiceResponse:function(a,d){var c=d.get_data();
var b=document.createElement("div");
if(this._currentServicedToolTip){this._currentServicedToolTip.set_contentElement(b);
b.innerHTML=c;
}this.raiseEvent("requestEnd");
},_initializeWebServiceToolTip:function(a){a.add_beforeShow(Function.createDelegate(this,function(b,d){if(b!==a){return;
}if(!this._webServiceLoader){this._initializeWebServiceLoader();
}var e={TargetControlID:a.get_targetControlID(),Value:a.get_serverValue()};
this._currentServicedToolTip=b;
var c=new Sys.CancelEventArgs();
this.raiseEvent("requestStart",c);
if(c.get_cancel()){return;
}this._webServiceLoader.loadData({context:e});
b.set_content("");
b.showLoadingMessage(true);
}));
},_initializeAjaxToolTip:function(a){a.add_beforeShow(Function.createDelegate(this,function(b,c){if(b!==a){return;
}this._doLoadOnDemand(b);
}));
a.add_hide(Function.createDelegate(this,function(b,e){var c=this.get_updatePanel();
var d=b.get_popupElement();
var f=$telerik.isDescendant(d,c);
if(f){this._moveUpdatePanel();
}}));
},_doLoadOnDemand:function(e){var d=new Sys.CancelEventArgs();
this.raiseEvent("requestStart",d);
if(d.get_cancel()){return;
}var h=this._getDefaultParent();
var b=this._moveUpdatePanel(h,true);
e.showLoadingMessage(true);
var a=Sys.WebForms.PageRequestManager.getInstance();
if(this._requestStarted){a.abortPostBack();
}var g=Function.createDelegate(this,function(i,j){this._requestStarted=true;
a.remove_beginRequest(g);
});
a.add_beginRequest(g);
var f=Function.createDelegate(this,function(i,j){this._requestStarted=false;
a.remove_endRequest(f);
if(j.get_response().get_aborted()){return;
}e.set_contentElement(b);
if(j.get_error()){j.set_errorHandled(true);
this._onError(j.get_error().message);
return;
}this.raiseEvent("requestEnd");
});
a.add_endRequest(f);
var c=e.get_serverTargetControlID();
if(!c){c=e.get_targetControlID();
}this._ajaxControlID=c;
this._ajaxValue=e.get_serverValue();
this.updateClientState();
__doPostBack(this._updatePanelUniqueId);
this._ajaxControlID=null;
this._ajaxValue=null;
},_onError:function(a){if(!a){a="No error data available";
}var b=new Telerik.Web.UI.RadToolTipManagerErrorEventArgs(a);
this.raiseEvent("responseError",b);
if(!b.get_cancelErrorAlert()){alert("RadToolTipManager response error:\n Exception="+a);
}},saveClientState:function(){var a={AjaxTargetControl:this._ajaxControlID,Value:this._ajaxValue};
return Sys.Serialization.JavaScriptSerializer.serialize(a);
},_getUpdatePanelID:function(){return this.get_id()+"RTMPanel";
},_getUniqueToolTipID:function(){this._idCounter++;
return(this.get_id()+this._idCounter+(new Date()-100));
},_moveUpdatePanel:function(b,c){if(!b){b=this._updatePanelParent;
}if(b&&b.appendChild){var a=this.get_updatePanel();
if(a){if(false!=c){a.style.display="none";
}b.appendChild(a);
}return a;
}},set_modal:function(a){if(this._modal!=a){this._modal=a;
}},get_webServiceLoader:function(){return this._webServiceLoader;
},get_webServiceSettings:function(){return this._webServiceSettings;
},set_webServiceSettings:function(a){var b=Sys.Serialization.JavaScriptSerializer.deserialize(a);
this._webServiceSettings=new Telerik.Web.UI.WebServiceSettings(b);
},get_autoTooltipify:function(){return this._autoTooltipify;
},set_autoTooltipify:function(a){if(this._autoTooltipify!=a){this._autoTooltipify=a;
}},get_toolTipZoneID:function(){return this._toolTipZoneID;
},set_toolTipZoneID:function(a){if(this._toolTipZoneID!=a){this._toolTipZoneID=a;
}},get_isToolTipFactory:function(){return this._isToolTipFactory;
},set_isToolTipFactory:function(a){if(this._isToolTipFactory!=a){this._isToolTipFactory=a;
}},get_loadOnDemand:function(){return this._loadOnDemand;
},set_loadOnDemand:function(a){if(this._loadOnDemand!=a){this._loadOnDemand=a;
}},get_targetControls:function(){return this._targetControls;
},set_targetControls:function(a){if(!a){this._targetControls=[];
}else{this._targetControls=eval(a);
}},add_requestStart:function(a){this.get_events().addHandler("requestStart",a);
},remove_requestStart:function(a){this.get_events().removeHandler("requestStart",a);
},add_requestEnd:function(a){this.get_events().addHandler("requestEnd",a);
},remove_requestEnd:function(a){this.get_events().removeHandler("requestEnd",a);
},add_responseError:function(a){this.get_events().addHandler("responseError",a);
},remove_responseError:function(a){this.get_events().removeHandler("responseError",a);
}};
Telerik.Web.UI.RadToolTipManager.registerClass("Telerik.Web.UI.RadToolTipManager",Telerik.Web.UI.RadToolTip);
Telerik.Web.UI.RadToolTipManagerErrorEventArgs=function(a){Telerik.Web.UI.RadToolTipManagerErrorEventArgs.initializeBase(this);
this._cancelErrorAlert=false;
this._errorMessage=a;
};
Telerik.Web.UI.RadToolTipManagerErrorEventArgs.prototype={get_errorMessage:function(){return this._errorMessage;
},get_cancelErrorAlert:function(){return this._cancelErrorAlert;
},set_cancelErrorAlert:function(a){this._cancelErrorAlert=a;
}};
Telerik.Web.UI.RadToolTipManagerErrorEventArgs.registerClass("Telerik.Web.UI.RadToolTipManagerErrorEventArgs",Sys.EventArgs);
if(typeof(Sys)!=='undefined')Sys.Application.notifyScriptLoaded();
