	var map = null;
	var geocoder = null;
	var localSearch = new GlocalSearch();
	
	function initialize() {
	  if (GBrowserIsCompatible()) {
		map = new GMap2(document.getElementById("map_canvas"));
		map.addControl(new GSmallMapControl());
		map.addControl(new GMapTypeControl());
		geocoder = new GClientGeocoder();
	  }
	}
	
	function showAddress(street, postcode) {
		var address = postcode + ', ' + street;
		initialize()
	  if (geocoder) {
		geocoder.getLatLng(
		  postcode,
		  function(point) {
			if (!point) {
		  usePointFromPostcode(postcode, address);
			} else {
			  map.setCenter(point, 13);
			  var marker = new GMarker(point);
			  map.addOverlay(marker);
			  marker.openInfoWindowHtml(address);
			}
		  }
		);
	  }
	}

	function showAddressLatLong(street, postcode, lat, long) {
		var address = street + ', ' + postcode;
		
		if (GBrowserIsCompatible()) {
			var map = new GMap2(document.getElementById("map_canvas"));
			
			map.addControl(new GSmallMapControl());
			map.addControl(new GMapTypeControl());
		
			geocoder = new GClientGeocoder();
			
				var latlng = new GLatLng(lat, long, true);
				map.setCenter(latlng, 13);
					
				// Set up our GMarkerOptions object
				var marker = new GMarker(latlng)
				map.addOverlay(marker);
				marker.openInfoWindowHtml(address);
		
				
		}
	
	}
	
	function usePointFromPostcode(postcode, address) {
	
	  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);
				map.setCenter(point, 13);
				var marker = new GMarker(point);
				map.addOverlay(marker);
				marker.openInfoWindowHtml(address);
		  }else{
			alert("Postcode not found!");
		  }
		});  
		
	  localSearch.execute(postcode + ', UK');
	}