/** GoogleMap オブジェクト */
var Map = null;
var Geocoder = null;



/**
 * 指定したポイントを中心としたMapを初期化します。
 *
 * @param lat 緯度
 * @param lon 経度 
 */
function initialize(lat, lon) {
	if (GBrowserIsCompatible()) {
        initialMap();
        Map.setCenter(new GLatLng(lat, lon), 13);
	}
    
    Geocoder = new GClientGeocoder();
}


function initialMap() {
    Map = new GMap2(document.getElementById("map_canvas"));
    Map.addControl(new GSmallMapControl());
    Map.addControl(new GMapTypeControl());
}


/**
    指定したポイントをマークします。
 
  @lat 緯度
  @lon 経度
  @message 表示メッセージ
 */
function showPoint(lat, lon, message) {
  
  if (Geocoder) {
      initialMap();
      var center = new GLatLng(lat, lon);
      Map.setCenter(center, 13);
      var marker = new GMarker(center);
      Map.addOverlay(marker);
      marker.openInfoWindowHtml(message);
  }
}
