function Label(opt_options) {
  // Initialization
  this.setValues(opt_options);
  // Label specific
  var div = this.div_ = document.createElement('div');
  div.id = "marker_tooltip";
  div.style.cssText = 'position: absolute; display: none';
};

Label.prototype = new google.maps.OverlayView;

// Implement onAdd
Label.prototype.onAdd = function() {
  var pane = this.getPanes().floatPane;
  pane.appendChild(this.div_);

 // Ensures the label is redrawn if the text or position is changed.
  var me = this;
  this.listeners_ = [
    google.maps.event.addListener(this, 'marker_changed',
      function() { me.draw(); })
  ];
};

Label.prototype.hide = function() {
  if (this.div_) {
    this.div_.style.visibility = "hidden";
  }
  this.set( 'marker', undefined);
}

// Implement onRemove
Label.prototype.onRemove = function() {
 // Label is removed from the map, stop updating its position/text.
  for (var i = 0, I = this.listeners_.length; i < I; ++i) {
    maps.google.event.removeListener(this.listeners_[i]);
  }
  this.div_.parentNode.removeChild(this.div_ );
};

// Implement draw
Label.prototype.draw = function() {
  if ( this.get('marker') != undefined) {
    var projection = this.getProjection();
    var position = projection.fromLatLngToDivPixel(this.get('marker').getPosition());

    var div = this.div_;
    div.style.left = (position.x) + 'px';
    div.style.top = (position.y - 25) + 'px';
    div.style.display = 'block';
    this.div_.style.visibility = "visible";

    div.innerHTML = this.get('marker').get('text').toString();
  }
};

