		var mapa; // obiekt globalny
		var marker;
		
		var mapa = document.createElement('div');
		
		
		function mapaStart(n, e, sc)  
		{  
		    if(GBrowserIsCompatible())
		    {
				var center = new GLatLng(n, e);	
				mapa = new GMap2(document.getElementById('googlemaps'));
				
				mapa.setCenter(center, sc);
				mapa.addControl(new GSmallZoomControl());
				
				dodajMarker(n, e, 'obiekt');
			 }
		}
		
		function setTypeMaps(typ)
		{
			
			if (typ == 'map')
			{
				mapa.setMapType(G_NORMAL_MAP);
			}
			else if (typ == 'teren')
			{
				mapa.setMapType(G_PHYSICAL_MAP);
			}
			else if (typ == 'satelite')
			{
				mapa.setMapType(G_SATELLITE_MAP);
			}
			
			ustawCookie('typmapy', typ);
		}
		
		function ustawTypMapy()
		{
			var typ = pokazCookie('typmapy');
			
			if (typ == "")
			{
				var ntyp = "map";
			}
			setTypeMaps(typ);
			$("#typ#"+typ).addClass('mapTypSel');
		}
		
		function dodajMarker(gn,ge,t,l)  
		{
			var punkt = new GLatLng(gn,ge)
			marker = new GMarker(punkt,{title: t});
			mapa.addOverlay(marker);
			
			if (l != "")
			{
				GEvent.addListener(marker,"click",function()
					{  
						document.location.href='http://www.vtour.pl/pl/miasto/'+l;
					});
			}
		}
