var iCurrentMarkerIndex = 0;

function InfoBox(pMarker, pWidth, pHeight, pAnchorOffsetX, pAnchorOffsetY) 
{
	this.marker = pMarker;
	this.divHeight = pHeight;
	this.divWidth = pWidth;

	this.anchorOffsetX = (pAnchorOffsetX == null) ? 0 : pAnchorOffsetX;
	this.anchorOffsetY = (pAnchorOffsetY == null) ? 0 : pAnchorOffsetY;	
}

InfoBox.prototype = new GOverlay();

InfoBox.prototype.initialize = function(map) 
{
  var oDiv = document.createElement("div");
  oDiv.style.height = this.divHeight + 'px';
  oDiv.style.width = this.divWidth + 'px';
  oDiv.style.position = "absolute";

  var sImageHTML = "<img style=\"float: left; border: 1px #666666 solid; margin: 0 10px 0 0;\" src=\"images/contact_logo.gif\" alt=\"Three Counties Schoolwear\"/>";
  
  oDiv.innerHTML = "<div style=\"height: 130px; width: 400px;\"><div style=\"height: 80px; width: 380px; font-size: 0.9em; background-image: url(images/background_infobox.png);color:#ffffff;padding: 10px 10px 10px 10px;\"><a href=\"#\" onclick=\"return closeOverlay();\" title=\"close\"><img style=\"float: right;\" src=\"images/icon_close.gif\" alt=\"close\"/>" + sImageHTML + "</a><p style=\"margin: 0 0 5px 0; color: #ffffff;\">Three Counties Schoolwear<br/>Suite 1, Thrifty House, 4 Bilton Road,<br/>Hitchin,<br/>Hertfordshire<br/>SG4 0SB</p></div><div style=\"height: 50px; width: 400px; background-image: url(images/pointer.png);\"></div></div>";

  oDiv.style.left = (map.fromLatLngToDivPixel(this.marker.getPoint()).x - this.anchorOffsetX)+ 'px';
  oDiv.style.top = (map.fromLatLngToDivPixel(this.marker.getPoint()).y - this.divHeight - this.anchorOffsetY) + 'px';

  map.getPane(G_MAP_FLOAT_PANE).appendChild(oDiv);
  this.map_ = map;
  this.div_ = oDiv;
  //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';
}