function InfoBox(marker, divWidth, divHeight, divClassName, template, anchorOffsetX, anchorOffsetY) 
{
	this.marker = marker;
	this.template = template;
	this.divHeight = divHeight;
	this.divWidth = divWidth;
	this.divClassName = divClassName;
	
	this.anchorOffsetX = anchorOffsetX;
	
	if (null == this.anchorOffsetX)
	{
		this.anchorOffsetX = 0;
	}
	
	this.anchorOffsetY = anchorOffsetY;
	
	if (null == this.anchorOffsetY)
	{
		this.anchorOffsetY = 0;
	}

}

InfoBox.prototype = new GOverlay();

InfoBox.prototype.initialize = function(map) 
{

  var div = document.createElement("div");
  div.style.position = "absolute";
  div.style.height = this.divHeight + 'px';
  div.style.width = this.divWidth + 'px';
  div.className = this.divClassName;
  //div.innerHTML = this.template.evaluate(this.marker.place);
  div.innerHTML = this.template.apply(this.marker.place);

  div.style.left 	= (map.fromLatLngToDivPixel(this.marker.getPoint()).x - this.anchorOffsetX)+ 'px';
  div.style.top 	= (map.fromLatLngToDivPixel(this.marker.getPoint()).y - this.divHeight - this.anchorOffsetY) + 'px';

  map.getPane(G_MAP_FLOAT_PANE).appendChild(div);

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

  
  //this.marker.hide();
  
}

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

InfoBox.prototype.redraw = function(force) 
{
  this.div_.style.left 	= (this.map_.fromLatLngToDivPixel(this.marker.getPoint()).x - this.anchorOffsetX)+ 'px';
  this.div_.style.top = (this.map_.fromLatLngToDivPixel(this.marker.getPoint()).y - this.divHeight - this.anchorOffsetY) + 'px';
}
