M_toolTipDelay = 700    // Milliseconds after menu has been displayed before showing tooltip
M_maxWidth       = 0      // Sets the maximum width, set to 0 for 100%

with(M_toolTipStyle=new mm_style()){
  offbgcolor  = "#FAFAFA";
  offcolor    = "#000000";
  bordercolor = "#999999";
  borderstyle = "solid";
  padding     = 1
  borderwidth = 1
  fontsize    = "10px";
  fontstyle   = "normal";
  fontfamily  = "Arial,Helvetica";   
  overfilter  = "Fade(duration=0.2);Shadow(color='#777777', Direction=135, Strength=5)"
}

with(new menuname("M_toolTips")) {
  top="offset=22"
  left="offset=10"
  style=M_toolTipStyle;
  menuItem("text=;");
}

drawMenus();

function buildTips(_ttext)                  // Function for showing Tooltips
{ 

  if (_itemRef<0 || _el<0) return;
  _tmnu = getMenuByName("M_toolTips")       // Get a reference to the tooltips menu
  _tgm  = getObject("menu"+_tmnu)               // Get the object reference to the tooltips menu
  if(!is_ns4 && (!_m[_tmnu][23] && !_startM))   
  {
    _m[_tmnu][23] = _tmnu                   // Set the menu built flag
    BDMenu(_tmnu)                           // Build the menu, this only happens once, or at least should do.
  }

  _el = _m[_tmnu][0][0]                     // Set the menu element reference for building the menu items
  _mi[_el][1] = _ttext                      // Set the menu items text. This is the text that will be displayed
  
  if(is_ns4){
    dte="<table width=1 cellpadding=0 cellspacing=0 border=0>"+drawItem(_el)+"</table>";
    with(_tgm.document){open();write(dte);close()}
    _brd=getObject("bord"+_tmnu)
    _brdwid=(_m[_tmnu][6].borderwidth*2)
    _brd.clip.width=_tgm.clip.width+_brdwid
    _brd.clip.height=_tgm.clip.height+_brdwid
    _brd.bgColor=_m[_tmnu][6].bordercolor
    
  } else   {
    _tgm.innerHTML=_drawMenu(_tmnu)         // change the menu item for browsers other than Netscape 4
  }
    
  _ttgm=getObject("el"+_m[_tmnu][0][0])
  _gp=getPos(_tgm)
  if(M_maxWidth && _gp[3]>M_maxWidth)
  {
  //  spos(_ttgm,null,null,null,M_maxWidth);
  }

  popup("M_toolTips",1);                    // display the menu based on MouseX and MouseY coordinates
  if(is_ns4)
  {
    _brd.zIndex=_zi+1
    _zi++
    _tgm.zIndex=_zi+1
  }
}

function showtip(_ttext)                    // This function that sets the timer for showing the tooltip
{
  _Mtip = _clearTimer(_Mtip);
  if(!is_op5 && !is_op6) _Mtip=setTimeout("buildTips('"+_ttext+"',1)",_menuOpenDelay+M_toolTipDelay)   
}