 var map;
 var geoCodeur;
 
 var isAjax;
 
 var verifPointLength;




/*   // GOOGLE MAP V2   */
  function initialize() 
  {
	
	if(GBrowserIsCompatible()) 
	{
	
	  map = new GMap2(document.getElementById('myMap'));
	  map.setCenter(new google.maps.LatLng(  42.3058052,  9.1509139), 9);

	  // map.addControl(new GLargeMapControl());
	  map.addControl(new GMapTypeControl());
	  
	
		map.addControl(new GSmallZoomControl3D());

	  geoCodeur = new GClientGeocoder();

	  //Changer zoom en mini
	}

  }
 
/* Si ajax=true on renvoie le resultat avec idPoint vers PHP pour l'enregistrer dans la base */
function geocodeAdresse( lieu, onglet1, onglet2, onglet3, name )
{
		
	
		new GClientGeocoder().getLocations( lieu, function(response)
		{
				/* // document.getElementById("test").innerHTML += response.Status.code+"<BR />"; */
				if (response.Status.code == 200) 
				{ 
					var place = response.Placemark[0];

					// map.setCenter(new GLatLng(place.Point.coordinates[1], place.Point.coordinates[0]), 7);
					var icon = new GIcon(G_DEFAULT_ICON);
					icon.image = "http://www.wmaker.net/mitic/docs/IMG/marqeur_mapmitic.png";
					icon.shadow = "";
					icon.iconSize  = new GSize(32, 32);
					var marker= new GMarker(new GLatLng(place.Point.coordinates[1], place.Point.coordinates[0]), {icon: icon, title: name});
					
					GEvent.addListener(marker, "click", function() 
					{
						// marker.openInfoWindowTabsHtml
						// (
						// [
							// new GInfoWindowTab("Identit\351s",onglet1),
							// new GInfoWindowTab("Comp\351t\351nces",onglet2),
							// new GInfoWindowTab("R\351f\351rences",onglet3)
							
						// ]
						// );
						
						
						marker.openInfoWindowHtml(	onglet1	);
					}, 100);
				
					map.addOverlay( marker );	
				}
		});
	
}


