function _google_geocode(postcode,form_name) {
	

	if(postcode == 0){
		//	need to get the postcode from the user input on the form
		document.getElementById('submit_onclick').disabled = true;
		document.getElementById('submit_onclick').value = "Searching...";
		postcode = document.getElementById('postcode').value;
		
		}

	var localSearch = new GlocalSearch();
	
	localSearch.setSearchCompleteCallback(null,
	function() {
	
		if (localSearch.results[0]) {  
			
			//	if geocode successful send to php page to add to database
			  
			document.getElementById('lat').value = localSearch.results[0].lat;
			document.getElementById('lng').value  = localSearch.results[0].lng;
		 
			// set hidden fields to lat and lng and submit form
			document.forms[form_name].submit();
		}
		else
		{
			alert("Sorry we were unable to locate your postcode.");
		}
	});  
	
	localSearch.execute(postcode);
}

function sort_order(location,element){

if(element.value != '' )  window.location = location+'order='+element.value;

}



