'
+ ''
+ tt_aV[TITLE]
+ ''
+ (tt_aV[CLOSEBTN] ?
(''
+ ''
+ tt_aV[CLOSEBTNTEXT]
+ ' | ')
: '')
+ ' ')
: '')
+ ''
+ (tt_aV[SHADOW]
? (''
+ '')
: '')
);
tt_GetSubDivRefs();
// Convert DOM node to tip
if(tt_t2t && !tt_aV[COPYCONTENT])
{
// Store the tag's parent element so we can restore that DOM branch
// once the tooltip is hidden
tt_t2tDad = tt_t2t.parentNode || tt_t2t.parentElement || tt_t2t.offsetParent || null;
if(tt_t2tDad)
{
tt_MovDomNode(tt_t2t, tt_t2tDad, tt_aElt[6]);
tt_t2t.style.display = "block";
}
}
tt_ExtCallFncs(0, "SubDivsCreated");
}
function tt_GetSubDivRefs()
{
var aId = new Array("WzTiTl", "WzTiTlTb", "WzTiTlI", "WzClOsE", "WzBoDy", "WzBoDyI", "WzTtShDwB", "WzTtShDwR");
for(var i = aId.length; i; --i)
tt_aElt[i] = tt_GetElt(aId[i - 1]);
}
function tt_FormatTip()
{
var css, w, iOffY, iOffSh;
//--------- Title DIV ----------
if(tt_aV[TITLE].length)
{
css = tt_aElt[1].style;
css.background = tt_aV[TITLEBGCOLOR];
css.paddingTop = (tt_aV[CLOSEBTN] ? 2 : 0) + "px";
css.paddingBottom = "1px";
css.paddingLeft = css.paddingRight = tt_aV[PADDING] + "px";
css = tt_aElt[3].style;
css.color = tt_aV[TITLEFONTCOLOR];
css.fontFamily = tt_aV[TITLEFONTFACE];
css.fontSize = tt_aV[TITLEFONTSIZE];
css.fontWeight = "bold";
css.textAlign = tt_aV[TITLEALIGN];
// Close button DIV
if(tt_aElt[4])
{
css.paddingRight = (tt_aV[PADDING] << 1) + "px";
css = tt_aElt[4].style;
css.background = tt_aV[CLOSEBTNCOLORS][0];
css.color = tt_aV[CLOSEBTNCOLORS][1];
css.fontFamily = tt_aV[TITLEFONTFACE];
css.fontSize = tt_aV[TITLEFONTSIZE];
css.fontWeight = "bold";
}
if(tt_aV[WIDTH] > 0)
tt_w = tt_aV[WIDTH] + ((tt_aV[PADDING] + tt_aV[BORDERWIDTH]) << 1);
else
{
tt_w = tt_GetDivW(tt_aElt[3]) + tt_GetDivW(tt_aElt[4]);
// Some spacing between title DIV and closebutton
if(tt_aElt[4])
tt_w += tt_aV[PADDING];
}
// Ensure the top border of the body DIV be covered by the title DIV
iOffY = -tt_aV[BORDERWIDTH];
}
else
{
tt_w = 0;
iOffY = 0;
}
//-------- Body DIV ------------
css = tt_aElt[5].style;
css.top = iOffY + "px";
if(tt_aV[BORDERWIDTH])
{
css.borderColor = tt_aV[BORDERCOLOR];
css.borderStyle = tt_aV[BORDERSTYLE];
css.borderWidth = tt_aV[BORDERWIDTH] + "px";
}
if(tt_aV[BGCOLOR].length)
css.background = tt_aV[BGCOLOR];
if(tt_aV[BGIMG].length)
css.backgroundImage = "url(" + tt_aV[BGIMG] + ")";
css.padding = tt_aV[PADDING] + "px";
css.textAlign = tt_aV[TEXTALIGN];
// TD inside body DIV
css = tt_aElt[6].style;
css.color = tt_aV[FONTCOLOR];
css.fontFamily = tt_aV[FONTFACE];
css.fontSize = tt_aV[FONTSIZE];
css.fontWeight = tt_aV[FONTWEIGHT];
css.background = "";
css.textAlign = tt_aV[TEXTALIGN];
if(tt_aV[WIDTH] > 0)
w = tt_aV[WIDTH] + ((tt_aV[PADDING] + tt_aV[BORDERWIDTH]) << 1);
else
// We measure the width of the body's inner TD, because some browsers
// expand the width of the container and outer body DIV to 100%
w = tt_GetDivW(tt_aElt[6]) + ((tt_aV[PADDING] + tt_aV[BORDERWIDTH]) << 1);
if(w > tt_w)
tt_w = w;
//--------- Shadow DIVs ------------
if(tt_aV[SHADOW])
{
tt_w += tt_aV[SHADOWWIDTH];
iOffSh = Math.floor((tt_aV[SHADOWWIDTH] * 4) / 3);
// Bottom shadow
css = tt_aElt[7].style;
css.top = iOffY + "px";
css.left = iOffSh + "px";
css.width = (tt_w - iOffSh - tt_aV[SHADOWWIDTH]) + "px";
css.height = tt_aV[SHADOWWIDTH] + "px";
css.background = tt_aV[SHADOWCOLOR];
// Right shadow
css = tt_aElt[8].style;
css.top = iOffSh + "px";
css.left = (tt_w - tt_aV[SHADOWWIDTH]) + "px";
css.width = tt_aV[SHADOWWIDTH] + "px";
css.background = tt_aV[SHADOWCOLOR];
}
else
iOffSh = 0;
//-------- Container DIV -------
tt_SetTipOpa(tt_aV[FADEIN] ? 0 : tt_aV[OPACITY]);
tt_FixSize(iOffY, iOffSh);
}
// Fixate the size so it can't dynamically change while the tooltip is moving.
function tt_FixSize(iOffY, iOffSh)
{
var wIn, wOut, i;
tt_aElt[0].style.width = tt_w + "px";
tt_aElt[0].style.pixelWidth = tt_w;
wOut = tt_w - ((tt_aV[SHADOW]) ? tt_aV[SHADOWWIDTH] : 0);
// Body
wIn = wOut;
if(!tt_bBoxOld)
wIn -= ((tt_aV[PADDING] + tt_aV[BORDERWIDTH]) << 1);
tt_aElt[5].style.width = wIn + "px";
// Title
if(tt_aElt[1])
{
wIn = wOut - (tt_aV[PADDING] << 1);
if(!tt_bBoxOld)
wOut = wIn;
tt_aElt[1].style.width = wOut + "px";
tt_aElt[2].style.width = wIn + "px";
}
tt_h = tt_GetDivH(tt_aElt[0]) + iOffY;
// Right shadow
if(tt_aElt[8])
tt_aElt[8].style.height = (tt_h - iOffSh) + "px";
i = tt_aElt.length - 1;
if(tt_aElt[i])
{
tt_aElt[i].style.width = tt_w + "px";
tt_aElt[i].style.height = tt_h + "px";
}
}
function tt_DeAlt(el)
{
var aKid;
if(el.alt)
el.alt = "";
if(el.title)
el.title = "";
aKid = el.childNodes || el.children || null;
if(aKid)
{
for(var i = aKid.length; i;)
tt_DeAlt(aKid[--i]);
}
}
// This hack removes the annoying native tooltips over links in Opera
function tt_OpDeHref(el)
{
if(!tt_op)
return;
if(tt_elDeHref)
tt_OpReHref();
while(el)
{
if(el.hasAttribute("href"))
{
el.t_href = el.getAttribute("href");
el.t_stats = window.status;
el.removeAttribute("href");
el.style.cursor = "hand";
tt_AddEvtFnc(el, "mousedown", tt_OpReHref);
window.status = el.t_href;
tt_elDeHref = el;
break;
}
el = el.parentElement;
}
}
function tt_ShowInit()
{
tt_tShow.Timer("tt_Show()", tt_aV[DELAY], true);
if(tt_aV[CLICKCLOSE])
tt_AddEvtFnc(document, "mouseup", tt_HideInit);
}
function tt_OverInit(e)
{
tt_over = e.target || e.srcElement;
tt_DeAlt(tt_over);
tt_OpDeHref(tt_over);
tt_AddRemOutFnc(true);
}
function tt_Show()
{
var css = tt_aElt[0].style;
// Override the z-index of the topmost wz_dragdrop.js D&D item
css.zIndex = Math.max((window.dd && dd.z) ? (dd.z + 2) : 0, 1010);
if(tt_aV[STICKY] || !tt_aV[FOLLOWMOUSE])
tt_iState &= ~0x4;
if(tt_aV[DURATION] > 0)
tt_tDurt.Timer("tt_HideInit()", tt_aV[DURATION], true);
tt_ExtCallFncs(0, "Show")
css.visibility = "visible";
tt_iState |= 0x2;
if(tt_aV[FADEIN])
tt_Fade(0, 0, tt_aV[OPACITY], Math.round(tt_aV[FADEIN] / tt_aV[FADEINTERVAL]));
tt_ShowIfrm();
}
function tt_ShowIfrm()
{
if(tt_ie56)
{
var ifrm = tt_aElt[tt_aElt.length - 1];
if(ifrm)
{
var css = ifrm.style;
css.zIndex = tt_aElt[0].style.zIndex - 1;
css.display = "block";
}
}
}
function tt_Move(e)
{
e = window.event || e;
if(e)
{
tt_musX = tt_GetEvtX(e);
tt_musY = tt_GetEvtY(e);
}
if(tt_iState)
{
if(!tt_over && e)
tt_OverInit(e);
if(tt_iState & 0x4)
{
// Protect some browsers against jam of mousemove events
if(!tt_op && !tt_ie)
{
if(tt_bWait)
return;
tt_bWait = true;
tt_tWaitMov.Timer("tt_bWait = false;", 1, true);
}
if(tt_aV[FIX])
{
tt_iState &= ~0x4;
tt_SetTipPos(tt_aV[FIX][0], tt_aV[FIX][1]);
}
else if(!tt_ExtCallFncs(e, "MoveBefore"))
tt_SetTipPos(tt_PosX(), tt_PosY());
tt_ExtCallFncs([tt_musX, tt_musY], "MoveAfter")
}
}
}
function tt_PosX()
{
var x;
x = tt_musX;
if(tt_aV[LEFT])
x -= tt_w + tt_aV[OFFSETX] - (tt_aV[SHADOW] ? tt_aV[SHADOWWIDTH] : 0);
else
x += tt_aV[OFFSETX];
// Prevent tip from extending past right/left clientarea boundary
if(x > tt_maxPosX)
x = tt_maxPosX;
return((x < tt_scrlX) ? tt_scrlX : x);
}
function tt_PosY()
{
var y;
// Apply some hysteresis after the tip has snapped to the other side of the
// mouse. In case of insufficient space above and below the mouse, we place
// the tip below.
if(tt_aV[ABOVE] && (!tt_bJmpVert || tt_CalcPosYAbove() >= tt_scrlY + 16))
y = tt_DoPosYAbove();
else if(!tt_aV[ABOVE] && tt_bJmpVert && tt_CalcPosYBelow() > tt_maxPosY - 16)
y = tt_DoPosYAbove();
else
y = tt_DoPosYBelow();
// Snap to other side of mouse if tip would extend past window boundary
if(y > tt_maxPosY)
y = tt_DoPosYAbove();
if(y < tt_scrlY)
y = tt_DoPosYBelow();
return y;
}
function tt_DoPosYBelow()
{
tt_bJmpVert = tt_aV[ABOVE];
return tt_CalcPosYBelow();
}
function tt_DoPosYAbove()
{
tt_bJmpVert = !tt_aV[ABOVE];
return tt_CalcPosYAbove();
}
function tt_CalcPosYBelow()
{
return(tt_musY + tt_aV[OFFSETY]);
}
function tt_CalcPosYAbove()
{
var dy = tt_aV[OFFSETY] - (tt_aV[SHADOW] ? tt_aV[SHADOWWIDTH] : 0);
if(tt_aV[OFFSETY] > 0 && dy <= 0)
dy = 1;
return(tt_musY - tt_h - dy);
}
function tt_OnOut()
{
tt_AddRemOutFnc(false);
if(!(tt_aV[STICKY] && (tt_iState & 0x2)))
tt_HideInit();
}
function tt_HideInit()
{
tt_ExtCallFncs(0, "HideInit");
tt_iState &= ~0x4;
if(tt_flagOpa && tt_aV[FADEOUT])
{
tt_tFade.EndTimer();
if(tt_opa)
{
var n = Math.round(tt_aV[FADEOUT] / (tt_aV[FADEINTERVAL] * (tt_aV[OPACITY] / tt_opa)));
tt_Fade(tt_opa, tt_opa, 0, n);
return;
}
}
tt_tHide.Timer("tt_Hide();", 1, false);
}
function tt_OpReHref()
{
if(tt_elDeHref)
{
tt_elDeHref.setAttribute("href", tt_elDeHref.t_href);
tt_RemEvtFnc(tt_elDeHref, "mousedown", tt_OpReHref);
window.status = tt_elDeHref.t_stats;
tt_elDeHref = null;
}
}
function tt_Fade(a, now, z, n)
{
if(n)
{
now += Math.round((z - now) / n);
if((z > a) ? (now >= z) : (now <= z))
now = z;
else
tt_tFade.Timer("tt_Fade("
+ a + "," + now + "," + z + "," + (n - 1)
+ ")",
tt_aV[FADEINTERVAL],
true);
}
now ? tt_SetTipOpa(now) : tt_Hide();
}
// To circumvent the opacity nesting flaws of IE, we set the opacity
// for each sub-DIV separately, rather than for the container DIV.
function tt_SetTipOpa(opa)
{
tt_SetOpa(tt_aElt[5].style, opa);
if(tt_aElt[1])
tt_SetOpa(tt_aElt[1].style, opa);
if(tt_aV[SHADOW])
{
opa = Math.round(opa * 0.8);
tt_SetOpa(tt_aElt[7].style, opa);
tt_SetOpa(tt_aElt[8].style, opa);
}
}
function tt_OnCloseBtnOver(iOver)
{
var css = tt_aElt[4].style;
iOver <<= 1;
css.background = tt_aV[CLOSEBTNCOLORS][iOver];
css.color = tt_aV[CLOSEBTNCOLORS][iOver + 1];
}
function tt_Int(x)
{
var y;
return(isNaN(y = parseInt(x)) ? 0 : y);
}
// Adds or removes the document.mousemove or HoveredElem.mouseout handler
// conveniently. Keeps track of those handlers to prevent them from being
// set or removed redundantly.
function tt_AddRemOutFnc(bAdd)
{
var PSet = bAdd ? tt_AddEvtFnc : tt_RemEvtFnc;
if(bAdd != tt_AddRemOutFnc.bOn)
{
PSet(tt_over, "mouseout", tt_OnOut);
tt_AddRemOutFnc.bOn = bAdd;
if(!bAdd)
tt_OpReHref();
}
}
tt_AddRemOutFnc.bOn = false;
Number.prototype.Timer = function(s, iT, bUrge)
{
if(!this.value || bUrge)
this.value = window.setTimeout(s, iT);
}
Number.prototype.EndTimer = function()
{
if(this.value)
{
window.clearTimeout(this.value);
this.value = 0;
}
}
function tt_SetOpa(css, opa)
{
tt_opa = opa;
if(tt_flagOpa == 1)
{
// Hack for bugs of IE:
// A DIV cannot be made visible in a single step if an opacity < 100
// has been applied while the DIV was hidden.
// Moreover, in IE6, applying an opacity < 100 has no effect if the
// concerned element has no layout (position, size, zoom, ...).
if(opa < 100)
{
var bVis = css.visibility != "hidden";
css.zoom = "100%";
if(!bVis)
css.visibility = "visible";
css.filter = "alpha(opacity=" + opa + ")";
if(!bVis)
css.visibility = "hidden";
}
else
css.filter = "";
}
else
{
opa /= 100.0;
switch(tt_flagOpa)
{
case 2:
css.KhtmlOpacity = opa; break;
case 3:
css.KHTMLOpacity = opa; break;
case 4:
css.MozOpacity = opa; break;
case 5:
css.opacity = opa; break;
}
}
}
function tt_MovDomNode(el, dadFrom, dadTo)
{
if(dadFrom)
dadFrom.removeChild(el);
if(dadTo)
dadTo.appendChild(el);
}
function tt_Err(sErr)
{
if(tt_Debug)
alert("Tooltip Script Error Message:\n\n" + sErr);
}
//=========== DEALING WITH EXTENSIONS ==============//
function tt_ExtCmdEnum()
{
var s;
// Add new command(s) to the commands enum
for(var i in config)
{
s = "window." + i.toString().toUpperCase();
if(eval("typeof(" + s + ") == tt_u"))
{
eval(s + " = " + tt_aV.length);
tt_aV[tt_aV.length] = null;
}
}
}
function tt_ExtCallFncs(arg, sFnc)
{
var b = false;
for(var i = tt_aExt.length; i;)
{--i;
var fnc = tt_aExt[i]["On" + sFnc];
// Call the method the extension has defined for this event
if(fnc && fnc(arg))
b = true;
}
return b;
}
tt_Init();
|