var localSearch = new GlocalSearch();

function usePointFromPostcode(postcode, callbackFunction) {
  localSearch.setSearchCompleteCallback(null, 
    function() {
      
      if (localSearch.results[0]) {    
        var resultLat = localSearch.results[0].lat;
		var resultLng = localSearch.results[0].lng;
		var point = new GLatLng(resultLat,resultLng);
        callbackFunction(point, postcode);
      }else{
        alert("Postcode not found!");
      }
    });  
  localSearch.execute(postcode + ", UK");
}

function processPoint(point, postcode)
{
    document.getElementById("latitude").value=point.lat();
    document.getElementById("longitude").value=point.lng();
    document.getElementById("hdnPostcode").value=postcode;
	document.getElementById("geocodeForm").submit();
}

