var AjaxTip =
{
    init:function()
    {
          var hideDelay = 100;    
          var currentID;  
          var hideTimer = null;  
          
          // One instance that's reused to show info for the current person  
          var container = $('<div id="personPopupContainer"><div id="personPopupContent"></div></div>');  
          
          $('body').append(container);  
          
          $('.personPopupTrigger').live('mouseover', function()  
          {    
              var content = $(this).attr('rel'); 
          
              if (hideTimer)  
                  clearTimeout(hideTimer);  
          
              var pos = $(this).offset();  
              var width = $(this).width();
              var height = $(this).height();

              container.css({
                  left: (pos.left + width + 20) + 'px',  
                  top: pos.top - 5 + 'px'  
              });

              $('#personPopupContent').html(content);
              
              container.css('display', 'block');  
          });  
          
          $('.personPopupTrigger').live('mouseout', function()  
          {  
              if (hideTimer)  
                  clearTimeout(hideTimer);  
              hideTimer = setTimeout(function()  
              {  
                  container.css('display', 'none');  
              }, hideDelay);  
          });  
          
          // Allow mouse over of details without hiding details  
          $('#personPopupContainer').mouseover(function()  
          {  
              if (hideTimer)  
                  clearTimeout(hideTimer);  
          });  
          
          // Hide after mouseout  
          $('#personPopupContainer').mouseout(function()  
          {  
              if (hideTimer)  
                  clearTimeout(hideTimer);  
              hideTimer = setTimeout(function()  
              {  
                  container.css('display', 'none');  
              }, hideDelay);  
          });
    }

}; 
