function isTooltip()
{
  this.tipOn			= false;	// check if over tooltip link
  this.tipFollowMouse	= true;		// Do you want tip to move when mouse moves over link?
  this.offX				= 20;		// how far from mouse to show tip
  this.offY				= 12;
  this.tooltip			= null;
  this.standardbody		= null;
  this.mouseX			= 0;
  this.mouseY			= 0;
  this.t1				= 10;
  this.t2				= 10;

  this.dom		= (document.getElementById) ?									true : false;
  this.ns5		= (!document.all && this.dom || window.opera) ?					true : false;
  this.ie5		= ((navigator.userAgent.indexOf("MSIE") > -1) && this.dom) ?	true : false;
  this.ie4		= (document.all && !this.dom) ?									true : false;
  this.nodyn	= (!this.ns5 && !this.ie4 && !this.ie5 && !this.dom) ?			true : false;
  if (this.nodyn) event = "nope";		// avoid error of passing event object in older browsers
  if (this.nodyn) return;

  this.tooltip = (this.ie4)? document.all['tipDiv'] : (this.ie5 || this.ns5)? document.getElementById('tipDiv') : null;
  if (this.tooltip && this.tipFollowMouse) document.onmousemove	= trackMouse;
}

isTooltip.prototype = {
  doTooltip : function (evt, html, width, height) {
    if (!this.tooltip) return;
    if (this.t1) clearTimeout(this.t1);
    if (this.t2) clearTimeout(this.t2);
    this.tipOn = true;
    if (width != '' || height != '') {
      if (width != '') document.tooltip.tooltip.style.width = width + "px";
      if (height != '') document.tooltip.tooltip.style.height = height + "px";
    }
    if (this.ie4 || this.ie5 || this.ns5) this.tooltip.innerHTML = html;
    if (!this.tipFollowMouse) this.positionTip(evt);
    else this.t1 = setTimeout("document.tooltip.tooltip.style.visibility='visible'", 100);
  }
  ,
  trackMouse : function (evt) {
    this.standardbody = (document.compatMode == "CSS1Compat") ? document.documentElement : document.body;
    this.mouseX = (this.ns5) ? evt.pageX : window.event.clientX + this.standardbody.scrollLeft;
    this.mouseY = (this.ns5) ? evt.pageY : window.event.clientY + this.standardbody.scrollTop;
    if (this.tipOn) this.positionTip(evt);
  }
  ,
  positionTip : function (evt) {
    if (!this.tipFollowMouse) this.setCoords(evt);
    // tooltip width and height
    var tpWd = (this.ie4 || this.ie5) ? this.tooltip.clientWidth : this.tooltip.offsetWidth;
    var tpHt = (this.ie4 || this.ie5) ? this.tooltip.clientHeight : this.tooltip.offsetHeight;
    // document area in view (subtract scrollbar width for ns)
    var winWd = (this.ns5) ? window.innerWidth - 20 + window.pageXOffset : this.standardbody.clientWidth + this.standardbody.scrollLeft;
    var winHt = (this.ns5) ? window.innerHeight - 20 + window.pageYOffset : this.standardbody.clientHeight + this.standardbody.scrollTop;
    // check mouse position against tip and window dimensions and position the tooltip
    if ((this.mouseX + this.offX + tpWd) > winWd)	this.tooltip.style.left = this.mouseX - (tpWd + this.offX) + "px";
    else											this.tooltip.style.left = this.mouseX + this.offX + "px";
    if ((this.mouseY + this.offY + tpHt) > winHt)	this.tooltip.style.top = winHt - (tpHt + this.offY) + "px";
    else											this.tooltip.style.top = this.mouseY + this.offY + "px";
    if (!this.tipFollowMouse) this.t1 = setTimeout("document.tooltip.tooltip.style.visibility='visible'", 100);
  }
  ,
  setCoords : function (evt) {
    this.standardbody = (document.compatMode == "CSS1Compat") ? document.documentElement : document.body;
    this.mouseX = (this.ns5) ? evt.pageX : window.event.clientX + this.standardbody.scrollLeft;
    this.mouseY = (this.ns5) ? evt.pageY : window.event.clientY + this.standardbody.scrollTop;
  }
  ,
  hideTip : function () {
    if (!this.tooltip) return;
    this.t2		= setTimeout("document.tooltip.tooltip.style.visibility='hidden'", 100);
    this.tipOn	= false;
  }
}

function trackMouse(evt) {
  document.tooltip.trackMouse(evt);
}