function ToolTipOverlay() 
{
	// container element
	this._container = null;

	// map
	this._map = null;
}

ToolTipOverlay.prototype = new GOverlay();
ToolTipOverlay.prototype.initialize = function (map) 
{
	// store map reference
	this._map = map;

        // create container
        this._container = document.createElement("div");
	this._container.setAttribute('id','point_tooltip');
	$(this._container).hide();

        map.getContainer().appendChild(this._container);
        return this._container;
}

ToolTipOverlay.prototype.getDefaultPosition = function() { return new GControlPosition(G_ANCHOR_TOP_LEFT, new GSize(0, 0)); }
ToolTipOverlay.prototype.remove = function () { $(this._container).remove(); }
ToolTipOverlay.prototype.copy = function () { return new ToolTipOverlay(); }
ToolTipOverlay.prototype.redraw = function (force) { this.hide(); }

ToolTipOverlay.prototype.display = function (html,marker)
{
	this._container.innerHTML = html;

	// calculate position
	var point = this._map.getCurrentMapType().getProjection().fromLatLngToPixel(this._map.fromContainerPixelToLatLng(new GPoint(0,0),true),this._map.getZoom());
	var offset = this._map.getCurrentMapType().getProjection().fromLatLngToPixel(marker.getPoint(),this._map.getZoom());
	var anchor = marker.getIcon().iconAnchor;
	var width = marker.getIcon().iconSize.width + 5;
	var height = 0; //this._container.clientHeight;

	// position tooltip
	var pos = new GControlPosition(G_ANCHOR_TOP_LEFT, new GSize(offset.x - point.x - anchor.x + width, offset.y - point.y - anchor.y - height));
	pos.apply(this._container);

	// show
	$(this._container).show();
}

ToolTipOverlay.prototype.hide = function () { $(this._container).hide(); }

