// JavaScript Document

var map = null;
var geocoder = null;

    // 初期化
    // <body onload="load()"> で呼び出されています
function load() {
  if (GBrowserIsCompatible()) {
	map = new GMap2(document.getElementById("map"));
	map.addControl(new GSmallMapControl());
	map.addControl(new GMapTypeControl());

	// GClientGeocoderを初期化
	geocoder = new GClientGeocoder();
	
	  if (geocoder) {
		geocoder.getLatLng(
		  window.document.fm_add.address.value,
		  function(point) {
			if (!point) {
			  alert(address + " not found");
			} else {
				var marker = new GMarker(point);
				map.addOverlay(marker);

				var point2 = new GLatLng(35.669197,138.526362);
				map.setCenter(point2, 16);

				marker.openInfoWindowHtml(window.document.fm_add.address2.value);
			}
		  }
		);
	  }
	
	
  }
}
