function getGeolocAddress(adresse, idFormRecherche, idInputRecherche) {
	$('input#'+idInputRecherche).replaceWith("<img id=\""+idInputRecherche+"\" src=\"/images/miniHomesRegion/wait.gif\" \/>");

	var address = document.getElementById(adresse).value+" france";
	var geocoder = new google.maps.Geocoder();
	
	if (geocoder) {
		geocoder.geocode(
			{'address': address}, 
			function(results, status) {
				if (status == google.maps.GeocoderStatus.OK) {
					if (status != google.maps.GeocoderStatus.ZERO_RESULTS) {
						$('#'+idFormRecherche+' input#lng').val(results[0].geometry.location.lng());
		        		$('#'+idFormRecherche+' input#lat').val(results[0].geometry.location.lat());
		        		document.getElementById(idFormRecherche).submit();
		        		
		          } else {
		        	  //Pas de résultats
		        	  alert("Nous n'avons pu trouver de résultats pour cette localisation");
		        	  $('img#'+idInputRecherche).replaceWith("<input type=\"image\" id=\""+idInputRecherche+"\" src=\"/images/btn/bt_lancer_recherche.gif\" onclick=\"getGeolocAddress('"+adresse+"','"+idFormRecherche+"','"+idInputRecherche+"')\"/>");
		          }
		        } else {
		        	//Erreur
		        	alert("Nous n'avons pu trouver de résultats pour cette localisation");
			        $('img#'+idInputRecherche).replaceWith("<input type=\"image\" id=\""+idInputRecherche+"\" src=\"/images/btn/bt_lancer_recherche.gif\" onclick=\"getGeolocAddress('"+adresse+"','"+idFormRecherche+"','"+idInputRecherche+"')\"/>");
		        }
			}
		);
   }
}
