
	var mapa;
	var geo; 

	function mapaStart(control)   
	    {   
	        if(GBrowserIsCompatible())  // sprawdzamy, czy przeglądarka jest kompatybilna   
	        {   
	        	mapa = new GMap2(document.getElementById("mapa"));
	        	adres="Polska";
	        	geo = new GClientGeocoder();
	 	        if(!geo) return;  
	 	        geo.getLatLng(adres,function(start){
	 	    	
		            mapa.setCenter(new GLatLng(start.lat(),start.lng()),16);   
					mapa.setMapType(G_NORMAL_MAP);
	 	        });
	 	        
	 	        if(control=='')
	 	        	mapa.addControl(new GLargeMapControl());
	 	        //mapa.addControl(new GOverviewMapControl());
	 	       	//mapa.addControl(new GScaleControl()); 
	 	        
	 	        mapa.enableDoubleClickZoom();
	 	        mapa.enableContinuousZoom();
	 	        mapa.enableScrollWheelZoom();
	 	        
	 	        
	 	       GEvent.addListener(mapa,'click',function(marker,punkt) {
	 	 		 
	 			     if(marker)  
	 			     {  
	 			    	 marker.openInfoWindowHtml(marker.txt);
	 			     }  
	 			     else if(punkt)  
	 			     {     
	 			           
	 			     }  
	 			 });
	        }   
	    } 

	function doAdresu(adres, opis, image, width, no_info)  
	   {  		 
		   if(no_info=='')no_info='0';
		   if(width=='')width='50';
		   
		   
		   geo = new GClientGeocoder();
	       if(!geo) return;  
	       geo.getLatLng(adres,function(punkt)  
	       {  
	           if (!punkt)  
	           {  
	               // jeśli punkt nie istnieje, to adres nie został znaleziony  
	               //alert(adres + " nie został znaleziony!");  
	           }  
	           else  
	           {  
	               mapa.panTo(punkt);  
	               //mapa.clearOverlays();  
	                 
	               var ikona = new GIcon(G_DEFAULT_ICON);  
	               /*
	               ikona.image='http://maps.google.com/mapfiles/kml/pal3/icon52.png';  
	               ikona.shadow='';  
	               ikona.iconSize=new GSize(32,32);  
	               ikona.iconAnchor=new GPoint(16,16);  
	               ikona.infoWindowAnchor=new GPoint(16,16);  
	                 //*/
	               var marker = new GMarker(punkt,{icon: ikona, title: adres});  
	               mapa.addOverlay(marker);  
	                 
	               var img='><img width="100" src="'+image+'">';
	               if( image=='' ) img=' width="1" >';
	               
	               marker.txt='<div style="color: black;"><table><tr><td width="'+width+'"><strong>'+opis+'</strong><br>'+adres+'</td><td'+img+'</td></tr></table></div>';  
	               
	               if(no_info!='1'){	            	   
	            	   marker.openInfoWindowHtml(marker.txt);
	               }	               
	               mapa.setCenter(punkt, 12); 
	               
	           }  
	       });  
	       geo.getLatLng('lublin',function(punkt)  
	    	       {  
	    	           if (punkt)  	    	          
	    	           {  
	    	               mapa.setCenter(punkt, 12); 
	    	           }  
	    	       });  
	   } 
	
	//51.285236,22.531303
	function doAdresuXY(x,y,adres, opis, width, no_info)  
	  {  		 
		   if(no_info=='')no_info='0';
		   if(width=='')width='50';
		   
		   
		   geo = new GClientGeocoder();
	       if(!geo) return;  
	       
	       var punkt = new google.maps.LatLng(x,y);
	        	       
	           if (!punkt)  
	           {  
	               // jeśli punkt nie istnieje, to adres nie został znaleziony  
	               //alert(adres + " nie został znaleziony!"); 
	        	   
	           }  
	           else  
	           {  
	        	  
	               mapa.panTo(punkt);  
	               //mapa.clearOverlays();  
	                 
	               var ikona = new GIcon(G_DEFAULT_ICON);  
	               /*
	               ikona.image='http://maps.google.com/mapfiles/kml/pal3/icon52.png';  
	               ikona.shadow='';  
	               ikona.iconSize=new GSize(32,32);  
	               ikona.iconAnchor=new GPoint(16,16);  
	               ikona.infoWindowAnchor=new GPoint(16,16);  
	                 //*/
	               var marker = new GMarker(punkt,{icon: ikona, title: adres});  
	               mapa.addOverlay(marker);  
	                 
	              
	               
	               marker.txt='<div style="color: black;"><table><tr><td width="'+width+'"><strong>'+opis+'</strong><br>'+adres+'</td></tr></table></div>';  
	               
	               if(no_info!='1'){	            	   
	            	   marker.openInfoWindowHtml(marker.txt);
	               }	               
	               mapa.setCenter(punkt, 14); 
	               
	           }  

	   }   
	
 