TooltipManager={options:{cssClassName:"tooltip",delayOver:200,delayOut:1000,shiftX:10,shiftY:10,className:"alphacube",width:200,height:null,draggable:false,minimizable:false,maximizable:false,showEffect:Element.show,hideEffect:Element.hide},ajaxInfo:null,elements:null,showTimer:null,hideTimer:null,init:function(_1,_2,_3){
TooltipManager.options=Object.extend(TooltipManager.options,_3||{});
_1=TooltipManager.options.cssClassName||"tooltip";
TooltipManager.ajaxInfo=_2;
TooltipManager.elements=$$("."+_1);
TooltipManager.elements.each(function(_4){
_4=$(_4);
var _5=TooltipManager._getInfo(_4);
if(_5.ajax){
_4.ajaxId=_5.id;
_4.ajaxInfo=_2;
}else{
_4.tooltipElement=$(_5.id);
}
_4.observe("mouseover",TooltipManager._mouseOver);
_4.observe("mouseout",TooltipManager._mouseOut);
});
Windows.addObserver(this);
},addHTML:function(_6,_7){
_6=$(_6);
_7=$(_7);
_6.tooltipElement=_7;
_6.observe("mouseover",TooltipManager._mouseOver);
_6.observe("mouseout",TooltipManager._mouseOut);
},addAjax:function(_8,_9){
_8=$(_8);
_8.ajaxInfo=_9;
_8.observe("mouseover",TooltipManager._mouseOver);
_8.observe("mouseout",TooltipManager._mouseOut);
},addURL:function(_a,_b,_c,_d){
_a=$(_a);
_a.url=_b;
_a.frameWidth=_c;
_a.frameHeight=_d;
_a.observe("mouseover",TooltipManager._mouseOver);
_a.observe("mouseout",TooltipManager._mouseOut);
},close:function(){
if(TooltipManager.tooltipWindow){
TooltipManager.tooltipWindow.hide();
}
},preloadImages:function(_e,_f,_10){
if(!_10){
_10=".gif";
}
$A(_f).each(function(i){
var _12=new Image();
_12.src=_e+"/"+i+_10;
});
},_showTooltip:function(_13){
if(this.element==_13){
return;
}
while(_13&&(!_13.tooltipElement&&!_13.ajaxInfo&&!_13.url)){
_13=_13.parentNode;
}
this.element=_13;
TooltipManager.showTimer=null;
if(TooltipManager.hideTimer){
clearTimeout(TooltipManager.hideTimer);
}
var _14=Position.cumulativeOffset(_13);
var _15=_13.getDimensions();
if(!this.tooltipWindow){
this.tooltipWindow=new Window("__tooltip__",TooltipManager.options);
}
this.tooltipWindow.hide();
this.tooltipWindow.setLocation(_14[1]+_15.height+TooltipManager.options.shiftY,_14[0]+TooltipManager.options.shiftX);
Event.observe(this.tooltipWindow.element,"mouseover",function(_16){
TooltipManager._tooltipOver(_16,_13);
});
Event.observe(this.tooltipWindow.element,"mouseout",function(_17){
TooltipManager._tooltipOut(_17,_13);
});
this.tooltipWindow.height=TooltipManager.options.height;
this.tooltipWindow.width=TooltipManager.options.width;
if(_13.ajaxInfo){
var p=_13.ajaxInfo.options.parameters;
var _19=p;
if(_13.ajaxId){
if(p){
p+="&id="+_13.ajaxId;
}else{
p="id="+_13.ajaxId;
}
}
_13.ajaxInfo.options.parameters=p||"";
this.tooltipWindow.setHTMLContent("");
this.tooltipWindow.setAjaxContent(_13.ajaxInfo.url,_13.ajaxInfo.options);
_13.ajaxInfo.options.parameters=_19;
}else{
if(_13.url){
this.tooltipWindow.setURL(_13.url);
this.tooltipWindow.setSize(_13.frameWidth,_13.frameHeight);
this.tooltipWindow.height=_13.frameHeight;
this.tooltipWindow.width=_13.frameWidth;
}else{
this.tooltipWindow.setHTMLContent(_13.tooltipElement.innerHTML);
}
}
if(!_13.ajaxInfo){
this.tooltipWindow.show();
this.tooltipWindow.toFront();
}
},_hideTooltip:function(_1a){
if(this.tooltipWindow){
this.tooltipWindow.hide();
this.element=null;
}
},_mouseOver:function(_1b){
var _1c=Event.element(_1b);
if(TooltipManager.showTimer){
clearTimeout(TooltipManager.showTimer);
}
TooltipManager.showTimer=setTimeout(function(){
TooltipManager._showTooltip(_1c);
},TooltipManager.options.delayOver);
},_mouseOut:function(_1d){
var _1e=Event.element(_1d);
if(TooltipManager.showTimer){
clearTimeout(TooltipManager.showTimer);
TooltipManager.showTimer=null;
return;
}
if(TooltipManager.tooltipWindow){
TooltipManager.hideTimer=setTimeout(function(){
TooltipManager._hideTooltip(_1e);
},TooltipManager.options.delayOut);
}
},_tooltipOver:function(_1f,_20){
if(TooltipManager.hideTimer){
clearTimeout(TooltipManager.hideTimer);
TooltipManager.hideTimer=null;
}
},_tooltipOut:function(_21,_22){
if(TooltipManager.hideTimer==null){
TooltipManager.hideTimer=setTimeout(function(){
TooltipManager._hideTooltip(_22);
},TooltipManager.options.delayOut);
}
},_getInfo:function(_23){
var id=_23.className.split(" ").detect(function(_25){
return _25.indexOf("html_")==0;
});
var _26=true;
if(id){
_26=false;
}else{
id=_23.className.split(" ").detect(function(_27){
return _27.indexOf("ajax_")==0;
});
}
id=id.substr(id.indexOf("_")+1,id.length);
return id?{ajax:_26,id:id}:null;
},onBeforeShow:function(_28,win){
var top=parseFloat(win.getLocation().top);
var dim=win.element.getDimensions();
if(top+dim.height>TooltipManager._getScrollTop()+TooltipManager._getPageHeight()){
var _2c=Position.cumulativeOffset(this.element);
var top=_2c[1]-TooltipManager.options.shiftY-dim.height;
win.setLocation(top,_2c[0]+TooltipManager.options.shiftX);
}
},_getPageWidth:function(){
return window.innerWidth||document.documentElement.clientWidth||0;
},_getPageHeight:function(){
return window.innerHeight||document.documentElement.clientHeight||0;
},_getScrollTop:function(){
return document.documentElement.scrollTop||window.pageYOffset||0;
},_getScrollLeft:function(){
return document.documentElement.scrollLeft||window.pageXOffset||0;
}};
