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(c){this.set_zIndex($telerik.getCurrentStyle(this.get_element(),"zIndex"));
var a=this.get_updatePanel();
if(a){this._updatePanelParent=a.parentNode;
}var d=this.get_visibleOnPageLoad();
this.set_visibleOnPageLoad(false);
var b=this.get_toolTipZoneID();
this.tooltipify(b?$get(b):document,b?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(e,c){var d=c.get_panelsUpdated();
if(!d){return;
}for(var b=0;
b<d.length;
b++){if(d[b].id==this._getUpdatePanelID()){continue;
}this.tooltipify(d[b],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(c){if(!c){return null;
}var d=this.get_tooltips();
try{for(var a=0;
a<d.length;
a++){if(d[a].get_targetControl()==c){return d[a];
}}}catch(b){}return null;
},clearCloneCache:function(){this.__clonedProperties__=null;
},createToolTip:function(b,c,a){if(!b){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 d=b.getAttribute("id");
if(d){e.set_targetControlID(d);
}else{e.set_targetControl(b);
}this._tooltips[this._tooltips.length]=e;
if(c&&c!=b.getAttribute("id")){e.set_serverTargetControlID(c);
}if(a){e.set_serverValue(a);
}if(this._loadOnDemand){this._initializeAjaxToolTip(e);
}else{if(this._webServiceSettings){this._initializeWebServiceToolTip(e);
}}return e;
},tooltipify:function(e,g){if(!e){e=document;
}if(!g){g=function(k,i){return true;
};
}var h=this.get_targetControls();
if(h.length>0){var j=h.length;
for(var a=0;
a<j;
a++){var d=h[a];
var b=$get(d[0]);
if(b&&g(e,b)){this.createToolTip(b,d[1],d[2]);
}}}else{if(!this.get_autoTooltipify()){return;
}var h=e.getElementsByTagName("*");
var j=h.length;
for(var a=0;
a<j;
a++){var b=h[a];
var f=b.getAttribute("title");
var c=b.getAttribute("alt");
if(f||c){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 b=d.get_data();
var c=document.createElement("div");
if(this._currentServicedToolTip){this._currentServicedToolTip.set_contentElement(c);
c.innerHTML=b;
}this.raiseEvent("requestEnd");
},_initializeWebServiceToolTip:function(a){a.add_beforeShow(Function.createDelegate(this,function(d,c){if(!this._webServiceLoader){this._initializeWebServiceLoader();
}var b={TargetControlID:a.get_targetControlID(),Value:a.get_serverValue()};
this._currentServicedToolTip=d;
this._webServiceLoader.loadData({context:b});
d.set_content("");
d.showLoadingMessage(true);
}));
},_initializeAjaxToolTip:function(a){a.add_beforeShow(Function.createDelegate(this,function(b,c){this._doLoadOnDemand(b);
}));
a.add_hide(Function.createDelegate(this,function(e,d){var b=this.get_updatePanel();
var c=e.get_popupElement();
var f=$telerik.isDescendant(c,b);
if(f){this._moveUpdatePanel();
}}));
},_doLoadOnDemand:function(g){var e=this._getDefaultParent();
var d=this._moveUpdatePanel(e,true);
g.showLoadingMessage(true);
var c=Sys.WebForms.PageRequestManager.getInstance();
if(this._requestStarted){c.abortPostBack();
}var f=Function.createDelegate(this,function(h,i){this._requestStarted=true;
c.remove_beginRequest(f);
});
c.add_beginRequest(f);
var a=Function.createDelegate(this,function(h,i){this._requestStarted=false;
c.remove_endRequest(a);
if(i.get_response().get_aborted()){return;
}g.set_contentElement(d);
if(i.get_error()){i.set_errorHandled(true);
this._onError(i.get_error().message);
return;
}this.raiseEvent("requestEnd");
});
c.add_endRequest(a);
var b=g.get_serverTargetControlID();
if(!b){b=g.get_targetControlID();
}this._ajaxControlID=b;
this._ajaxValue=g.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(b){var a=Sys.Serialization.JavaScriptSerializer.deserialize(b);
this._webServiceSettings=new Telerik.Web.UI.WebServiceSettings(a);
},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_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();
