
/*
function DHTMLToolTip(toolTipId, toolTipTextId)
{
   this.ie = document.all;
   this.ns6 = document.getElementById && !document.all;
   this.toolTipDivId = toolTipId;
   this.toolTipTextDivId = toolTipTextId;
   this.toolTipDiv = null;
   this.toolTipTextDiv = null;
   this.enabletip = false;
   this.offsetxpoint = -2;
   //Customize x offset of tooltip
   this.offsetypoint = 6;
   //In event handlers  Objects this is not available(  this referer to the even source)  using closure to pass the context
   var thisObj = this;
   var init = function ()
   {
      thisObj.toolTipDiv = thisObj.getElement(thisObj.toolTipDivId);
      thisObj.toolTipTextDiv = thisObj.getElement(thisObj.toolTipTextDivId);
   }
   var mouseEventHandler = function (e)
   {
      toolTipObj.positionObject(thisObj, e);
   }
   if (typeof document.attachEvent != 'undefined')
   {
      window.attachEvent('onload', init);
      document.attachEvent('onmousemove', mouseEventHandler);
   }
   else
   {
      window.addEventListener('load', init, false);
      document.addEventListener('mousemove', mouseEventHandler, false);
      //document.addEventListener('mousemove',moveMouse,false);
      //document.addEventListener('click',checkMove,false);
   }
}
DHTMLToolTip.prototype.getElement = function (elementId)
{
   if (this.ie)
   {
      return document.all[elementId];
   }
   else if (this.ns6)
   {
      return document.getElementById(elementId);
   }
}
DHTMLToolTip.prototype.show = function (theText, theWidth)
{
   if (this.ns6 || this.ie)
   {
      if (typeof thewidth != "undefined")
      {
         this.toolTipDiv.style.width = thewidth + "px"
      }
      this.toolTipTextDiv.innerHTML = theText;
      this.enabletip = true
      return false
   }
}
DHTMLToolTip.prototype.positionObject = function (thisObj, e)
{
   if (thisObj.enabletip)
   {
      var curX = (thisObj.ns6)?e.pageX : event.clientX + document.body.scrollLeft;
      var curY = (thisObj.ns6)?e.pageY : event.clientY + document.body.scrollTop;
      //Find out how close the mouse is to the corner of the window
      var rightedge = thisObj.ie && !window.opera? document.body.clientWidth - event.clientX - thisObj.offsetxpoint : window.innerWidth - e.clientX - thisObj.offsetxpoint - 20
      var bottomedge = thisObj.ie && !window.opera? document.body.clientHeight - event.clientY - thisObj.offsetypoint : window.innerHeight - e.clientY - thisObj.offsetypoint - 20
      var leftedge = (thisObj.offsetxpoint < 0)? thisObj.offsetxpoint * (-1) : -1000
      //if the horizontal distance isn't enough to accomodate the width of the context menu
      if (rightedge < thisObj.toolTipDiv.offsetWidth)
      {
         //move the horizontal position of the menu to the left by it's width
         thisObj.toolTipDiv.style.left = thisObj.ie? document.body.scrollLeft + event.clientX - thisObj.toolTipDiv.offsetWidth + "px" : window.pageXOffset + e.clientX - thisObj.toolTipDiv.offsetWidth + "px"
      }
      else if (curX < leftedge)
      {
         thisObj.toolTipDiv.style.left = "5px"
      }
      else
      {
         //position the horizontal position of the menu where the mouse is positioned
         thisObj.toolTipDiv.style.left = curX + thisObj.offsetxpoint + "px"
      }
      //same concept with the vertical position
      if (bottomedge < thisObj.toolTipDiv.offsetHeight)
      {
         thisObj.toolTipDiv.style.top = thisObj.ie? document.body.scrollTop + event.clientY - thisObj.toolTipDiv.offsetHeight - thisObj.offsetypoint + "px" : window.pageYOffset + e.clientY - thisObj.toolTipDiv.offsetHeight - thisObj.offsetypoint + "px"
      }
      else
      {
         thisObj.toolTipDiv.style.top = curY + thisObj.offsetypoint + "px"
      }
      thisObj.toolTipDiv.style.visibility = "visible";
   }
}
DHTMLToolTip.prototype.hide = function()
{
   if (this.ns6 || this.ie)
   {
      this.enabletip = false
      this.toolTipDiv.style.visibility = "hidden"
      this.toolTipDiv.style.left = "-1000px"
      this.toolTipDiv.style.backgroundColor = ''
      this.toolTipDiv.style.width = ''
   }
}

*/
    var toolTipSTYLE;
    var agt=navigator.userAgent.toLowerCase();
    var is_major = parseInt(navigator.appVersion);
    var is_minor = parseFloat(navigator.appVersion);

    var is_nav  = ((agt.indexOf('mozilla')!=-1) && (agt.indexOf('spoofer')==-1)
                && (agt.indexOf('compatible') == -1) && (agt.indexOf('opera')==-1)
                && (agt.indexOf('webtv')==-1) && (agt.indexOf('hotjava')==-1));
    var is_nav4 = (is_nav && (is_major == 4));
    var is_nav6 = (is_nav && (is_major == 5));
    var is_nav6up = (is_nav && (is_major >= 5));
    var is_ie     = ((agt.indexOf("msie") != -1) && (agt.indexOf("opera") == -1));
//tooltip Position
var offsetX = 13;
var offsetY = 5;
var opacity = 100;


function initToolTips(){
  if(document.getElementById)
  {
          toolTipSTYLE = document.getElementById("toolTipLayer").style;
  }
  if(is_ie || is_nav6up)
  {
    toolTipSTYLE.visibility = "visible";
    toolTipSTYLE.display = "none";
    document.onmousemove = moveToMousePos;
  }
}
function moveToMousePos(e)
{
  if(!is_ie){
    x = e.pageX;
    y = e.pageY;
  }else{
    x = event.x + document.body.scrollLeft;
    y = event.y + document.body.scrollTop;
  }

  toolTipSTYLE.left = x + offsetX+'px';
  toolTipSTYLE.top = y + offsetY+'px';
  return true;
}


function toolTip(msg, fg, bg,width)
{
   if (toolTipSTYLE != undefined && toolTipSTYLE != null)
   {
      if (toolTip.arguments.length < 1) // if no arguments are passed then hide the tootip
      {
         if (is_nav4)
            toolTipSTYLE.visibility = "hidden";
         else
            toolTipSTYLE.display = "none";
      }
      else // show
      {
         if (!fg) fg = "black";
         if (!bg) bg = "#EBF0F5";
         if (!width) width = "300";
         var content = '<table width = "'+width+'" border="0" cellspacing="0" cellpadding="0" class="toolTip"><tr><td bgcolor="' + fg + '">' +
                       '<table border="0" cellspacing="1" cellpadding="0"<tr><td bgcolor="' + bg + '">' +
                       '<font face="arial" color="' + fg + '" size="-2">' + msg +
                       '</font></td></tr></table>' +
                       '</td></tr></table>';
         if (is_nav4)
         {
            toolTipSTYLE.document.write(content);
            toolTipSTYLE.document.close();
            toolTipSTYLE.visibility = "visible";
         }

         else if (is_ie || is_nav6up)
         {
            document.getElementById("toolTipLayer").innerHTML = content;

            toolTipSTYLE.display = 'block'

         }
      }
   }
}


//--></script>