﻿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=false;
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();
if(this._pageLoadedHandler){
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(){
if(Sys.WebForms){
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();
},getToolTipByElement:function(_10){
if(!_10){
return null;
}
var _11=this.get_tooltips();
try{
for(var i=0;i<_11.length;i++){
if(_11[i].get_targetControl()==_10){
return _11[i];
}
}
}
catch(ex){
}
return null;
},createToolTip:function(_13,_14,_15){
var _16=_13.getAttribute("title");
_13.removeAttribute("title");
var _17=this.clone(_13,this._getUniqueToolTipID());
this._tooltips[this._tooltips.length]=_17;
if(_14&&_14!=_13.getAttribute("id")){
_17.set_serverTargetControlID(_14);
}
if(_15){
_17.set_serverValue(_15);
}
if(this._loadOnDemand){
this._initializeAjaxToolTip(_17);
}else{
if(this._webServiceSettings){
this._initializeWebServiceToolTip(_17);
}else{
var _18=this.get_text();
if(!_18){
_18=_16;
}
_17.set_text(_18);
}
}
return _17;
},tooltipify:function(_19,_1a){
if(!_19){
_19=document;
}
if(!_1a){
_1a=function(_1b,_1c){
return true;
};
}
var _1d=this.get_targetControls();
if(_1d.length>0){
var _1e=_1d.length;
for(var i=0;i<_1e;i++){
var _20=_1d[i];
var _21=$get(_20[0]);
if(_21&&_1a(_19,_21)){
this.createToolTip(_21,_20[1],_20[2]);
}
}
}else{
if(!this.get_autoTooltipify()){
return;
}
var _1d=_19.getElementsByTagName("*");
var _1e=_1d.length;
for(var i=0;i<_1e;i++){
var _21=_1d[i];
var _22=_21.getAttribute("title");
var alt=_21.getAttribute("alt");
if(_22||alt){
if(!_22){
_21.setAttribute("title",alt);
_21.removeAttribute("alt");
}else{
if(alt){
_21.removeAttribute("alt");
}
}
this.createToolTip(_21);
}
}
}
},_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(_24,_25){
var _26=_25.get_message();
alert(_26);
},_onWebServiceResponse:function(_27,_28){
var _29=_28.get_data();
var div=document.createElement("DIV");
div.innerHTML=_29;
if(this._currentServicedToolTip){
this._currentServicedToolTip.set_contentElement(div);
}
this.raiseEvent("requestEnd");
},_initializeWebServiceToolTip:function(_2b){
_2b.add_beforeShow(Function.createDelegate(this,function(_2c,_2d){
if(!this._webServiceLoader){
this._initializeWebServiceLoader();
}
var _2e={TargetControlID:_2b.get_targetControlID(),Value:_2b.get_serverValue()};
this._currentServicedToolTip=_2c;
this._webServiceLoader.loadData({context:_2e});
_2c.set_content("");
_2c.showLoadingMessage(true);
}));
},_initializeAjaxToolTip:function(_2f){
_2f.add_beforeShow(Function.createDelegate(this,function(_30,_31){
this._doLoadOnDemand(_30);
}));
_2f.add_hide(Function.createDelegate(this,function(_32,_33){
var _34=this.get_updatePanel();
var _35=_32.get_popupElement();
var _36=$telerik.isDescendant(_35,_34);
if(_36){
this._moveUpdatePanel();
}
}));
},_doLoadOnDemand:function(_37){
var _38=this._getDefaultParent();
var _39=this._moveUpdatePanel(_38,true);
_37.showLoadingMessage(true);
var prm=Sys.WebForms.PageRequestManager.getInstance();
var _3b=Function.createDelegate(this,function(){
_37.set_contentElement(_39);
prm.remove_endRequest(_3b);
this.raiseEvent("requestEnd");
});
prm.add_endRequest(_3b);
var _3c=_37.get_serverTargetControlID();
if(!_3c){
_3c=_37.get_targetControlID();
}
this._ajaxControlID=_3c;
this._ajaxValue=_37.get_serverValue();
this.updateClientState();
__doPostBack(this._getUpdatePanelID());
this._ajaxControlID=null;
this._ajaxValue=null;
},saveClientState:function(){
var _3d={AjaxTargetControl:this._ajaxControlID,Value:this._ajaxValue};
return Sys.Serialization.JavaScriptSerializer.serialize(_3d);
},_getUpdatePanelID:function(){
return this.get_id()+"RTMPanel";
},_getUniqueToolTipID:function(){
this._idCounter++;
return (this.get_id()+this._idCounter+(new Date()-100));
},_moveUpdatePanel:function(_3e,_3f){
if(!_3e){
_3e=this._updatePanelParent;
}
if(_3e&&_3e.appendChild){
var _40=this.get_updatePanel();
if(_40){
if(false!=_3f){
_40.style.display="none";
}
_3e.appendChild(_40);
}
return _40;
}
},get_webServiceLoader:function(){
return this._webServiceLoader;
},get_webServiceSettings:function(){
return this._webServiceSettings;
},set_webServiceSettings:function(_41){
var _42=Sys.Serialization.JavaScriptSerializer.deserialize(_41);
this._webServiceSettings=new Telerik.Web.UI.WebServiceSettings(_42);
},get_autoTooltipify:function(){
return this._autoTooltipify;
},set_autoTooltipify:function(_43){
if(this._autoTooltipify!=_43){
this._autoTooltipify=_43;
}
},get_toolTipZoneID:function(){
return this._toolTipZoneID;
},set_toolTipZoneID:function(_44){
if(this._toolTipZoneID!=_44){
this._toolTipZoneID=_44;
}
},get_isToolTipFactory:function(){
return this._isToolTipFactory;
},set_isToolTipFactory:function(_45){
if(this._isToolTipFactory!=_45){
this._isToolTipFactory=_45;
}
},get_loadOnDemand:function(){
return this._loadOnDemand;
},set_loadOnDemand:function(_46){
if(this._loadOnDemand!=_46){
this._loadOnDemand=_46;
}
},get_targetControls:function(){
return this._targetControls;
},set_targetControls:function(_47){
if(!_47){
this._targetControls=[];
}else{
this._targetControls=eval(_47);
}
},add_requestEnd:function(_48){
this.get_events().addHandler("requestEnd",_48);
},remove_requestEnd:function(_49){
this.get_events().removeHandler("requestEnd",_49);
}};
Telerik.Web.UI.RadToolTipManager.registerClass("Telerik.Web.UI.RadToolTipManager",Telerik.Web.UI.RadToolTip);


if(typeof(Sys)!=='undefined')Sys.Application.notifyScriptLoaded();