// $Id: tooltip.js,v 1.3 2009/10/18 18:54:50 rick Exp $
// 
// 1. Import the tooltip.js into your HTML code in the head section like this:
//          <script type="text/javascript" src="tooltip.js"></script>
// 2. Add an empty div tag with id "toolTip" to your site.
//          <div id="toolTip"> </div>
// 3. Add an onmouseover and onmouseout event to any HTML element which support it.
//          <td onmouseover="showToolTip('Name','Please enter your name here.',event);" onmouseout="hideToolTip();">Name:</td>   
// 4. Edit your CSS file and customize the look and feel as you want.

var xPos;
var yPos;

function showToolTip(title,msg,evt){
    if (evt) {
        var url = evt.target;
    }
    else {
        evt = window.event;
        var url = evt.srcElement;
    }
    xPos = evt.clientX;
    yPos = evt.clientY;

   var toolTip = document.getElementById("toolTip");
   toolTip.innerHTML = "<p>"+msg+"</p>";
   toolTip.style.top = parseInt(yPos)+2 + "px";
   toolTip.style.left = parseInt(xPos)+2 + "px";
   toolTip.style.visibility = "visible";
   
}

function hideToolTip(){
   var toolTip = document.getElementById("toolTip");
   toolTip.style.visibility = "hidden";
}
