1
function TOOLTIP(divid)
7
this.xincr=10,yincr=10;
8
this.animateToolTip = false;
9
this.isAnimated = false/*true*/;
16
TOOLTIP.prototype.SetHTML = function(strHTML){
18
this.div.innerHTML=html;
21
TOOLTIP.prototype.Hide = function(){
22
this.div.style.display='none';
23
this.div.style.height= "0px";
24
this.div.style.width= "0px";
26
if(this.det)this.SetHTML("Loading...");
29
TOOLTIP.prototype.Show = function(e,dl_id,det){
32
if(this.visible != false) {
36
if(this.isInit != true) return;
38
var height,width,newPosx,newPosy, coordX, coordY;
39
if(typeof( document.documentElement.clientWidth ) == 'number' ){
40
width = document.body.clientWidth;
41
height = document.body.clientHeight;
43
width = parseInt(window.innerWidth);
44
height = parseInt(window.innerHeight);
47
var positions = getPosition(e);
52
if((coordX > this.divWidth+20) )
53
newPosx = coordX-this.divWidth-20;
55
newPosx = coordX-this.divWidth+60;
57
if(this.divHeight + 40 < coordY)
58
newPosy= coordY-this.divHeight-40;
63
this.div.style.display='block';
64
this.div.style.top= newPosy + "px";
65
this.div.style.left= newPosx + "px"
66
this.div.style.height= this.divHeight + "px";
67
this.div.style.width= this.divWidth + "px";
68
if(!this.det)this.div.style.backgroundImage = "url(tmp/downloads/images/"+dl_id+".png)";
70
if(this.det)adei.UpdateDIV(this.div, "services/download.php?target=dlmanager_details&dl_id="+dl_id, "downloaddetails", false);
71
if(this.animateToolTip) {
72
this.div.style.height= "0px";
73
this.div.style.width= "0px";
74
tooltipAnimate(this.div.id,this.divHeight,this.divWidth);
79
function getPosition(e) {
80
e = e || window.event;
81
var positions = {x:0, y:0};
82
if (e.pageX || e.pageY) {
83
positions.x = e.pageX;
84
positions.y = e.pageY;
87
var de = document.documentElement;
88
var b = document.body;
89
positions.x = e.clientX +
90
(de.scrollLeft || b.scrollLeft) - (de.clientLeft || 0);
91
positions.y = e.clientY +
92
(de.scrollTop || b.scrollTop) - (de.clientTop || 0);
97
TOOLTIP.prototype.Init = function(id){
98
this.div = document.getElementById(id);
99
if(this.div==null) return;
101
if((this.div.style.width=="" || this.div.style.height=="")){
102
alert("Error: Downloadmanager graph div needs width and height");
106
this.divWidth = parseInt(this.div.style.width);
107
this.divHeight= parseInt(this.div.style.height);
108
if(this.div.style.visibility!="visible")this.div.style.visibility="visible";
109
if(this.div.style.display!="none")this.div.style.display="none";
110
if(this.div.style.position!="absolute")this.div.style.position="absolute";
112
if(this.isAnimated && this.aniSpeed > 0){
113
xincr = parseInt(divWidth/this.aniSpeed);
114
yincr = parseInt(divHeight/this.aniSpeed);
115
this.animateToolTip = true;
123
function tooltipAnimate(a,aheight,awidth){
124
a = document.getElementById(a);
125
var tw = parseInt(a.style.width)+xincr ;
126
var th = parseInt(a.style.height)+yincr;
129
a.style.width = tw+"px";
132
a.style.width = awidth+"px";
136
a.style.height = th+"px";
139
a.style.height = aheight+"px";
142
if(!((tw > awidth) && (th > aheight)))
143
setTimeout( "tooltipAnimate('"+a.id+"',"+aheight+","+awidth+")",1);