var map = null;
var geocoder = null;

function initialize() {
	if (GBrowserIsCompatible()) {
		map = new GMap2(document.getElementById("map"));
		map.addControl(new GSmallMapControl());
		geocoder = new GClientGeocoder();
	}
}

function showAddress(address, view) {
	if (geocoder) {
		geocoder.getLatLng(
		address,
		function(point) {
			if (!point) {
				document.getElementById("map").style.display = 'none';	
			}
			else {
				map.setCenter(point, 12);
				var marker = new GMarker(point);
				map.addOverlay(marker);
				GEvent.addListener(marker, 'click', function() {
					marker.openInfoWindowHtml(view);	
				});
				marker.openInfoWindowHtml(view);
			}
		});
	}
}
