  // Figure out where the obj object is on the screen by adding
  // up all the offsets for all the containing parent objects
  function FindPosition(obj) {

   // Assign the obj object to a temp variable
   tmpObj = obj;

   // Get the offsets for the current object
   var obj_left = tmpObj.offsetLeft;
   var obj_top = tmpObj.offsetTop;

   // If the current object has a parent (ie contained in a table, div, etc..)
   if (tmpObj.offsetParent) {

    // Loop throw all the parents and add up their offsets
    // The while loop will end when no more parents exist and a null is returned
     while (tmpObj = tmpObj.offsetParent) {
     obj_left += tmpObj.offsetLeft;
     obj_top += tmpObj.offsetTop;
    }
   }
   return [obj_left , obj_top];
  }

  //*****
  //***** Function to display a tool tip.
  //***** @param   obj - Object to display the tool tip for
  //***** @param   msg - Message to display
  //***** @param   displayseconds - *Optional* Number of seconds to display the tool tip
  //***** @return  void
  //*****
  var HideTipTimer = 0;
  function tooltips(obj,msg,displayseconds) {

    // If not passed in set the default value for the optional displayseconds parameter
    displayseconds = (typeof(displayseconds)=="undefined") ? 10 : displayseconds;

    // Figure out where the input field object is on the screen by adding
    // up all the offsets for all the containing parent objects

    var obj_pos = FindPosition(obj);
    var tip_left = obj_pos[0];
    var tip_top = obj_pos[1];

    // Add obj height to top position so tip box DIV will show up underneath "obj"
    tip_top += obj.clientHeight;

    // Create DIV tag object through DOM to hold the "tip" message (if it does not already exist)
    if (document.getElementById("tip") == null) {
      tipdiv = document.createElement("div");
      document.body.appendChild(tipdiv);
      tipdiv.setAttribute("id", "tip");
    } else {
      // Div Tag allready esists, clear out old timer and get reference to it
      clearTimeout(HideTipTimer);
      tipdiv = document.getElementById("tip");
      tipdiv.style.display="none"; // Hide any old message
      tipdiv.innerHTML = "";
    }

    // Position tip box DIV
    tipdiv.style.zIndex = "500";
    tipdiv.style.position = "absolute";
    tipdiv.style.top = tip_top + "px";
    tipdiv.style.left = tip_left + "px";

    // Roughly figure how how wide to make tip box DIV based on the number
    // of characters in the message. If max width is exceeded then just use max width
    var iFontSize = 10;
    var iCharWidth = iFontSize / 2; // Assume characters are half as wide as they are tall
    var iMaxWidth = 250;
    var iNumChars = msg.length;
    var tip_width = (iNumChars * iCharWidth + 6 > iMaxWidth ) ? iMaxWidth : iNumChars * iCharWidth + 6;

    tipdiv.style.width = tip_width + "px";

    // Format the appearance of tip box DIV
    tipdiv.style.fontFamily = "Arial";
    tipdiv.style.fontSize = iFontSize + "px";
    tipdiv.style.backgroundColor = "lightyellow";
    tipdiv.style.border = "1px solid black";
    tipdiv.style.padding = "2px 2px 2px 4px";
    tipdiv.style.textAlign = "left";

    // If message is empty then set display type to hide tip box DIV
    (msg != "") ? display_type = "block" : display_type = "none";

    // Show/hide div and assign the message to the tip box
    tipdiv.style.display = display_type;
    tipdiv.innerHTML = msg;

    // If tip is being displayed then wait 10 seconds then hide the tip box DIV
    if (display_type == "block") {
      var cmd = 'document.getElementById("tip").style.display="none";';
      displayseconds = displayseconds * 1000;
      HideTipTimer = setTimeout(cmd,displayseconds);
    }

  }

