var Keystage21Maps = function () {
  var ks21 = {
    name: '株式会社キーステージ21',
    html: '<div class="gmaps_ks21_marker" style="line-height: 1.2;"><img src="/images/ks21_small_banner.gif" width="134" height="34"/><br/>株式会社キーステージ21<br/>八王子ソーシャルアクションビューロー<br/>192-0062 東京都八王子市大横町1-9 Kビル402</div>'
  };
  function onMapsLoad () {
    var map = new GMap2(document.getElementById("map"));
    //map.setCenter(new GLatLng(35.660500,139.330600), 15);
    map.setCenter(new GLatLng(35.660500,139.332800), 15);
    //map.setCenter(new GLatLng(35.660500,139.330600), 14);

    map.enableScrollWheelZoom();
    map.addControl(new GMapTypeControl());
    map.addControl(new GLargeMapControl());
    map.addControl(new GOverviewMapControl());

	directions = new GDirections(map, document.getElementById('map_gwalk'));
	var points = new Array();
	//points.push(new GLatLng(35.661655,139.329278));	//八王子SABの経度緯度
	//points.push(new GLatLng(35.654507,139.338355));//JR八王子駅の経度緯度
	//points.push(new GLatLng(35.656503,139.33879));//JR八王子駅の経度緯度

	points.push("〒192-0083 東京都八王子市旭町1-B1 (市営八王子駅北口地下駐車場)");
	points.push("八王子市大横町1-9");
	directions.loadFromWaypoints(points,{preserveViewport:true, travelMode: G_TRAVEL_MODE_WALKING });

    var icon = new GIcon({image: '/images/ks21_icon_marker.png'});
    icon.iconSize = new GSize(16, 16);
    icon.iconAnchor = new GPoint(8, 16);
    icon.infoWindowAnchor = new GPoint(8, 1);
    var marker = new GMarker(
      new GLatLng(35.661655,139.329278),
      { icon: icon,
        title: ks21.name,
	clickable: true,
	draggable: false
      });
    GEvent.addListener(marker, 'click', function () {
      marker.openInfoWindowHtml(ks21.html);
    });
    map.addOverlay(marker);
    marker.openInfoWindowHtml(ks21.html);

  }

  google.setOnLoadCallback(function () {
    google.load('maps', '2.s', {language: 'ja', callback: onMapsLoad});
  });
}();

