var Bubble = function(el, text){
  if(text == '') return;
  this.offsetX = -8;
  this.offsetY = 38;
  this.target = $('#'+el);
  this.text = text;
  this.makeBubble();  
};

Bubble.prototype = {
 
  makeBubble: function() {
    
    var bubble = $("<div class='bubble' style='display:none;'></div>"),
        content = "<div class='content'>" + this.text + "</div>";
    
    bubble.append(content);
    $('body').append(bubble);
    this.bubble = bubble;
    var that = this;

    this.target.mouseover(function(){
      position = [];
      position[0] = that.target.offset().left;
      position[1] = that.target.offset().top;

      that.bubble.css({top:position[1], left:position[0] + that.target.width() + that.offsetY});      
      that.bubble.show(); 
      
    });
        
    $(this.target).mouseout(function(){
      that.bubble.hide();       
    });    
  }
};

var BubbleHelper = {
  set: function(){
    $('.define').each(function(l){
      new Bubble(l);      
    });
}};


