
function preSubmit() {
	f = document.getElementById("google_route");

/*	if (f.straat.value == "") {
		alert("U heeft nog geen straatnaam ingevuld.");
		f.straat.focus();
		return false;
	}

	if (f.huisnum.value == "") {
		alert("U heeft nog geen huisnummer ingevuld.");
		f.huisnum.focus();
		return false;
	}

	if (f.stad.value == "") {
		alert("U heeft nog geen stad ingevuld.");
		f.stad.focus();
		return false;
	}
*/
	if (f.zipcode.value == "") {
		alert("U heeft nog geen postcode ingevuld.");
		f.zipcode.focus();
		return false;
	}

	var geo = new GClientGeocoder();

	//adres = f.straat.value + " " + f.huisnum.value + ", " + f.stad.value + ", Netherlands"
	adres = f.zipcode.value + ", Netherlands";

	geo.getLocations(
		adres,
		function(result) {
			if (result.Status.code == G_GEO_SUCCESS) {
				f.latitude.value = result.Placemark[0].Point.coordinates[1];
				f.longitude.value = result.Placemark[0].Point.coordinates[0];
				f.submit();
			} else {
				alert("U heeft een ongeldig adres ingevuld.");
				return false;
			}
		}
	);
	return false;
}

