function ClickWindow(text,latLng,map)
{
	this.div_=null;
	this.content_	=text;	 
	this.map_ = map;
 	
	this.latlng_	=latLng;
	
	
   // Explicitly call setMap() on this overlay
   this.setMap(map);
}

ClickWindow.prototype =new google.maps.OverlayView();

ClickWindow.prototype.draw=function()
{
	
	var project = this.getProjection();
	var xy =	project.fromLatLngToDivPixel(this.latlng_);
	
		this.div_.style.left	=	xy.x-246+"px";
		this.div_.style.top		=	xy.y-185+"px";
		
	this.offSet();
	
} 
	
ClickWindow.prototype.onAdd=function()
{
	
	if(this.div_!=null)
	{
		this.setMap(null);	
	}
		var clickWin=document.createElement('div');
			clickWin.id="clickWindow";
		
			
			if(typeof this.content_ =='object')
			{
				clickWin.appendChild(this.content_);
			}
			else
			{
				clickWin.innerHTML=this.content_;
			}
			
		this.div_=clickWin;
	
	var panes = this.getPanes();
		panes.floatPane.appendChild(clickWin);

}
	
ClickWindow.prototype.onRemove=function()
{
	this.div_.parentNode.removeChild(this.div_);
	this.div_ = null;
}


ClickWindow.prototype.offSet=function()
{
	var project = this.getProjection();
	var xy =	project.fromLatLngToDivPixel(this.latlng_);
	
	var offsetX=xy.x-70;
	var offsetY=xy.y-84;
	var point = new google.maps.Point(offsetX,offsetY);
	
	var offset=project.fromDivPixelToLatLng(point);
	
	map.setCenter(offset);	
}
