/*
 * Adapted from Tooltip script written by Alen Grakalic (http://cssglobe.com)
 *
 * For more original info visit
 * http://cssglobe.com/post/1695/easiest-tooltip-and-image-preview-using-jquery
 *
 * A big wrapper init function to convert all titleblurb class <A> title to be
 * popup tooltip on user rollover
 */
function initTitleBlurb(inClass) {
  $("a.titleblurb").hover(function(e){
    // these 2 variable determine popup's distance from the cursor
    xOffset = 10;
    yOffset = 20;

    this.t = this.title;
    this.title = "";
    $("body").append("<p class='titleblurb'>"+ this.t +"</p>");
    $("p.titleblurb")
      .css("position", "absolute")
      .css("top",(e.pageY - xOffset) + "px")
      .css("left",(e.pageX + yOffset) + "px")
      .css("z-index", 999)
      .fadeIn("fast");
  },
  function(){
    this.title = this.t;
    $("p.titleblurb").remove();
  });
  $("a.titleblurb").mousemove(function(e){
    // these 2 variable determine popup's distance from the cursor
    xOffset = 10;
    yOffset = 20;

    $("p.titleblurb")
    .css("top",(e.pageY - xOffset) + "px")
    .css("left",(e.pageX + yOffset) + "px");
  });
}