function ToolTip(marker, html, width, options) {
  this.marker_ = marker;
  this.html_ = html;
  this.width_ = (width ? width + "px" : "auto");
  
  options = options == null ? {} : options;
  this.className_ = options.className == null ? "map-tooltip" : '';  
}

ToolTip.prototype = new GOverlay();

ToolTip.prototype.initialize = function(map) {
  var div = document.createElement("div");
  div.style.display = "none";
  div.innerHTML = this.html_;
  div.style.position = "absolute";
  div.style.width = this.width_;
  //div.style.font = "bold 10px/10px verdana, arial, sans";
  //div.style.border = "1px solid #aa55aa";
  //div.style.background = "#ffffff";
  //div.style.color = "#aa55aa";
  //div.style.padding = "4px";
  div.style.whiteSpace = "nowrap";
  if(this.width_ != 'auto') div.style.overflow = "hidden";  
  div.className = this.className_;
  
  map.getPane(G_MAP_FLOAT_PANE).appendChild(div);
  this.map_ = map;
  this.container_ = div;
}

ToolTip.prototype.remove = function() {
  this.container_.parentNode.removeChild(this.container_);
}

ToolTip.prototype.copy = function() {
  return new ToolTip(this.marker_, this.html_, this.width_);
}

ToolTip.prototype.redraw = function(force) {
  if(!force) return;
  var pixelLocation = this.map_.fromLatLngToDivPixel(this.marker_.getPoint());
  this.container_.style.left = pixelLocation.x + "px";
  this.container_.style.top = pixelLocation.y + "px";
  this.container_.style.display = 'block'; 
}


