//<![CDATA[
		
	var map = null;
    var geocoder = null;		
	
	function load(num) 
	{
      if (GBrowserIsCompatible()) 
		{
        	map = new GMap2(document.getElementById("map"));
       		map.addControl(new GLargeMapControl());
			
        	geocoder = new GClientGeocoder();
            
            indirizzo  = "";
            indirizzo2 = "";
            indirizzo3 = "";
            indirizzo4 = "";
            
            
            if(num == 0)
            {
				indirizzo = "Via Catagnina, 12, 54100 Massa, Massa-Carrara, Toscana, Italia";	
				indirizzo2 = "Via del Brennero, 1996, 55100 Lucca Lucca, Toscana, Italia";
				indirizzo3 = "Via Camporcioni, 11, 51019 Ponte Buggianese, Pistoia, Toscana, Italia";
			}
			else if(num == 1)
			{
				indirizzo = "Via Camporcioni, 11, 51019 Ponte Buggianese, Pistoia, Toscana, Italia";
			}
			else if(num == 2)
			{
				indirizzo = "Via Camporcioni, 11, 51019 Ponte Buggianese, Pistoia, Toscana, Italia";
			}
			else if(num == 3)
			{
				indirizzo = "Via del Brennero, 1996, 55100 Lucca Lucca, Toscana, Italia";
			}
			else if(num == 4)
			{
				indirizzo = "Via del Brennero, 1996, 55100 Lucca Lucca, Toscana, Italia";
			}
			else if(num == 5)
			{
				indirizzo = "Via del Brennero, 1996, 55100 Lucca Lucca, Toscana, Italia";
			}
			else if(num == 6)
			{
				indirizzo= "Gioviano, Borgo a Mozzano, Lucca (Toscana), Italy";
			}
			else if(num == 99)
			{
				indirizzo = "Via Catagnina, 12, 54100 Massa, Massa-Carrara, Toscana, Italia";	
				indirizzo2 = "Via del Brennero, 1996, 55100 Lucca Lucca, Toscana, Italia";
				indirizzo3 = "Via Camporcioni, 11, 51019 Ponte Buggianese, Pistoia, Toscana, Italia";
				indirizzo4= "Gioviano, Borgo a Mozzano, Lucca (Toscana), Italy";
				//GARFAGNANA
			}
		
			showAddress(num,indirizzo,indirizzo2,indirizzo3,indirizzo4);
      }
    }
		
		
		function showAddress(num,address,address2,address3,address4) 
		{
	    	indirizzopopup = "";
			
			if(num == 0 || num == 99)//mostrarli tutti + o - garfagnana
            {
				indirizzopopup = "<strong>Tristar</strong><br/>Via Catagnina 12 (Angolo Via Aurelia Ovest) - Massa<br/>Tel: 0585 83143<br/>Centro assistenza Mercedes,Smart";	
			}
			else if(num == 1 || num == 2)
			{
				indirizzopopup = "<strong>Guidicar Service</strong><br/>Via Camporcioni 11 - Montecatini Terme<br/>Tel.0572 941212<br/>Centro assistenza Mercedes Benz, Smart, Volkswagen, Audi";
			}
			else if(num == 3)
			{
				indirizzopopup = "<strong>Guidicar Service</strong><br/>Via del Brennero 1996 - Lucca<br/>Tel: 0583 4057800<br/>Centro assistenza Mercedes,Smart,Jeep,Dodge,Chrysler";
			}
			else if(num == 4)
			{
				indirizzopopup = "<strong>Guidicar Service</strong><br/>Via del Brennero 1996 - Lucca<br/>Tel: 0583 4057800<br/>Centro assistenza Mercedes,Smart,Jeep,Dodge,Chrysler";
			}
			else if(num == 5)
			{
				indirizzopopup = "<strong>Guidicar Service</strong><br/>Via del Brennero 1996 - Lucca<br/>Tel: 0583 4057800<br/>Centro assistenza Mercedes,Smart,Jeep,Dodge,Chrysler";
			}
			else if(num == 6)
			{
				indirizzopopup = "<strong>Bosch Car Service</strong><br/>Via Provinciale - localit&agrave; Salita - 55020 Borgo a Mozzano - Lucca<br/>Tel: 0583 833370";
			}
		
		
		if(num != 1 && num != 2)
		{
			if (geocoder) 
			{
	        	geocoder.getLatLng(address,
	          		function(point) 
					{
	            		if (!point) 
						{
	              			alert(address + " non trovato");
	            		} 
						else 
						{
	              			map.setCenter(point, 8);
	              			var marker = new GMarker(point);
	              			map.addOverlay(marker);
	              			GEvent.addListener(marker, "click", function() 
																{
	    					marker.openInfoWindowHtml("<font style='font-family:Verdana;font-size:11px'>"+indirizzopopup+"</font>");
								
	  						});
	            		}
	          		}
	        	);
	      	}
	      	
	      }	
	      	if(num == 1 || num == 2)
	      	{
				//var map = new GMap2(document.getElementById("map"));
				map.setCenter(new GLatLng(43.862876,10.768082), 11);
	       		//map.addControl(new GLargeMapControl());
				
	        	//geocoder = new GClientGeocoder();
	        	
	        	var marker = new GMarker(map.getCenter());
	        	map.addOverlay(marker);
	        	
	  			GEvent.addListener(marker, "click", function() {
	    		
				marker.openInfoWindowHtml("<font style='font-family:Verdana;font-size:11px'><strong>Guidicar</strong><br/>Via Camporcioni 11<br/>Tel.0572 941212<br>Centro assistenza Mercedes Benz, Smart, Volkswagen, Audi</font>");
	  });
			}
	      	
	      	if(num == 0 || num==99)
	      	{
				if (geocoder) 
				{
		        	geocoder.getLatLng(address2,
		          		function(point) 
						{
		            		if (!point) 
							{
		              			alert(address2 + " non trovato");
		            		} 
							else 
							{
		              			map.setCenter(point, 8);
		              			var marker = new GMarker(point);
		              			map.addOverlay(marker);
		              			GEvent.addListener(marker, "click", function() 
																{
	    						marker.openInfoWindowHtml("<font style='font-family:Verdana;font-size:11px'><strong>Guidicar Service</strong><br/>Via del Brennero 19996 - Lucca<br/>Tel. 0583 4057800<br/>Centro assistenza Mercedes,Smart,Jeep,Dodge,Chrysler</font>");
	  						});
		            		}
		          		}
		        	);
		      	}
		      	
				
				//var map = new GMap2(document.getElementById("map"));
				map.setCenter(new GLatLng(43.862876,10.768082), 13);
	       		//map.addControl(new GLargeMapControl());
				
	        	//geocoder = new GClientGeocoder();
	        	
	        	var marker = new GMarker(map.getCenter());
	        	map.addOverlay(marker);
	        	
	  			GEvent.addListener(marker, "click", function() {
	    		
				marker.openInfoWindowHtml("<font style='font-family:Verdana;font-size:11px'><strong>Guidicar</strong><br/>Via Camporcioni 11<br/>Tel.0572 941212<br/>Centro assistenza Mercedes Benz, Smart, Volkswagen, Audi</font>");
	  });
		            		
			
				if(num == 99)
				{
				
				if (geocoder) 
				{
		        	geocoder.getLatLng(address4,
		          		function(point) 
						{
		            		if (!point) 
							{
		              			alert(address4 + " non trovato");
		            		} 
							else 
							{
		              			map.setCenter(point, 8);
		              			var marker = new GMarker(point);
		              			map.addOverlay(marker);
		              			GEvent.addListener(marker, "click", function() 
																{
	    						marker.openInfoWindowHtml("<font style='font-family:Verdana;font-size:11px'><strong>Bosch Car Service</strong><br/>Via Provinciale - localit&agrave; Salita - 55020 Borgo a Mozzano - Lucca<br/>Tel: 0583 833370<br/>Centro assistenza Bosch Car Service</font>");
	  						});
		            		}
		          		}
		        	);
		      	}

				}	
			}
    	}
//]]>
