//<![CDATA[
var map;
var latG = 36.252060358363416;					//玄向寺位置
var lngG = 137.99278736114502;					//玄向寺位置
mpG = new GLatLng(latG, lngG);					//Mapセンター位置
ifG = new GLatLng(latG + 0.005, lngG + 0.001);	//玄向寺マーカー位置
markerG = new GMarker(mpG);						//玄向寺マーカー定義

function onLoad() {
  map = new GMap2(document.getElementById("map"));
  if (GBrowserIsCompatible()) {
    map.addControl(new GLargeMapControl());		//マップコントローラー(大)
    map.setCenter(new GLatLng(36.26178458296645,137.98115730285645), 13);	//表示位置指定
    map.addControl(new GScaleControl());		//スケール表示
    map.addControl(new GOverviewMapControl(new GSize(120, 80)));			//広域表示
    
    //マーカー&吹出し初期表示(玄向寺のみ)
    var htmlG = '<div style="text-align:left;width:235px;"><strong>玄向寺ぼたん園</strong>';
    htmlG += '<div style="font-size:0.9em;">JR松本駅より美ヶ原温泉行きバス30分<br />終点下車　徒歩15分<br />'
    htmlG += '長野自動車道松本I.C.より20分'
    htmlG += '<div style="both:clear;margin-top:5px;">'
    htmlG += '<strong>ナビ案内</strong><br />'
    htmlG += '<form action="http://maps.google.com/maps" method="get" target="_blank">'
    htmlG += '<input type="text" size="35" name="saddr" id="daddr" value="">'
    htmlG += '<input type="hidden" name="daddr" value="長野県松本市大村681">'
    htmlG += '<input type="hidden" name="dirflg" value="d">'
    htmlG += '<input value="ドライブルート検索" type="submit"><br />'
    htmlG += '出発地の住所・番地を入力して下さい。'
    htmlG += '</form>'
    htmlG += '</div></div></div>'
    //map.addOverlay(markerG);					//マーカー表示
    map.openInfoWindowHtml(ifG,htmlG);			//吹出し表示
    
    //マーカー配置(初期表示以外)
    var html;
    //玄向寺
    addMarker(latG,lngG,htmlG,'');
    //美ヶ原温泉バス停
    html = '<div style="text-align:left;width:235px;"><strong>美ヶ原温泉バス停</strong>';
    html += '<div style="font-size:0.9em;margin-bottom:10px;">玄向寺最寄バス停<br />徒歩15分<br />'
    html += '時刻表は<a href="http://www.alpico.co.jp/mrc/local-bus/pdf/utsukushi.pdf" target="_blank" style="text-decoration:underline;">こちら</a><br />（PDFファイルが開きます）'
    html += '</div></div>'
    addMarker(36.24596912435607,137.99951434135437,html,'blue');
    //松本駅
    html = '<div style="text-align:left;width:235px;"><strong>JR松本駅</strong>';
    html += '<div style="font-size:0.9em;margin-bottom:10px;">玄向寺最寄駅<br />（最寄バス停までバス30分＋徒歩15分／タクシー20分）<br />'
    html += '時刻表は<a href="http://www.jreast-timetable.jp/timetable/list1444.html" target="_blank" style="text-decoration:underline;">こちら</a>'
    html += '</div></div>'
    addMarker(36.23125822114167,137.96433448791504,html,'blue');
  }
}

//マーカー表示関数(初期表示以外)
function addMarker(lat,lng,html,icon) {
  var mp;
  var marker;
  mp = new GLatLng(lat, lng);
  if(icon == ""){
    marker = new GMarker(mp);
  } else if(icon == "blue"){
    //青アイコン
    var ico = new GIcon(G_DEFAULT_ICON);	//アイコン作成
    ico.image = "../g-image/"+icon+"-dot.png";	//アイコン画像パス
    ico.iconSize = new GSize(32, 32);		//アイコン画像サイズ
    var marker = new GMarker(mp,{icon:ico});
  } else {alert("アイコン "+icon+" の指定ミスです");}
  GEvent.addListener(marker,"click",function(){marker.openInfoWindowHtml(html);});
  map.addOverlay(marker);					//マーカーを地図にオーバレイ表示
}

//]]>





