1var wzconfig = new Object(); 2var tt_Debug = true 3var tt_Enabled = true 4var TagsToTip = true 5wzconfig. Above = false 6wzconfig. BgColor = '#FFFFFF' 7wzconfig. BgImg = '' 8wzconfig. BorderColor = '#DDDDDD' 9wzconfig. BorderStyle = 'solid' 10wzconfig. BorderWidth = 1 11wzconfig. CenterMouse = false 12wzconfig. ClickClose = false 13wzconfig. CloseBtn = false 14wzconfig. CloseBtnColors = ['#333333', '#FFFFFF', '#333333', '#FFFFFF'] 15wzconfig. CloseBtnText = ' X ' 16wzconfig. CopyContent = true 17wzconfig. Delay = 100 18wzconfig. Duration = 0 19wzconfig. FadeIn = 0 20wzconfig. FadeOut = 0 21wzconfig. FadeInterval = 30 22wzconfig. Fix = null 23wzconfig. FollowMouse = true 24wzconfig. FontColor = '#000044' 25wzconfig. FontFace = 'Arial,Verdana,Geneva,sans-serif' 26wzconfig. FontSize = '8pt' 27wzconfig. FontWeight = 'normal' 28wzconfig. Left = false 29wzconfig. OffsetX = 8 30wzconfig. OffsetY = 8 31wzconfig. Opacity = 90 32wzconfig. Padding = 3 33wzconfig. Shadow = false 34wzconfig. ShadowColor = '#EFEFEF' 35wzconfig. ShadowWidth = 3 36wzconfig. Sticky = false 37wzconfig. TextAlign = 'left' 38wzconfig. Title = ''
39wzconfig. TitleAlign = 'left' 40wzconfig. TitleBgColor = '' 41wzconfig. TitleFontColor = '#575757' 42wzconfig. TitleFontFace = 'Arial' 43wzconfig. TitleFontSize = '10px' 44wzconfig. Width = 0 45function Tip() 46{ 47 tt_Tip(arguments, null); 48} 49function TagToTip() 50{ 51 if(TagsToTip) 52 { 53 var t2t = tt_GetElt(arguments[0]); 54 if(t2t) 55 tt_Tip(arguments, t2t); 56 } 57} 58var tt_aElt = new Array(10), 59tt_aV = new Array(), 60tt_sContent, 61tt_scrlX = 0, tt_scrlY = 0, 62tt_musX, tt_musY, 63tt_over, 64tt_x, tt_y, tt_w, tt_h; 65function tt_Extension() 66{ 67 tt_ExtCmdEnum(); 68 tt_aExt[tt_aExt.length] = this; 69 return this; 70} 71function tt_SetTipPos(x, y) 72{ var css = tt_aElt[0].style; 73 tt_x = x; 74 tt_y = y; 75 css.left = x + "px"; 76 css.top = y + "px"; 77 if(tt_ie56) 78 { 79 var ifrm = tt_aElt[tt_aElt.length - 1]; 80 if(ifrm) 81 { 82 ifrm.style.left = css.left; 83 ifrm.style.top = css.top; 84 } 85 } 86} 87function tt_Hide() 88{ 89 if(tt_db && tt_iState) 90 { 91 if(tt_iState & 0x2) 92 { 93 tt_aElt[0].style.visibility = "hidden"; 94 tt_ExtCallFncs(0, "Hide"); 95 } 96 tt_tShow.EndTimer(); 97 tt_tHide.EndTimer(); 98 tt_tDurt.EndTimer(); 99 tt_tFade.EndTimer(); 100 if(!tt_op && !tt_ie) 101 { 102 tt_tWaitMov.EndTimer(); 103 tt_bWait = false; 104 } 105 if(tt_aV[CLICKCLOSE]) 106 tt_RemEvtFnc(document, "mouseup", tt_HideInit); 107 tt_AddRemOutFnc(false); 108 tt_ExtCallFncs(0, "Kill"); 109 if(tt_t2t && !tt_aV[COPYCONTENT]) 110 { 111 tt_t2t.style.display = "none"; 112 tt_MovDomNode(tt_t2t, tt_aElt[6], tt_t2tDad); 113 } 114 tt_iState = 0; 115 tt_over = null; 116 tt_ResetMainDiv(); 117 if(tt_aElt[tt_aElt.length - 1]) 118 tt_aElt[tt_aElt.length - 1].style.display = "none"; 119 } 120} 121function tt_GetElt(id) 122{ 123 return(document.getElementById ? document.getElementById(id) 124 : document.all ? document.all[id] 125 : null); 126} 127function tt_GetDivW(el) 128{ 129 return(el ? (el.offsetWidth || el.style.pixelWidth || 0) : 0); 130} 131function tt_GetDivH(el) 132{ 133 return(el ? (el.offsetHeight || el.style.pixelHeight || 0) : 0); 134} 135function tt_GetScrollX() 136{ 137 return(window.pageXOffset || (tt_db ? (tt_db.scrollLeft || 0) : 0)); 138} 139function tt_GetScrollY() 140{ 141 return(window.pageYOffset || (tt_db ? (tt_db.scrollTop || 0) : 0)); 142} 143function tt_GetClientW() 144{ 145 return(document.body && (typeof(document.body.clientWidth) != tt_u) ? document.body.clientWidth 146 : (typeof(window.innerWidth) != tt_u) ? window.innerWidth 147 : tt_db ? (tt_db.clientWidth || 0) 148 : 0); 149} 150function tt_GetClientH() 151{ 152 return(document.body && (typeof(document.body.clientHeight) != tt_u) ? document.body.clientHeight 153 : (typeof(window.innerHeight) != tt_u) ? window.innerHeight 154 : tt_db ? (tt_db.clientHeight || 0) 155 : 0); 156} 157function tt_GetEvtX(e) 158{ 159 return (e ? ((typeof(e.pageX) != tt_u) ? e.pageX : (e.clientX + tt_scrlX)) : 0); 160} 161function tt_GetEvtY(e) 162{ 163 return (e ? ((typeof(e.pageY) != tt_u) ? e.pageY : (e.clientY + tt_scrlY)) : 0); 164} 165function tt_AddEvtFnc(el, sEvt, PFnc) 166{ 167 if(el) 168 { 169 if(el.addEventListener) 170 el.addEventListener(sEvt, PFnc, false); 171 else 172 el.attachEvent("on" + sEvt, PFnc); 173 } 174} 175function tt_RemEvtFnc(el, sEvt, PFnc) 176{ 177 if(el) 178 { 179 if(el.removeEventListener) 180 el.removeEventListener(sEvt, PFnc, false); 181 else 182 el.detachEvent("on" + sEvt, PFnc); 183 } 184} 185var tt_aExt = new Array(), 186tt_db, tt_op, tt_ie, tt_ie56, tt_bBoxOld, 187tt_body, 188tt_flagOpa, 189tt_maxPosX, tt_maxPosY, 190tt_iState = 0, 191tt_opa, 192tt_bJmpVert, 193tt_t2t, tt_t2tDad, 194tt_elDeHref, 195tt_tShow = new Number(0), tt_tHide = new Number(0), tt_tDurt = new Number(0), 196tt_tFade = new Number(0), tt_tWaitMov = new Number(0), 197tt_bWait = false, 198tt_u = "undefined"; 199function tt_Init() 200{ 201 tt_MkCmdEnum(); 202 if(!tt_Browser() || !tt_MkMainDiv()) 203 return; 204 tt_IsW3cBox(); 205 tt_OpaSupport(); 206 tt_AddEvtFnc(document, "mousemove", tt_Move); 207 if(TagsToTip || tt_Debug) 208 tt_SetOnloadFnc(); 209 tt_AddEvtFnc(window, "scroll", 210 function() 211 { 212 tt_scrlX = tt_GetScrollX(); 213 tt_scrlY = tt_GetScrollY(); 214 if(tt_iState && !(tt_aV[STICKY] && (tt_iState & 2))) 215 tt_HideInit(); 216 } ); 217 tt_AddEvtFnc(window, "unload", tt_Hide); 218 tt_Hide(); 219} 220function tt_MkCmdEnum() 221{ 222 var n = 0; 223 for(var i in wzconfig) 224 eval("window." + i.toString().toUpperCase() + " = " + n++); 225 tt_aV.length = n; 226} 227function tt_Browser() 228{ 229 var n, nv, n6, w3c; 230 n = navigator.userAgent.toLowerCase(), 231 nv = navigator.appVersion; 232 tt_op = (document.defaultView && typeof(eval("w" + "indow" + "." + "o" + "p" + "er" + "a")) != tt_u); 233 tt_ie = n.indexOf("msie") != -1 && document.all && !tt_op; 234 if(tt_ie) 235 { 236 var ieOld = (!document.compatMode || document.compatMode == "BackCompat"); 237 tt_db = !ieOld ? document.documentElement : (document.body || null); 238 if(tt_db) 239 tt_ie56 = parseFloat(nv.substring(nv.indexOf("MSIE") + 5)) >= 5.5 240 && typeof document.body.style.maxHeight == tt_u; 241 } 242 else 243 { 244 tt_db = document.documentElement || document.body || 245 (document.getElementsByTagName ? document.getElementsByTagName("body")[0] 246 : null); 247 if(!tt_op) 248 { 249 n6 = document.defaultView && typeof document.defaultView.getComputedStyle != tt_u; 250 w3c = !n6 && document.getElementById; 251 } 252 } 253 tt_body = (document.getElementsByTagName ? document.getElementsByTagName("body")[0] 254 : (document.body || null)); 255 if(tt_ie || n6 || tt_op || w3c) 256 { 257 if(tt_body && tt_db) 258 { 259 if(document.attachEvent || document.addEventListener) 260 return true; 261 } 262 else 263 tt_Err("wz_tooltip.js must be included INSIDE the body section," 264 + " immediately after the opening <body> tag."); 265 } 266 tt_db = null; 267 return false; 268} 269function tt_MkMainDiv() 270{ 271 if(tt_body.insertAdjacentHTML)
272 tt_body.insertAdjacentHTML("afterBegin", tt_MkMainDivHtm()); 273 else if(typeof tt_body.innerHTML != tt_u && document.createElement && tt_body.appendChild) 274 tt_body.appendChild(tt_MkMainDivDom()); 275 if(window.tt_GetMainDivRefs && tt_GetMainDivRefs()) 276 return true; 277 tt_db = null; 278 return false; 279} 280function tt_MkMainDivHtm() 281{ 282 return('<div id="WzTtDiV"></div>' + 283 (tt_ie56 ? ('<iframe id="WzTtIfRm" src="javascript:false" scrolling="no" frameborder="0" style="filter:Alpha(opacity=0);position:absolute;top:0px;left:0px;display:none;"></iframe>') 284 : '')); 285} 286function tt_MkMainDivDom() 287{ 288 var el = document.createElement("div"); 289 if(el) 290 el.id = "WzTtDiV"; 291 return el; 292} 293function tt_GetMainDivRefs() 294{ 295 tt_aElt[0] = tt_GetElt("WzTtDiV"); 296 if(tt_ie56 && tt_aElt[0]) 297 { 298 tt_aElt[tt_aElt.length - 1] = tt_GetElt("WzTtIfRm"); 299 if(!tt_aElt[tt_aElt.length - 1]) 300 tt_aElt[0] = null; 301 } 302 if(tt_aElt[0]) 303 { 304 var css = tt_aElt[0].style; 305 306 css.visibility = "hidden"; 307 css.position = "absolute"; 308 css.overflow = "hidden"; 309 return true; 310 } 311 return false; 312} 313function tt_ResetMainDiv() 314{ 315 var w = (window.screen && screen.width) ? screen.width : 10000; 316 317 tt_SetTipPos(-w, 0); 318 tt_aElt[0].innerHTML = ""; 319 tt_aElt[0].style.width = (w - 1) + "px"; 320} 321function tt_IsW3cBox() 322{ 323 var css = tt_aElt[0].style; 324 325 css.padding = "10px"; 326 css.width = "40px"; 327 tt_bBoxOld = (tt_GetDivW(tt_aElt[0]) == 40); 328 css.padding = "0px"; 329 tt_ResetMainDiv(); 330} 331function tt_OpaSupport() 332{ 333 var css = tt_body.style; 334 335 tt_flagOpa = (typeof(css.filter) != tt_u) ? 1 336 : (typeof(css.KhtmlOpacity) != tt_u) ? 2 337 : (typeof(css.KHTMLOpacity) != tt_u) ? 3 338 : (typeof(css.MozOpacity) != tt_u) ? 4 339 : (typeof(css.opacity) != tt_u) ? 5 340 : 0; 341} 342function tt_SetOnloadFnc() 343{ 344 tt_AddEvtFnc(document, "DOMContentLoaded", tt_HideSrcTags); 345 tt_AddEvtFnc(window, "load", tt_HideSrcTags); 346 if(tt_body.attachEvent) 347 tt_body.attachEvent("onreadystatechange", 348 function() { 349 if(tt_body.readyState == "complete") 350 tt_HideSrcTags(); 351 } ); 352 if(/WebKit|KHTML/i.test(navigator.userAgent)) 353 { 354 var t = setInterval(function() { 355 if(/loaded|complete/.test(document.readyState)) 356 { 357 clearInterval(t); 358 tt_HideSrcTags(); 359 } 360 }, 10); 361 } 362} 363function tt_HideSrcTags() 364{ 365 if(!window.tt_HideSrcTags || window.tt_HideSrcTags.done) 366 return; 367 window.tt_HideSrcTags.done = true; 368 if(!tt_HideSrcTagsRecurs(tt_body)) 369 tt_Err("To enable the capability to convert HTML elements to tooltips," 370 + " you must set TagsToTip in the global tooltip configuration" 371 + " to true."); 372} 373function tt_HideSrcTagsRecurs(dad) 374{ 375 var a, ovr, asT2t; 376 a = dad.childNodes || dad.children || null; 377 for(var i = a ? a.length : 0; i;) 378 {--i; 379 if(!tt_HideSrcTagsRecurs(a[i])) 380 return false; 381 ovr = a[i].getAttribute ? a[i].getAttribute("onmouseover") 382 : (typeof a[i].onmouseover == "function") ? a[i].onmouseover 383 : null; 384 if(ovr) 385 { 386 asT2t = ovr.toString().match(/TagToTip\s*\(\s*'[^'.]+'\s*[\),]/); 387 if(asT2t && asT2t.length) 388 { 389 if(!tt_HideSrcTag(asT2t[0])) 390 return false; 391 } 392 } 393 } 394 return true; 395} 396function tt_HideSrcTag(sT2t) 397{ 398 var id, el; 399 id = sT2t.replace(/.+'([^'.]+)'.+/, "$1"); 400 el = tt_GetElt(id); 401 if(el) 402 { 403 if(tt_Debug && !TagsToTip) 404 return false; 405 else 406 el.style.display = "none"; 407 } 408 else 409 tt_Err("Invalid ID\n'" + id + "'\npassed to TagToTip()." 410 + " There exists no HTML element with that ID."); 411 return true; 412} 413function tt_Tip(arg, t2t) 414{ 415 if(!tt_db) 416 return; 417 if(tt_iState) 418 tt_Hide(); 419 if(!tt_Enabled) 420 return; 421 tt_t2t = t2t; 422 if(!tt_ReadCmds(arg)) 423 return; 424 tt_iState = 0x1 | 0x4; 425 tt_AdaptConfig1(); 426 tt_MkTipContent(arg); 427 tt_MkTipSubDivs(); 428 tt_FormatTip(); 429 tt_bJmpVert = false; 430 tt_maxPosX = tt_GetClientW() + tt_scrlX - tt_w - 1; 431 tt_maxPosY = tt_GetClientH() + tt_scrlY - tt_h - 1; 432 tt_AdaptConfig2(); 433 tt_Move(); 434 tt_ShowInit(); 435} 436function tt_ReadCmds(a) 437{ 438 var i; 439 i = 0; 440 for(var j in wzconfig) 441 tt_aV[i++] = wzconfig[j]; 442 if(a.length & 1) 443 { 444 for(i = a.length - 1; i > 0; i -= 2) 445 tt_aV[a[i - 1]] = a[i]; 446 return true; 447 } 448 tt_Err("Incorrect call of Tip() or TagToTip().\n" 449 + "Each command must be followed by a value."); 450 return false; 451} 452function tt_AdaptConfig1() 453{ 454 tt_ExtCallFncs(0, "LoadConfig"); 455 if(!tt_aV[TITLEBGCOLOR].length) 456 tt_aV[TITLEBGCOLOR] = tt_aV[BORDERCOLOR]; 457 if(!tt_aV[TITLEFONTCOLOR].length) 458 tt_aV[TITLEFONTCOLOR] = tt_aV[BGCOLOR]; 459 if(!tt_aV[TITLEFONTFACE].length) 460 tt_aV[TITLEFONTFACE] = tt_aV[FONTFACE]; 461 if(!tt_aV[TITLEFONTSIZE].length) 462 tt_aV[TITLEFONTSIZE] = tt_aV[FONTSIZE]; 463 if(tt_aV[CLOSEBTN]) 464 { 465 if(!tt_aV[CLOSEBTNCOLORS]) 466 tt_aV[CLOSEBTNCOLORS] = new Array("", "", "", ""); 467 for(var i = 4; i;) 468 {--i; 469 if(!tt_aV[CLOSEBTNCOLORS][i].length) 470 tt_aV[CLOSEBTNCOLORS][i] = (i & 1) ? tt_aV[TITLEFONTCOLOR] : tt_aV[TITLEBGCOLOR]; 471 } 472 if(!tt_aV[TITLE].length) 473 tt_aV[TITLE] = " "; 474 } 475 if(tt_aV[OPACITY] == 100 && typeof tt_aElt[0].style.MozOpacity != tt_u && !Array.every) 476 tt_aV[OPACITY] = 99; 477 if(tt_aV[FADEIN] && tt_flagOpa && tt_aV[DELAY] > 100) 478 tt_aV[DELAY] = Math.max(tt_aV[DELAY] - tt_aV[FADEIN], 100); 479} 480function tt_AdaptConfig2() 481{ 482 if(tt_aV[CENTERMOUSE]) 483 tt_aV[OFFSETX] -= ((tt_w - (tt_aV[SHADOW] ? tt_aV[SHADOWWIDTH] : 0)) >> 1); 484} 485function tt_MkTipContent(a) 486{ 487 if(tt_t2t) 488 { 489 if(tt_aV[COPYCONTENT]) 490 tt_sContent = tt_t2t.innerHTML; 491 else 492 tt_sContent = ""; 493 } 494 else 495 tt_sContent = a[0]; 496 tt_ExtCallFncs(0, "CreateContentString"); 497} 498function tt_MkTipSubDivs() 499{ 500 var sCss = 'position:relative;margin:0px;padding:0px;border-width:0px;left:0px;top:0px;line-height:normal;width:auto;height:20;', 501 sTbTrTd = ' cellspacing=0 cellpadding=0 border=0 style="' + sCss + '"><tbody style="' + sCss + '"><tr><td '; 502 tt_aElt[0].innerHTML = 503 ('' 504 + (tt_aV[TITLE].length ?
505 ('<div id="WzTiTl" style="position:relative;z-index:1;">' 506 + '<table id="WzTiTlTb"' + sTbTrTd + 'id="WzTiTlI" style="' + sCss + '">' 507 + tt_aV[TITLE] 508 + '</td>' 509 + (tt_aV[CLOSEBTN] ? 510 ('<td align="right" style="' + sCss 511 + 'text-align:right;">' 512 + '<span id="WzClOsE" style="padding-left:2px;padding-right:2px;' 513 + 'cursor:' + (tt_ie ? 'hand' : 'pointer') 514 + ';" onmouseover="tt_OnCloseBtnOver(1)" onmouseout="tt_OnCloseBtnOver(0)" onclick="tt_HideInit()">' 515 + tt_aV[CLOSEBTNTEXT] 516 + '</span></td>') 517 : '') 518 + '</tr></tbody></table></div>') 519 : '') 520 + '<div id="WzBoDy" style="position:relative;z-index:0;">' 521 + '<table' + sTbTrTd + 'id="WzBoDyI" style="' + sCss + '">' 522 + tt_sContent 523 + '</td></tr></tbody></table></div>' 524 + (tt_aV[SHADOW] 525 ? ('<div id="WzTtShDwR" style="position:absolute;overflow:hidden;"></div>' 526 + '<div id="WzTtShDwB" style="position:relative;overflow:hidden;"></div>') 527 : '') 528 ); 529 tt_GetSubDivRefs(); 530 if(tt_t2t && !tt_aV[COPYCONTENT]) 531 { 532 tt_t2tDad = tt_t2t.parentNode || tt_t2t.parentElement || tt_t2t.offsetParent || null; 533 if(tt_t2tDad) 534 { 535 tt_MovDomNode(tt_t2t, tt_t2tDad, tt_aElt[6]); 536 tt_t2t.style.display = "block"; 537 } 538 } 539 tt_ExtCallFncs(0, "SubDivsCreated"); 540} 541function tt_GetSubDivRefs() 542{ 543 var aId = new Array("WzTiTl", "WzTiTlTb", "WzTiTlI", "WzClOsE", "WzBoDy", "WzBoDyI", "WzTtShDwB", "WzTtShDwR"); 544 for(var i = aId.length; i; --i) 545 tt_aElt[i] = tt_GetElt(aId[i - 1]); 546} 547function tt_FormatTip() 548{ 549 var css, w, iOffY, iOffSh; 550 if(tt_aV[TITLE].length) 551 { 552 css = tt_aElt[1].style; 553 css.background = tt_aV[TITLEBGCOLOR]; 554 css.paddingTop = (tt_aV[CLOSEBTN] ? 2 : 0) + "px"; 555 css.paddingBottom = "1px"; 556 css.paddingLeft = css.paddingRight = tt_aV[PADDING] + "px"; 557 css = tt_aElt[3].style; 558 css.color = tt_aV[TITLEFONTCOLOR]; 559 css.fontFamily = tt_aV[TITLEFONTFACE]; 560 css.fontSize = tt_aV[TITLEFONTSIZE]; 561 css.fontWeight = "bold"; 562 css.textAlign = tt_aV[TITLEALIGN]; 563 if(tt_aElt[4]) 564 { 565 css.paddingRight = (tt_aV[PADDING] << 1) + "px"; 566 css = tt_aElt[4].style; 567 css.background = tt_aV[CLOSEBTNCOLORS][0]; 568 css.color = tt_aV[CLOSEBTNCOLORS][1]; 569 css.fontFamily = tt_aV[TITLEFONTFACE]; 570 css.fontSize = tt_aV[TITLEFONTSIZE]; 571 css.fontWeight = "bold"; 572 } 573 if(tt_aV[WIDTH] > 0) 574 tt_w = tt_aV[WIDTH] + ((tt_aV[PADDING] + tt_aV[BORDERWIDTH]) << 1); 575 else 576 { 577 tt_w = tt_GetDivW(tt_aElt[3]) + tt_GetDivW(tt_aElt[4]); 578 if(tt_aElt[4]) 579 tt_w += tt_aV[PADDING]; 580 } 581 iOffY = -tt_aV[BORDERWIDTH]; 582 } 583 else 584 { 585 tt_w = 0; 586 iOffY = 0; 587 } 588 css = tt_aElt[5].style; 589 css.top = iOffY + "px"; 590 if(tt_aV[BORDERWIDTH]) 591 { 592 css.borderColor = tt_aV[BORDERCOLOR]; 593 css.borderStyle = tt_aV[BORDERSTYLE]; 594 css.borderWidth = tt_aV[BORDERWIDTH] + "px"; 595 } 596 if(tt_aV[BGCOLOR].length) 597 css.background = tt_aV[BGCOLOR]; 598 if(tt_aV[BGIMG].length) 599 css.backgroundImage = "url(" + tt_aV[BGIMG] + ")"; 600 css.padding = tt_aV[PADDING] + "px"; 601 css.textAlign = tt_aV[TEXTALIGN]; 602 // TD inside body DIV 603 css = tt_aElt[6].style; 604 css.color = tt_aV[FONTCOLOR]; 605 css.fontFamily = tt_aV[FONTFACE]; 606 css.fontSize = tt_aV[FONTSIZE]; 607 css.fontWeight = tt_aV[FONTWEIGHT]; 608 css.background = ""; 609 css.textAlign = tt_aV[TEXTALIGN]; 610 if(tt_aV[WIDTH] > 0) 611 w = tt_aV[WIDTH] + ((tt_aV[PADDING] + tt_aV[BORDERWIDTH]) << 1); 612 else 613 w = tt_GetDivW(tt_aElt[6]) + ((tt_aV[PADDING] + tt_aV[BORDERWIDTH]) << 1); 614 if(w > tt_w) 615 tt_w = w; 616 if(tt_aV[SHADOW]) 617 { 618 tt_w += tt_aV[SHADOWWIDTH]; 619 iOffSh = Math.floor((tt_aV[SHADOWWIDTH] * 4) / 3); 620 css = tt_aElt[7].style; 621 css.top = iOffY + "px"; 622 css.left = iOffSh + "px"; 623 css.width = (tt_w - iOffSh - tt_aV[SHADOWWIDTH]) + "px"; 624 css.height = tt_aV[SHADOWWIDTH] + "px"; 625 css.background = tt_aV[SHADOWCOLOR]; 626 css = tt_aElt[8].style; 627 css.top = iOffSh + "px"; 628 css.left = (tt_w - tt_aV[SHADOWWIDTH]) + "px"; 629 css.width = tt_aV[SHADOWWIDTH] + "px"; 630 css.background = tt_aV[SHADOWCOLOR]; 631 } 632 else 633 iOffSh = 0; 634 tt_SetTipOpa(tt_aV[FADEIN] ? 0 : tt_aV[OPACITY]); 635 tt_FixSize(iOffY, iOffSh); 636} 637function tt_FixSize(iOffY, iOffSh) 638{ 639 var wIn, wOut, i; 640 tt_aElt[0].style.width = tt_w + "px"; 641 tt_aElt[0].style.pixelWidth = tt_w; 642 wOut = tt_w - ((tt_aV[SHADOW]) ? tt_aV[SHADOWWIDTH] : 0); 643 wIn = wOut; 644 if(!tt_bBoxOld) 645 wIn -= ((tt_aV[PADDING] + tt_aV[BORDERWIDTH]) << 1); 646 tt_aElt[5].style.width = wIn + "px"; 647 if(tt_aElt[1]) 648 { 649 wIn = wOut - (tt_aV[PADDING] << 1); 650 if(!tt_bBoxOld) 651 wOut = wIn; 652 tt_aElt[1].style.width = wOut + "px"; 653 tt_aElt[2].style.width = wIn + "px"; 654 } 655 tt_h = tt_GetDivH(tt_aElt[0]) + iOffY; 656 if(tt_aElt[8]) 657 tt_aElt[8].style.height = (tt_h - iOffSh) + "px"; 658 i = tt_aElt.length - 1; 659 if(tt_aElt[i]) 660 { 661 tt_aElt[i].style.width = tt_w + "px"; 662 tt_aElt[i].style.height = tt_h + "px"; 663 } 664} 665function tt_DeAlt(el) 666{ 667 var aKid; 668 if(el.alt) 669 el.alt = ""; 670 if(el.title) 671 el.title = ""; 672 aKid = el.childNodes || el.children || null; 673 if(aKid) 674 { 675 for(var i = aKid.length; i;) 676 tt_DeAlt(aKid[--i]); 677 } 678} 679function tt_OpDeHref(el) 680{ 681 if(!tt_op) 682 return; 683 if(tt_elDeHref) 684 tt_OpReHref(); 685 while(el) 686 { 687 if(el.hasAttribute("href")) 688 { 689 el.t_href = el.getAttribute("href"); 690 el.t_stats = window.status; 691 el.removeAttribute("href"); 692 el.style.cursor = "hand"; 693 tt_AddEvtFnc(el, "mousedown", tt_OpReHref); 694 window.status = el.t_href; 695 tt_elDeHref = el; 696 break; 697 } 698 el = el.parentElement; 699 } 700} 701function tt_ShowInit() 702{ 703 tt_tShow.Timer("tt_Show()", tt_aV[DELAY], true); 704 if(tt_aV[CLICKCLOSE]) 705 tt_AddEvtFnc(document, "mouseup", tt_HideInit); 706} 707function tt_OverInit(e) 708{ 709 tt_over = e.target || e.srcElement; 710 tt_DeAlt(tt_over); 711 tt_OpDeHref(tt_over); 712 tt_AddRemOutFnc(true); 713} 714function tt_Show() 715{ 716 var css = tt_aElt[0].style; 717 css.zIndex = Math.max((window.dd && dd.z) ? (dd.z + 2) : 0, 1010); 718 if(tt_aV[STICKY] || !tt_aV[FOLLOWMOUSE]) 719 tt_iState &= ~0x4; 720 if(tt_aV[DURATION] > 0) 721 tt_tDurt.Timer("tt_HideInit()", tt_aV[DURATION], true); 722 tt_ExtCallFncs(0, "Show") 723 css.visibility = "visible"; 724 tt_iState |= 0x2; 725 if(tt_aV[FADEIN]) 726 tt_Fade(0, 0, tt_aV[OPACITY], Math.round(tt_aV[FADEIN] / tt_aV[FADEINTERVAL])); 727 tt_ShowIfrm(); 728} 729function tt_ShowIfrm() 730{ 731 if(tt_ie56) 732 { 733 var ifrm = tt_aElt[tt_aElt.length - 1]; 734 if(ifrm) 735 { 736 var css = ifrm.style; 737 css.zIndex = tt_aElt[0].style.zIndex - 1; 738 css.display = "block"; 739 } 740 } 741} 742function tt_Move(e) 743{ 744 e = window.event || e; 745 if(e) 746 { 747 tt_musX = tt_GetEvtX(e); 748 tt_musY = tt_GetEvtY(e); 749 } 750 if(tt_iState) 751 { 752 if(!tt_over && e) 753 tt_OverInit(e); 754 if(tt_iState & 0x4) 755 { 756 if(!tt_op && !tt_ie) 757 { 758 if(tt_bWait) 759 return; 760 tt_bWait = true; 761 tt_tWaitMov.Timer("tt_bWait = false;", 1, true); 762 } 763 if(tt_aV[FIX]) 764 { 765 tt_iState &= ~0x4; 766 tt_SetTipPos(tt_aV[FIX][0], tt_aV[FIX][1]); 767 } 768 else if(!tt_ExtCallFncs(e, "MoveBefore")) 769 tt_SetTipPos(tt_PosX(), tt_PosY()); 770 tt_ExtCallFncs([tt_musX, tt_musY], "MoveAfter") 771 } 772 } 773} 774function tt_PosX() 775{ 776 var x; 777 x = tt_musX; 778 if(tt_aV[LEFT]) 779 x -= tt_w + tt_aV[OFFSETX] - (tt_aV[SHADOW] ? tt_aV[SHADOWWIDTH] : 0); 780 else
781 x += tt_aV[OFFSETX]; 782 if(x > tt_maxPosX) 783 x = tt_maxPosX; 784 return((x < tt_scrlX) ? tt_scrlX : x); 785} 786function tt_PosY() 787{ 788 var y; 789 if(tt_aV[ABOVE] && (!tt_bJmpVert || tt_CalcPosYAbove() >= tt_scrlY + 16)) 790 y = tt_DoPosYAbove(); 791 else if(!tt_aV[ABOVE] && tt_bJmpVert && tt_CalcPosYBelow() > tt_maxPosY - 16) 792 y = tt_DoPosYAbove(); 793 else 794 y = tt_DoPosYBelow(); 795 if(y > tt_maxPosY) 796 y = tt_DoPosYAbove(); 797 if(y < tt_scrlY) 798 y = tt_DoPosYBelow(); 799 return y; 800} 801function tt_DoPosYBelow() 802{ 803 tt_bJmpVert = tt_aV[ABOVE]; 804 return tt_CalcPosYBelow(); 805} 806function tt_DoPosYAbove() 807{ 808 tt_bJmpVert = !tt_aV[ABOVE]; 809 return tt_CalcPosYAbove(); 810} 811function tt_CalcPosYBelow() 812{ 813 return(tt_musY + tt_aV[OFFSETY]); 814} 815function tt_CalcPosYAbove() 816{ 817 var dy = tt_aV[OFFSETY] - (tt_aV[SHADOW] ? tt_aV[SHADOWWIDTH] : 0); 818 if(tt_aV[OFFSETY] > 0 && dy <= 0) 819 dy = 1; 820 return(tt_musY - tt_h - dy); 821} 822function tt_OnOut() 823{ 824 tt_AddRemOutFnc(false); 825 if(!(tt_aV[STICKY] && (tt_iState & 0x2))) 826 tt_HideInit(); 827} 828function tt_HideInit() 829{ 830 tt_ExtCallFncs(0, "HideInit"); 831 tt_iState &= ~0x4; 832 if(tt_flagOpa && tt_aV[FADEOUT]) 833 { 834 tt_tFade.EndTimer(); 835 if(tt_opa) 836 { 837 var n = Math.round(tt_aV[FADEOUT] / (tt_aV[FADEINTERVAL] * (tt_aV[OPACITY] / tt_opa))); 838 tt_Fade(tt_opa, tt_opa, 0, n); 839 return; 840 } 841 } 842 tt_tHide.Timer("tt_Hide();", 1, false); 843} 844function tt_OpReHref() 845{ 846 if(tt_elDeHref) 847 { 848 tt_elDeHref.setAttribute("href", tt_elDeHref.t_href); 849 tt_RemEvtFnc(tt_elDeHref, "mousedown", tt_OpReHref); 850 window.status = tt_elDeHref.t_stats; 851 tt_elDeHref = null; 852 } 853} 854function tt_Fade(a, now, z, n) 855{ 856 if(n) 857 { 858 now += Math.round((z - now) / n); 859 if((z > a) ? (now >= z) : (now <= z)) 860 now = z; 861 else 862 tt_tFade.Timer("tt_Fade(" 863 + a + "," + now + "," + z + "," + (n - 1) 864 + ")", 865 tt_aV[FADEINTERVAL], 866 true); 867 } 868 now ? tt_SetTipOpa(now) : tt_Hide(); 869} 870function tt_SetTipOpa(opa) 871{ 872 tt_SetOpa(tt_aElt[5].style, opa); 873 if(tt_aElt[1]) 874 tt_SetOpa(tt_aElt[1].style, opa); 875 if(tt_aV[SHADOW]) 876 { 877 opa = Math.round(opa * 0.8); 878 tt_SetOpa(tt_aElt[7].style, opa); 879 tt_SetOpa(tt_aElt[8].style, opa); 880 } 881} 882function tt_OnCloseBtnOver(iOver) 883{ 884 var css = tt_aElt[4].style; 885 iOver <<= 1; 886 css.background = tt_aV[CLOSEBTNCOLORS][iOver]; 887 css.color = tt_aV[CLOSEBTNCOLORS][iOver + 1]; 888} 889function tt_Int(x) 890{ 891 var y; 892 return(isNaN(y = parseInt(x)) ? 0 : y); 893} 894function tt_AddRemOutFnc(bAdd) 895{ 896 var PSet = bAdd ? tt_AddEvtFnc : tt_RemEvtFnc; 897 if(bAdd != tt_AddRemOutFnc.bOn) 898 { 899 PSet(tt_over, "mouseout", tt_OnOut); 900 tt_AddRemOutFnc.bOn = bAdd; 901 if(!bAdd) 902 tt_OpReHref(); 903 } 904} 905tt_AddRemOutFnc.bOn = false; 906Number.prototype.Timer = function(s, iT, bUrge) 907{ 908 if(!this.value || bUrge) 909 this.value = window.setTimeout(s, iT); 910} 911Number.prototype.EndTimer = function() 912{ 913 if(this.value) 914 { 915 window.clearTimeout(this.value); 916 this.value = 0; 917 } 918} 919function tt_SetOpa(css, opa) 920{ 921 tt_opa = opa; 922 if(tt_flagOpa == 1) 923 { 924 if(opa < 100) 925 { 926 var bVis = css.visibility != "hidden"; 927 css.zoom = "100%"; 928 if(!bVis) 929 css.visibility = "visible"; 930 css.filter = "alpha(opacity=" + opa + ")"; 931 if(!bVis) 932 css.visibility = "hidden"; 933 } 934 else 935 css.filter = ""; 936 } 937 else 938 { 939 opa /= 100.0; 940 switch(tt_flagOpa) 941 { 942 case 2: 943 css.KhtmlOpacity = opa; break; 944 case 3: 945 css.KHTMLOpacity = opa; break; 946 case 4: 947 css.MozOpacity = opa; break; 948 case 5: 949 css.opacity = opa; break; 950 } 951 } 952} 953function tt_MovDomNode(el, dadFrom, dadTo) 954{ 955 if(dadFrom) 956 dadFrom.removeChild(el); 957 if(dadTo) 958 dadTo.appendChild(el); 959} 960function tt_Err(sErr) 961{ 962 if(tt_Debug) 963 alert("Tooltip Script Error Message:\n\n" + sErr); 964} 965function tt_ExtCmdEnum() 966{ 967 var s; 968 for(var i in wzconfig) 969 { 970 s = "window." + i.toString().toUpperCase(); 971 if(eval("typeof(" + s + ") == tt_u")) 972 { 973 eval(s + " = " + tt_aV.length); 974 tt_aV[tt_aV.length] = null; 975 } 976 } 977} 978function tt_ExtCallFncs(arg, sFnc) 979{ 980 var b = false; 981 for(var i = tt_aExt.length; i;) 982 {--i; 983 var fnc = tt_aExt[i]["On" + sFnc]; 984 if(fnc && fnc(arg)) 985 b = true; 986 } 987 return b; 988} 989tt_Init();
Line numbers count LF bytes from the start of the resource, as the search results do. Vendor segments are library code the classifier recognised; they are stored but not indexed. Bytes are shown as Latin1 characters, one per byte.