function googleMaps ()
{
	
	this.mapa = false;
	this.zoomLevel = 11;
	this.idMapDiv = 'map';
	this.ikona1;
	this.ikona1Title;
	
	this.iconTypeArr = new Array('clickable','draggable','title','icon');
	
	this.checkBrowser = function()
	{
		return GBrowserIsCompatible();
	};
	
	this.setNewIcon = function (title,ico,shadow)
	{
		this.ikona1 = new GIcon();  
        this.ikona1.image = ico;  
        this.ikona1.shadow = shadow;  
        this.ikona1.iconSize = new GSize(38, 34);  
        this.ikona1.infoWindowAnchor = new GPoint(16,16);  
        this.ikona1.iconAnchor = new GPoint(16,16);  
        this.ikona1.shadowSize = new GSize(38, 34);  
        this.ikona1Title = title;
	}
	
	this.loadMap = function(lat,lng)
	{
		if(this.checkBrowser())
		{
			this.mapa = new GMap2(document.getElementById(this.idMapDiv),{mapTypes: [G_NORMAL_MAP]});
     		this.mapa.setCenter(new GLatLng(lat,lng),15);    
     		this.mapa.addControl(new GLargeMapControl());  
     		this.mapa.addControl(new GScaleControl());  
     		this.mapa.addControl(new GOverviewMapControl()); 
		}
		else
		{
			this.loadMapError();
		}
		//53.41935400090768,14.58160400390625
	};
	
	
	this.addMarker = function(lat,lng,txt)
	{
		var marker = new GMarker(new GLatLng(lat,lng),{title:this.ikona1Title , icon: this.ikona1});  
		this.mapa.addOverlay(marker);  
        GEvent.addListener(marker,"click",function() 
        {  
             marker.openInfoWindowHtml(txt);  
        }); 
      	return marker;  
	};
	
	
	this.setMapDivId = function(mapID)
	{
		mapID = mapID.trim();
		if(mapID.length)
		{
			if(document.getElementById(mapID))
			{
				this.idMapDiv = mapID;
				return 1;
			}
			else
				return -2;
		}
		else
			return -1;
	};
	
	this.getGeoPunkt = function(address,txt)
	{
		var geo = new GClientGeocoder(); 
		var tmp = this;
		geo.getLatLng(address,function(point)  
 		{  
     		 if (!point)  
		     {  
		        divShowInfo(1,'','',300,50,300,150,'Nie znaleziono punktu na mapie','');
		     }  
		     else  
		     {  
		     	  tmp.loadMap(point.lat(),point.lng());
		          tmp.addMarker(point.lat(),point.lng(),txt);
		     }  
		 });  
	};
	
	this.loadMapError = function()
	{
		alert('BłĄD');
	};
	
	
}
