geocoder = new google.maps.Geocoder();
var map;


// Create a map and centre to a location based on an address set in the HTML
function codeAddress() {
	    var address = document.getElementById("address").value;
	    if (geocoder) {
	        geocoder.geocode({ 'address': address, 'country': 'uk' }, function(results, status) {
	            if (status == google.maps.GeocoderStatus.OK) {


	                var myOptions = {
	                    zoom: 13,
	                    center: results[0].geometry.location,
	                    mapTypeId: google.maps.MapTypeId.ROADMAP
	                };
	                map = new google.maps.Map(document.getElementById("map_canvas"), myOptions);

	                var marker = new google.maps.Marker({
	                    position: results[0].geometry.location,
	                    map: map,
	                    title: "Location"
	                });


	            } else {
	                alert("We could not find that address: " + status);
	            }
	        });
	    }
	}
