$(function(){
  var map = null;
  var geocoder = null;

  if (GBrowserIsCompatible()) {
    map = new GMap2(document.getElementById("map"));
    map.addControl(new GLargeMapControl());
    map.addControl(new GMapTypeControl());
    map.setCenter(new GLatLng(135.12240797281265, 34.70659591075369), 16);
    geocoder = new GClientGeocoder();
    showAddress($("#address").text());
  }
  function showAddress(address) {
    if (geocoder) {
      geocoder.getLatLng(
        address,
        function(point) {
          if (!point) {
            alert(address + " not found");
          } else {
            map.setCenter(point, 16);
            var marker = new GMarker(point);
            map.addOverlay(marker);
          }
        }
      );
    }
  }
})
