
	function _getGeocode() 
	{		
		var location = "";
		
		if(document.getElementById('SearchLocation') != null)
		{
			location = document.getElementById('SearchLocation').value;
		}
		
		var address = location + " " + $('#form-points-de-vente #DealerSearchLocation').attr('value');
		
		//   alert($('#DealerSearchLocation').attr('name'));
		//   alert($('#DealerSearchLocation').attr('value'));
		var rectangle;
		geocoder = new GClientGeocoder();	
		
		geocoder.setBaseCountryCode("fr");
		
		if(location == "Reunion")
		{
			var sw = new GLatLng(-21,55);
			var ne = new GLatLng(-20,56);
			rectangle = new GLatLngBounds(sw,ne );
			geocoder.setViewport(rectangle);
		}
		else if( location == "French Polynesia")
		{
			var sw = new GLatLng(-17,-150);
			var ne = new GLatLng(-18,-149);
			rectangle = new GLatLngBounds(sw,ne );
			geocoder.setViewport(rectangle);
		}
		else if( location == "Guyane" )
		{
			var sw = new GLatLng(2,-54);
			var ne = new GLatLng(6,-51);
			rectangle = new GLatLngBounds(sw,ne );
			geocoder.setViewport(rectangle);
		}
		else if(location == "Martinique")
		{
			var sw = new GLatLng(14,-61);
			var ne = new GLatLng(15,-60);
			rectangle = new GLatLngBounds(sw,ne );
			geocoder.setViewport(rectangle);
		}
		else if(location == "Guadeloupe")
		{
			var sw = new GLatLng(15.5,-62);
			var ne = new GLatLng(16.5,-61);
			rectangle = new GLatLngBounds(sw,ne );
			geocoder.setViewport(rectangle);
		}
		else if(location == "Mayotte")
		{
			var sw = new GLatLng(-13,45);
			var ne = new GLatLng(-12.5,46);
			rectangle = new GLatLngBounds(sw,ne );
			geocoder.setViewport(rectangle);
		}
		else if(location == "saint pierre et miquelon")
		{
			var sw = new GLatLng(46.5,-56.5);
			var ne = new GLatLng(47,-56);
			rectangle = new GLatLngBounds(sw,ne );
			geocoder.setViewport(rectangle);
		}
		else if (location == "saint barthelemy")
		{
			var sw = new GLatLng(17.5,-63);
			var ne = new GLatLng(18,-62.5);
			rectangle = new GLatLngBounds(sw,ne );
			geocoder.setViewport(rectangle);
		}
		else if( location == "Nouvelle Caledonie")
		{
			var sw = new GLatLng(-22.5,163);
			var ne = new GLatLng(-20,-167);
			rectangle = new GLatLngBounds(sw,ne );
			geocoder.setViewport(rectangle);
		}
		else if( location == "Maurice")
		{
			var sw = new GLatLng(-20.9,56.9);
			var ne = new GLatLng(-19.6,58.1);
			rectangle = new GLatLngBounds(sw,ne );
			geocoder.setViewport(rectangle);
		}
		
		geocoder.getLatLng (address, function (point) {
			if (!point) {
				alert(address + " not found");
			} else {
				$('#form-points-de-vente #Latitude').val(point.lat());
				$('#form-points-de-vente #Longitude').val(point.lng());
				//alert($('#form-points-de-vente #Longitude').attr('value'));
			}
			$('#form-points-de-vente').submit();
		});
		return false;
	}

