var map = null;
var geocoder = null;
var x = 34.97712;
var y = 138.383084;
var googlemap_point = "34.97712, 138.383084";

function loadMap(x,y,zoom) {
  if (GBrowserIsCompatible()) {
    map = new GMap2(document.getElementById("map"));
    map.addControl(new GLargeMapControl());
    map.setCenter(new GLatLng(x,y), zoom);
    geocoder = new GClientGeocoder();
    // 
    if(x == "34.97712" & y == "138.383084"){
      for(var i=1;i<45;i++){
        var marker = myMarker(loc_x[i],loc_y[i],i);
        map.addOverlay(marker);
      }
    };
}
}


function showAddress(address,information) {
  if (geocoder) {
    geocoder.getLatLng(
      address,
      function(point) {
        if (!point) {
          alert(address + " 見つかりません");
        } else {
          map.clearOverlays();
          map.setCenter(point, 15);
          var marker = new GMarker(point);
          map.addOverlay(marker);
//          marker.openInfoWindowHtml(information);
        }
      }
    );
  }
}

function myMarker(x,y,i) {
    var marker = new GMarker(new GLatLng(x, y));
    GEvent.addListener(marker, "click", function() {
        marker.openInfoWindowHtml(loc_name[i]);
    });
    return marker;
}