if (Drupal.jsEnabled) 
{
  ttMouseX = 0;
  ttMouseY = 0;
  ttCache = new Array();
  overTooltip = false;
  actualTips = "";
  
  function tooltipserLoaded(data)
  {
    ttCache[data.cName] = data.data;
    if(overTooltip)
    {
      $('#tooltipser-box').hide(0);
      $('#tooltipser-box').html(ttCache[actualTips]);
      $('#tooltipser-box').show(0);
    }
     
  }

  function tooltipser(e)
  {
    actualTips = this.className;
    overTooltip=true; 
    if(typeof(ttCache[this.className]) != "undefined")
    {
      $('#tooltipser-box').hide(0);
      $('#tooltipser-box').html(ttCache[this.className]);
      $('#tooltipser-box').show(0);
    }
    else
    {
      d = this.className;     
      $.ajax({
        type: 'POST', // Use the POST method.
        url: '?q=tooltipser',
        dataType: 'json',
        success: tooltipserLoaded,
        data: 'data='+d
      });
      //alert(d);
    }
  }
  
  function tooltipser2(e)
  {
    actualTips = this.className;
    overTooltip=true;
    if(typeof(ttCache[this.className]) != "undefined")
    {
      $('#tooltipser-box').hide(0);
      $('#tooltipser-box').html(ttCache[this.className]);
      $('#tooltipser-box').show(0);
    }
    else
    {
      d = this.className;
      $.ajax({
        type: 'POST', // Use the POST method.
        url: '?q=tooltipser2',
        dataType: 'json',
        success: tooltipserLoaded,
        data: 'data='+d
      });
    }

  }
  
  
  function ttMouse(e)
  {
    ttMouseX = e.pageX+16;
    ttMouseY = e.pageY;
    $('#tooltipser-box').css({
       left: ttMouseX,
       top: ttMouseY
     });
  }
  
  function ttHide(e){
    $('#tooltipser-box').hide(0);
    overTooltip=false;
  }
  
  $(document).ready(function () {
    $('.tt').bind("mouseover",tooltipser);
    $('.tt').bind("mousemove",ttMouse);
    $('.tt').bind("mouseout",ttHide);
    $('.ttt').bind("mouseover",tooltipser2);
    $('.ttt').bind("mousemove",ttMouse);
    $('.ttt').bind("mouseout",ttHide);
  });
}

