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._enableDataCaching=false;
this._updatePanelParent=null;
this._tooltips=[];
this._idCounter=100;
this._webServiceSettings=null;
this._cssClass=null;
};
Telerik.Web.UI.RadToolTipManager.prototype={initialize:function(a){this.applyElementZIndex();
var b=this.get_updatePanel();
if(b){this._updatePanelParent=b.parentNode;
}var c=this.get_visibleOnPageLoad();
this.set_visibleOnPageLoad(false);
var d=this.get_toolTipZoneID();
this.tooltipify(d?$get(d):document,d?this._isDescendant:null);
if(c&&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(b,a){return $telerik.isDescendant(b,a);
},_trackPageUpdates:function(){if(Sys.WebForms){this._pageLoadedHandler=Function.createDelegate(this,function(d,b){var e=b.get_panelsUpdated();
if(!e){return;
}for(var c=0;
c<e.length;
c++){if(e[c].id==this._getUpdatePanelID()){continue;
}this.tooltipify(e[c],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);
}}this.get_element().appendChild(e.get_element());
return e;
},tooltipify:function(f,h){if(!f){f=document;
}if(!h){h=function(k,i){return true;
};
}var c=this.get_targetControls(),e,d,b;
if(c&&c.length>0){e=c.length;
for(d=0;
d<e;
d++){var g=c[d];
b=$get(g[0]);
if(b&&h(f,b)){this.createToolTip(b,g[1],g[2]);
}}}else{if(!this.get_autoTooltipify()){return;
}c=f.getElementsByTagName("*");
e=c.length;
for(d=0;
d<e;
d++){b=c[d];
var j=b.getAttribute("title");
var a=b.getAttribute("alt");
if(j||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(b,a){this._onError(a.get_message());
},_onWebServiceResponse:function(d,b){var c=b.get_data();
var a=document.createElement("div");
var e=this._currentServicedToolTip;
if(e){e.set_contentElement(a);
a.innerHTML=c;
e._reSetPositionWithoutFlicker();
}this.raiseEvent("requestEnd");
},_initializeWebServiceToolTip:function(a){a.add_beforeShow(Function.createDelegate(this,function(e,b){if(e!==a||(this.get_enableDataCaching()&&a.get_contentElement())){return;
}var g=this._webServiceLoader;
if(!g){this._initializeWebServiceLoader();
g=this._webServiceLoader;
}var f={TargetControlID:a.get_targetControlID(),Value:a.get_serverValue()};
this._currentServicedToolTip=e;
var c=new Sys.CancelEventArgs();
this.raiseEvent("requestStart",c);
if(c.get_cancel()){return;
}var d={context:f};
if(this.get_webServiceSettings().get_isWcf()){d.context=g._serializeDictionaryAsKeyValuePairs(d.context);
}g.loadData(d);
e.set_content("");
e.showLoadingMessage(true);
}));
},_initializeAjaxToolTip:function(a){a.add_beforeShow(Function.createDelegate(this,function(d,b){if(d!==a){return;
}var c=d.get_contentElement();
if(this.get_enableDataCaching()&&c){c.innerHTML=d._cachedContent;
d.set_contentElement(c);
return;
}this._doLoadOnDemand(d);
}));
a.add_hide(Function.createDelegate(this,function(e,b){var d=this.get_updatePanel();
var f=e.get_popupElement();
if(this.get_enableDataCaching()&&e.get_id()==a.get_id()){a._cachedContent=d.innerHTML;
}var c=$telerik.isDescendant(f,d);
if(c){this._moveUpdatePanel();
}}));
},_doLoadOnDemand:function(h){var a=new Sys.CancelEventArgs();
this.raiseEvent("requestStart",a);
if(a.get_cancel()){return;
}var f=this._getDefaultParent();
var e=this._moveUpdatePanel(f,true);
h.showLoadingMessage(true);
var g=Sys.WebForms.PageRequestManager.getInstance();
if(this._requestStarted){g.abortPostBack();
}var c=Function.createDelegate(this,function(j,i){this._requestStarted=true;
g.remove_beginRequest(c);
});
g.add_beginRequest(c);
var d=Function.createDelegate(this,function(j,i){this._requestStarted=false;
g.remove_endRequest(d);
if(i.get_response().get_aborted()){return;
}if(!(h._cachedContent&&this.get_enableDataCaching())){h._cachedContent=e.innerHTML;
h.set_contentElement(e);
}if(i.get_error()){i.set_errorHandled(true);
this._onError(i.get_error().message);
return;
}h._reSetPositionWithoutFlicker();
this.raiseEvent("requestEnd");
});
g.add_endRequest(d);
var b=h.get_serverTargetControlID();
if(!b){b=h.get_targetControlID();
}this._ajaxControlID=b;
this._ajaxValue=h.get_serverValue();
this.updateClientState();
__doPostBack(this._updatePanelUniqueId);
this._ajaxControlID=null;
this._ajaxValue=null;
},_onError:function(b){if(!b){b="No error data available";
}var a=new Telerik.Web.UI.ToolTipManagerErrorEventArgs(b);
this.raiseEvent("responseError",a);
if(!a.get_cancelErrorAlert()){alert("RadToolTipManager response error:\n Exception="+b);
}},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(c,a){if(!c){c=this._updatePanelParent;
}if(c&&c.appendChild){var b=this.get_updatePanel();
if(b){if(false!=a){b.style.display="none";
}c.appendChild(b);
}return b;
}},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_enableDataCaching:function(){return this._enableDataCaching;
},set_enableDataCaching:function(a){if(this._enableDataCaching!=a){this._enableDataCaching=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);
var createRadEventArgs=function(c,b){var a=Telerik.Web.UI;
a[c]=function(){var d=Array.prototype.slice.call(arguments);
a[c].initializeBase(this,d);
};
a[c].registerClass("Telerik.Web.UI."+c,b);
};
Telerik.Web.UI.ToolTipManagerErrorEventArgs=function(a){Telerik.Web.UI.ToolTipManagerErrorEventArgs.initializeBase(this);
this._cancelErrorAlert=false;
this._errorMessage=a;
};
Telerik.Web.UI.ToolTipManagerErrorEventArgs.prototype={get_errorMessage:function(){return this._errorMessage;
},get_cancelErrorAlert:function(){return this._cancelErrorAlert;
},set_cancelErrorAlert:function(a){this._cancelErrorAlert=a;
}};
Telerik.Web.UI.ToolTipManagerErrorEventArgs.registerClass("Telerik.Web.UI.ToolTipManagerErrorEventArgs",Sys.EventArgs);
createRadEventArgs("RadToolTipManagerErrorEventArgs",Telerik.Web.UI.ToolTipManagerErrorEventArgs);