 // tooltip
 show_tooltip = function(e) {
   var text = $(this).next(".tooltip-text");

   if (text.attr("class") != "tooltip-text")
     return false;

   text.show().css("top", e.pageY).css("left", e.pageX+15);
   
   return false;
 }
  
 hide_tooltip = function(e) {
   var text = $(this).next(".tooltip-text");

   if (text.attr("class") != "tooltip-text")
     return false;

   text.hide();
 }

 setup_tooltips = function() {
   $(".tooltip").each(function(){
     $(this).after($("<span/>").attr("class", "tooltip-text").html($(this).attr("title").replace(/ /g, '&nbsp;'))).attr("title", "");
   }).hover(show_tooltip, hide_tooltip);
 }
 
 // help
 show_help = function(e) {
   var text = $(this).next(".help-text");

   if (text.attr("class") != "help-text")
     return false;

   text.fadeIn().css("top", e.pageY).css("left", e.pageX+10);
   
   return false;
 }
  
 hide_help = function(e) {
   var text = $(this).next(".help-text");

   if (text.attr("class") != "help-text")
     return false;

   text.fadeOut();
 }

 setup_help = function() {
   $(".help").each(function(){
     $(this).after($("<span/>").attr("class", "help-text").html($(this).attr("title").replace(/ /g, '&nbsp;'))).attr("title", "");
   }).hover(show_help, hide_help);
 }