  // <SCRIPT language=javascript >
  //-----------------------------------------------------

  var FM_LEFT       = 0x00000001;
  var FM_BOTTOM     = 0x00000002;
  var FM_RIGHT      = 0x00000004;
  var FM_TOP        = 0x00000008;
  var FM_BOTTOMLEFT = 0x00000010;
  var FM_BOTTOMRIGHT= 0x00000020;
  var FM_RTL        = 0x00000040;
  var FM_NOSHADOW   = 0x00000080;
  var FM_EVAL       = 0x00000100;
  var FM_FIXEDPOS   = 0x00000200;


  var FM_OFFSET   = 13
  var FM_MAXWIDTH = 350

  var nFMStyle = 0
  var nFMDefaultStyle = eval("FM_EVAL | FM_RTL | FM_BOTTOMLEFT")
  var bFM = false
  var bForceFM = false
  var bDisableFM = false
  var nFM_FixedPosX = 0;
  var nFM_FixedPosY = 0;
  var bFM_Sticky = false;
  //---------------------------------

  document.onmousemove = OnMouseMove;

  var oLastObj = null
  //---------------------------------

  function OnMouseMove ()
  //       ~~~~~~~~~~~
  {
    if (bDisableFM || bFM_Sticky)
      return;
      
    if(typeof(event)=='undefined') return;
    var oElement = event.srcElement

    if (!bForceFM)
    {
      while (oElement != null && typeof(oElement.FM) != "string" && (!bFM || (oElement != divFM && oElement != divShadow)))
        oElement = oElement.parentElement;

      if (!bFM || (oElement != divFM && oElement != divShadow))
      {
        if (oElement != null)
        {
          if (oElement != oLastObj)
          {
            var nStyle = nFMDefaultStyle
            FM_Hide()
            if (typeof(oElement.FMSTYLE) == "string")
              nStyle = eval(oElement.FMSTYLE)
            if (typeof(oElement.FMPOS) == "string")
            {
              nStyle |= FM_FIXEDPOS;
              var s = oElement.FMPOS
              nFM_FixedPosX = eval(s.substr(0,s.indexOf(",")))
              nFM_FixedPosY = eval(s.substr(s.indexOf(",")+1))
            }
            
            if ((nStyle & FM_EVAL) != 0)
              FM(eval(oElement.FM), nStyle)
            else  
              FM(oElement.FM, nStyle)
          }   
        }
        else
        if (bFM)
          FM_Hide()
        oLastObj = oElement
      }  
      if (!bFM)
        return;
    }    
    var nMouseX = event.x;
    var nMouseY = event.y; 
    var nNewPosX;
    var nNewPosY;
    var nHeight;
    var nWidth;

    if ((nFMStyle & FM_RTL) == FM_RTL)
    {
      TheText.align = "right"
      TheText.dir = "rtl"
    }  
    else  
    {
      TheText.align = "left"
      TheText.dir = "ltr"
    }  

    nHeight = divFM.offsetHeight;
    nWidth  = divFM.offsetWidth;
    
    if (nFMStyle & FM_FIXEDPOS)
    {
      nNewPosX = nFM_FixedPosX;
      nNewPosY = nFM_FixedPosY;
    }
    else
    switch (nFMStyle & (FM_LEFT | FM_RIGHT | FM_TOP | FM_BOTTOM | FM_BOTTOMLEFT | FM_BOTTOMRIGHT))
    {
      case FM_TOP :
        nNewPosX = nMouseX - nWidth/2;
        nNewPosY = nMouseY - FM_OFFSET - nHeight;
        break;
      case FM_RIGHT :
        nNewPosX = nMouseX + 3;
        nNewPosY = nMouseY - nHeight/2;
        break;
      case FM_BOTTOMRIGHT :
        nNewPosX = nMouseX + 3;
        nNewPosY = nMouseY + FM_OFFSET;
        break;
      case FM_LEFT :
        nNewPosX = nMouseX - 10 - nWidth;
        nNewPosY = nMouseY - nHeight/2;
        break;
      case FM_BOTTOMLEFT :
        nNewPosX = nMouseX - 10 - nWidth;
        nNewPosY = nMouseY + FM_OFFSET;
        break;
      default :
        nNewPosX = nMouseX - nWidth/2;
        nNewPosY = nMouseY + FM_OFFSET;
        break;
    }

    // make sure the message is not running out of the BOTTOM of the screen
    if (nNewPosY + nHeight - 5> document.body.clientHeight)
      nNewPosY = document.body.clientHeight - nHeight + 5
    // make sure the message is not running out of the RIGHT of the screen
    if (nNewPosX + nWidth > document.body.clientWidth)
      nNewPosX = document.body.clientWidth - nWidth
    // make sure the message is not running out of the LEFT of the screen
    if (nNewPosX <-4)
      nNewPosX = -4
    // make sure the message is not running out of the TOP of the screen
    if (nNewPosY <-4)
      nNewPosY = -4
      
    divFM.style.left       = nNewPosX + document.body.scrollLeft;
    divFM.style.top        = nNewPosY + document.body.scrollTop;
    divShadow.style.width  = divFM.offsetWidth-5
    divShadow.style.height = divFM.offsetHeight-5
    divShadow.style.left   = divFM.offsetLeft+4
    divShadow.style.top    = divFM.offsetTop+6
    divFM.style.visibility = "visible";
    
      divShadow.style.visibility = "visible";
    
  }
  //---------------------------------

  function FM_MakeSticky (bSticky)
  //       ~~~~~~~~~~~~~
  {
    if (bFM_Sticky == bSticky)
      return;
    bFM_Sticky = bSticky  
    if (bFM_Sticky)
      if (!bFM)
        bFM_Sticky = false;
      else
      {
        
      }  
        
  }
  //---------------------------------

  function FM (sHtml, nStyle)
  //       ~~
  {
    if (bDisableFM)
      return;
    if (typeof(divFM) != "object")
    {
      var sCode = "<TABLE id=divFM style='position:absolute; z-index:100; visibility:hidden' cellpadding=2 cellspaing=0>" +
                  "  <TR>" +
                  "    <TD id=TheText style=' cursor: default; font-size : 13;font-family :  Arial, Helvetica, sans-serif; color : Black; background-color:#fbfcdc; border:1px solid; border-color:#A08000;'></TD>" + 
                  "  </TR>" +
                  "</TABLE> " + 
                  "<TABLE id=divShadow bgcolor=black cellpadding=0 cellspacing=0 style='position:absolute; z-index:99; visibility:hidden; filter:progid:DXImageTransform.Microsoft.Blur(PixelRadius=4,MakeShadow=true,ShadowOpacity=0.3);'>" +
                  "  <TR>" +
                  "    <TD>&nbsp</TD>" + 
                  "  </TR>" +
                  "</TABLE> "
                 
      var oTable = document.createElement("TABLE")
      oTable     = document.body.insertBefore(oTable)
      oTable.outerHTML = sCode
    }  
    divFM.style.width = ""
    divFM.style.height = ""
    TheText.innerHTML = sHtml;
    if (divFM.offsetWidth > FM_MAXWIDTH)
      divFM.style.width = FM_MAXWIDTH
    
    if ((nFMStyle & FM_RTL) == FM_RTL)
    {
      TheText.align = "right"
      TheText.dir = "rtl"
    }  
    else  
    {
      TheText.align = "left"
      TheText.dir = "ltr"
    }  

    if ((nFMStyle & FM_NOSHADOW) != 0)
      divFM.style.filter = ""
        
    nFMStyle     = nStyle
    bFM          = true
  }
  //---------------------------------
  
  function FM_Force (sHtml, nStyle)
  //       ~~~~~~~~
  {
    if (bDisableFM)
      return;
    FM (sHtml, nStyle)
    bForceFM = true
  }
  //---------------------------------

  function FM_Disable (bDisable)
  //       ~~~~~~~~~~
  {
    bDisableFM = bDisable
  }
  //---------------------------------

  function FM_Hide ()
  //       ~~~~~~~
  {
    if (!bFM)
      return;
    TheText.innerHTML = "out"  
    divShadow.style.visibility = "hidden";
    divFM.style.visibility = "hidden";
    bFM = false
    bForceFM = false
    bFM_Sticky = false
  }
  //---------------------------------
  //  </SCRIPT>

