/*
 * Tooltip script 
 * powered by jQuery (http://www.jquery.com)
 * written by Alen Grakalic (http://cssglobe.com)
 * edited by Bruno-Pierre Campeau (http://www.cirquedusoleil.com)
 * for more info visit http://cssglobe.com/post/1695/easiest-tooltip-and-image-preview-using-jquery
 */
this.tooltip = function(){	
  /* CONFIG */		
    var posiX = 0;    // these 2 variable determine popup's distance from the cursor
    var posiY = 43;  // you might want to adjust to get the right result			
  /* END CONFIG */		
  $("a.tooltip").hover(function(e){											    
    var posiToolTip = $(this).offset();//Création de l'objet qui retourne le positionnement de l'élément
    this.t = this.title; //Initie l'élément title du lien
    $("body").append("<p id='tooltip'>"+ this.t +"</p>");//élément contenant le tooltip
    $("#tooltip")
      //DÉCOMENTER POUR POUVOIR PERMETTRE LE TRACKING DÉPLACEMENT DE LA SOURIS
      /* .css("top",(e.pageY - xOffset) + "px")
       .css("left",(e.pageX + yOffset) + "px")*/
      //À METTRE EN COMMENTAIRE POUR PERMETTRE LE DÉPLACEMENT DE LA SOURIS
      .css("top",(posiToolTip.top - posiY) + "px")//Positionnement sur les Y
      .css("left",(posiToolTip.left + this.offsetWidth/2 + posiX) + "px")//Positionnement sur les X
      .fadeIn("fast");//Animation de fade		
    },
    function(){
      this.title = this.t;		
      $("#tooltip").remove();
    });
    //DÉCOMENTER POUR POUVOIR PERMETTRE LE TRACKING DU DÉPLACEMENT DE LA SOURIS
    /* $("a.tooltip").mousemove(function(e){
        $("#tooltip")
          .css("top",(e.pageY - xOffset) + "px")
          .css("left",(e.pageX + yOffset) + "px");
        });*/			
};