var map = null;
var geocoder = null;

function load() {
	if (GBrowserIsCompatible()) {
		map = new GMap2(document.getElementById("map"));
		map.setCenter(new GLatLng(35.678564,139.783816), 6);
		map.addControl(new GLargeMapControl());
		map.addControl(new GOverviewMapControl());
		map.addControl(new GMapTypeControl());
		geocoder = new GClientGeocoder();
	}
}

function showAddress(address,name) {
	if (geocoder) {
		geocoder.getLatLng(
			address,
			function(point) {
				if (!point) { alert(address + " \u304C\u898B\u3064\u304B\u308A\u307E\u305B\u3093\u3002"); }
				else {
					map.setCenter(point, 14);
					var marker = new GMarker(point);
					map.addOverlay(marker);
					marker.openInfoWindowHtml('<h5>' + name + '</h5>' + '<p id="address">'  + address + '</p>');
				}
			}
		);
	}
}