function EWindow(map)
{
  this.ie = false;
	this.map = map;
	this.visible = false;

	var agent = navigator.userAgent.toLowerCase();

	if ((agent.indexOf("msie") > -1) && (agent.indexOf("opera") < 1)) this.ie = true
	else this.ie = false
} 
      
EWindow.prototype = new GOverlay();

EWindow.prototype.initialize = function(map)
{
	var div1 = document.createElement("div");
	div1.style.height = "125px";
	div1.style.position = "absolute";
	div1.style.width = "247px";
	div1.style.zIndex = 9999;
	document.getElementById("map_pan").appendChild(div1);

	var div2 = document.createElement("div");
	div2.style.height = "24px";
	div2.style.position = "absolute";
	div2.style.width = "24px";
	div2.style.zIndex = 9999;
	document.getElementById("map_pan").appendChild(div2);

	this.div1 = div1;
	this.div2 = div2;
}

EWindow.prototype.openOnMarker = function(marker,html)
{
	var vx = marker.getIcon().iconAnchor.x - marker.getIcon().infoWindowAnchor.x;
	var vy = marker.getIcon().iconAnchor.y - marker.getIcon().infoWindowAnchor.y;

	this.openOnMap(marker.getPoint(), html, new GPoint(vx,vy));
}

EWindow.prototype.openOnMap = function(point, html, offset)
{
	this.offset = offset||new GPoint(0,0);
	this.point = point;

	this.div1.innerHTML = '<div><nobr>' + html + '</nobr></div>';

	if (this.ie)
	{
		this.div2.innerHTML = '<div style="height:24px; width:24px; filter:progid:DXImageTransform.Microsoft.AlphaImageLoader(src=\'/images/stem.png\', sizingMethod=\'scale\');"></div>';
	}
	else
	{
		this.div2.innerHTML = '<img src="/images/stem.png" width="24" height="24" />';
	}

	this.visible = true;
	this.show();
	this.redraw(true);
}

EWindow.prototype.redraw = function(force)
{
	if (!this.visible) {return;}

	var p = this.map.fromLatLngToContainerPixel(this.point);

	this.div1.style.left = (p.x + 10) + "px";
	this.div1.style.top = (p.y - 125 - 24 + 10) + "px";

	this.div2.style.left = (p.x + 10) + "px";
	this.div2.style.top = (p.y - 24 + 10) + "px";
}

EWindow.prototype.remove = function()
{
	this.div1.parentNode.removeChild(this.div1);
	this.div2.parentNode.removeChild(this.div2);

	this.visible = false;
}

EWindow.prototype.copy = function()
{
	return new EWindow(this.map);
}

EWindow.prototype.show = function()
{
	this.div1.style.display = "";
	this.div2.style.display = "";

	this.visible = true;
}

EWindow.prototype.hide = function()
{
	this.div1.style.display = "none";
	this.div2.style.display = "none";

	this.visible = false;
}

EWindow.prototype.isHidden = function()
{
	return !this.visible;
}

EWindow.prototype.supportsHide = function()
{
	return true;
}