this.tooltip = function(){
   xOffset = 6;
   yOffset = 16;
   jQuery("[title],[alt]").hover(function(e){
   if(this.title !=''){
      this.t = this.title;
      this.title = "";
   } else {
      this.t = this.alt;
      this.alt = "";
 }     
 jQuery("body").append("<p id='tooltip'>"+ this.t +"</p>");
      jQuery("#tooltip")
         .css("top",(e.pageY - xOffset) + "px")
         .css("left",(e.pageX + yOffset) + "px")
         .show();
   },
   function(){
      this.title = this.t;
      this.alt = this.t;
      jQuery("#tooltip").remove();
   });
   jQuery("[title],[alt]").mousemove(function(e){
      jQuery("#tooltip")
         .css("top",(e.pageY - xOffset) + "px")
         .css("left",(e.pageX + yOffset) + "px");
   });
};

jQuery(document).ready(function(){
   tooltip();
});
