AfficherInfoBulle = function(e)
{
  var text = $(this).next('.glossary_content');
  if (text.attr('class') != 'glossary_content')
    return false;

  text.fadeIn()
    .css('top', e.pageY)
    .css('left', e.pageX+10);

  return false;
}
CacherInfoBulle = function(e)
{
  var text = $(this).next('.glossary_content');
  if (text.attr('class') != 'glossary_content')
    return false;

  text.fadeOut();
}

InstallationInfoBulle = function()
{
  $('.def')
    .each(function(){
      // load the definition
      var definition = 'test';
      var item = $(this);
      $.post('/inc/ajax/loadTermDefinition.php', {language: language, key : $(this).attr('id')}, function(data){
          definition = data;
                item
        .after($('<span/>')
          .attr('class', 'glossary_content')
          .html(definition))
        .attr('title', '');
      });

    })
    .hover(AfficherInfoBulle, CacherInfoBulle);
}

$(document).ready(function() {
  InstallationInfoBulle();
});
