<!-- This portion of the script should be placed at the end of the document. -->


/*************************************************************************
  This code is from Dynamic Web Coding at http://www.dyn-web.com/
  Copyright 2003-4 by Sharon Paine 
  See Terms of Use at http://www.dyn-web.com/bus/terms.html
  regarding conditions under which you may use this code.
  This notice must be retained in the code as is!
*************************************************************************/

function initHoverTip() {
  var tip = document.getElementById? document.getElementById(Tooltip.tipID): null;
  if (tip) {
    Tooltip.followMouse = false;  // must be turned off for this version
    tip.onmouseout = Tooltip.tipOutCheck;
    tip.onmouseover = Tooltip.clearTimer;
  }
}

Tooltip.tipOutCheck = function(e) {
  e = dw_event.DOMit(e);
  // is element moused into contained by tooltip?
  var toEl = e.relatedTarget? e.relatedTarget: e.toElement;
  if ( this != toEl && !contained(toEl, this) ) Tooltip.hide();
}

// returns true of oNode is contained by oCont (container)
function contained(oNode, oCont) {
  if (!oNode) return; // in case alt-tab away while hovering (prevent error)
  while ( oNode = oNode.parentNode ) if ( oNode == oCont ) return true;
  return false;
}


Tooltip.timerId = 0;
Tooltip.clearTimer = function() {
  if (Tooltip.timerId) clearTimeout(Tooltip.timerId);
}

initHoverTip();
