function InfoBox(marker, divWidth, divHeight, divClassName, anchorOffsetX, anchorOffsetY, html) {
	this.marker = marker;
	this.divHeight = divHeight;
	this.divWidth = divWidth;
	this.divClassName = divClassName;
	this.html = html
	
	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){
	
	//alert('infobox initizliazing')
	
	var div = document.createElement("div");
	//alert(div.style.className)
	div.style.id = this.divClassName
	div.style.className = this.divClassName;
	//alert(div.style.className)
	//div.class = this.divClassName;
	
	
	div.style.position = "relative";
	div.style.height = this.divHeight + 'px';
	div.style.width = this.divWidth + 'px';
	div.style.paddingLeft = "14px";
	div.style.paddingTop = "14px";
	div.style.color = "#ffffff";
	
	
	
	/* IE6 AND OLDER PNG FIX */
	
	var ie6 = false;
	//alert("navigator.appName: "+navigator.appName);
	if (navigator.appName == 'Microsoft Internet Explorer'){
		var ua = navigator.userAgent;
		//alert(ua);
		var re  = new RegExp("MSIE ([0-9]{1,}[\.0-9]{0,})");
		if (re.exec(ua) != null){
			ver = parseFloat( RegExp.$1 );
			if ( ver > -1 ){
				if ( ver <= 6.0 ){
					ie6 = true
				}
			}
		}
	}
	
	if(ie6){
		//alert("ie6 fix");
		//div.style.background.filter = "progid:DXImageTransform.Microsoft.AlphaImageLoader(src='images/infowindowbg.png',sizingMethod='crop')";
		div.style.background = "url(images/infowindowbg.gif) no-repeat";
	}else{
		//alert("not ie6");
		div.style.background = "url(images/infowindowbg.png) no-repeat";
	}

	/* END IE6 AND OLDER PNG FIX */
	
	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';
	
	div.innerHTML = this.html
	
	var buttonDiv = document.createElement("div");
	
	buttonDiv.style.background="url(windowClose.gif) no-repeat";
	buttonDiv.style.position = "absolute"
	buttonDiv.style.height = "9px"
	buttonDiv.style.width ="11px";
	buttonDiv.style.top = "12px";
	buttonDiv.style.right = "25px";
	buttonDiv.style.cursor = 'pointer';
	GEvent.addDomListener(buttonDiv, 'click', function() {
		//alert("click close");
		map.removeOverlay(map.infobox)
	});
	
	
	div.appendChild(buttonDiv)

	
	map.getPane(G_MAP_FLOAT_PANE).appendChild(div);
	this.map_ = map;
	this.div_ = div;
	

}

InfoBox.prototype.remove = function() {
	var divparent = this.div_.parentNode ? this.div_.parentNode : this.div_.parent;
	divparent.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';
}

