function TGLabel(point,text,offsetX,offsetY) 
{
  this.point = point;
  this.text = text;
  
  if(!offsetX)
  {
      offsetX = 0;
      offsetY = 0;
  }
  
  this.offsetX = offsetX;
  this.offsetY = offsetY;
}

TGLabel.prototype = new GOverlay();

TGLabel.prototype.initialize = function(map) 
{
  var div = document.createElement("div");
  div.style.border = "1px solid #FF8888";
  div.style.backgroundColor = "#FFFF88";
  div.style.position = "absolute";
  div.style.paddingLeft="2px";
  div.style.paddingRight="2px";
  div.innerHTML = this.text;
  
  map.getPane(G_MAP_MARKER_PANE).appendChild(div);

  this.map_ = map;
  this.div_ = div;
}

TGLabel.prototype.remove = function() 
{
  this.div_.parentNode.removeChild(this.div_);
}


TGLabel.prototype.copy = function() 
{
  return new TGLabel(this.point, this.text);
}

TGLabel.prototype.redraw = function(force) 
{
  if (!force) return;

  var p = this.map_.fromLatLngToDivPixel(this.point);
  
  this.div_.style.left = (p.x - (Element.getWidth(this.div_) / 2.0) + this.offsetX) + "px";
  //this.div_.style.top = (p.y + (Element.getHeight(this.div_) / 2.0) + this.offsetY) + "px";
  this.div_.style.top = (p.y +  this.offsetY + 5)  + "px";
}

