var Geopos = {
	currentGeocodeId: "",
	
	geocoder: new google.maps.Geocoder(),
	
	geocodeSlot: function(addrId, postOfficeId, geocodeId){
		Geopos.currentGeocodeId = geocodeId;
		var addr = document.getElementById(addrId).getElementsByTagName("div")[0].innerHTML + ", " + document.getElementById(postOfficeId).getElementsByTagName("div")[0].innerHTML;
		
		Geopos.geocoder.geocode({address: addr}, Geopos.handleGeocoding);
	},
	
	handleGeocoding: function(results, status){
		if(status == google.maps.GeocoderStatus.OK){
			var point = results[0].geometry.location;
			document.getElementById(Geopos.currentGeocodeId).getElementsByTagName("div")[0].innerHTML = "lat: " + point.lat() + ", lng: " + point.lng();
			if(!window.Save || !Save.u4_disabled){top.main.postData();}
		}
		else{
			alert("Geocoding failed.");
		}
	}
}