// JavaScript Document

var map;

window.onload = createMap;


function createMap() {
	if(typeof(GBrowserIsCompatible)=='undefined'){
		document.getElementById('map').innerHTML='GoogleMapsと通信ができません。インターネット接続状態を確認してください。';
	}

	if (GBrowserIsCompatible()) {
		map = new GMap2(document.getElementById("map"));
		map.setCenter(new GLatLng(34.78939, 137.459412), 8);
		map.disableDragging();


                //オリジナルマーカーの画像を作成
                var icon = new GIcon();
                icon.image = "shared/images/marker_flag_s.gif";
                icon.iconSize = new GSize(28, 22);
                icon.iconAnchor = new GPoint(10, 22);
                icon.infoWindowAnchor = new GPoint(12, 12);
		

                //オリジナルマーカーの画像を作成
				
                var icon1 = new GIcon();
                icon1.image = "shared/images/marker_flag_1_s.gif";
                icon1.iconSize = new GSize(28, 22);
                icon1.iconAnchor = new GPoint(10, 22);
				
                var icon2 = new GIcon();
                icon2.image = "shared/images/marker_flag_2_s.gif";
                icon2.iconSize = new GSize(28, 22);
                icon2.iconAnchor = new GPoint(10, 22);

                var icon3 = new GIcon();
                icon3.image = "shared/images/marker_flag_3_s.gif";
                icon3.iconSize = new GSize(28, 22);
                icon3.iconAnchor = new GPoint(10, 22);
				
                var icon4 = new GIcon();
                icon4.image = "shared/images/marker_flag_4_s.gif";
                icon4.iconSize = new GSize(28, 22);
                icon4.iconAnchor = new GPoint(10, 22);
				
                var icon5 = new GIcon();
                icon5.image = "shared/images/marker_flag_5_s.gif";
                icon5.iconSize = new GSize(28, 22);
                icon5.iconAnchor = new GPoint(10, 22);
				
                var icon6 = new GIcon();
                icon6.image = "shared/images/marker_flag_6_s.gif";
                icon6.iconSize = new GSize(28, 22);
                icon6.iconAnchor = new GPoint(10, 22);

                var icon7 = new GIcon();
                icon7.image = "shared/images/marker_flag_7_s.gif";
                icon7.iconSize = new GSize(28, 22);
                icon7.iconAnchor = new GPoint(10, 22);
								

	        //アツミマイカー本社	
		var marker = new GMarker(new GLatLng(34.655778, 137.261373),icon1);
		map.addOverlay(marker);
		GEvent.addListener(marker, 'click', function(){clickMarker(location.href="shop/honsya.html");});

	        //アツミマイカー田原店	
		var marker = new GMarker(new GLatLng(34.694025, 137.300678),icon2);
		map.addOverlay(marker);
		GEvent.addListener(marker, 'click', function(){clickMarker(location.href="shop/tahara.html");});

	        //アツミマイカー豊橋渡津店	
		var marker = new GMarker(new GLatLng(34.776975, 137.312327),icon3);
		map.addOverlay(marker);
		GEvent.addListener(marker, 'click', function(){clickMarker(location.href="shop/watatsu.html");});

	        //アツミマイカー豊橋向山店	
		var marker = new GMarker(new GLatLng(34.740244, 137.398816),icon4);
		map.addOverlay(marker);
		GEvent.addListener(marker, 'click', function(){clickMarker(location.href="shop/mukaiyama.html");});


	        //アツミマイカー岡崎一番店	
		var marker = new GMarker(new GLatLng(34.959355, 137.155031),icon5);
		map.addOverlay(marker);
		GEvent.addListener(marker, 'click', function(){clickMarker(location.href="shop/okazaki.html");});



	        //アツミマイカー浜松船越店	
		var marker = new GMarker(new GLatLng(34.719073, 137.750191),icon6);
		map.addOverlay(marker);
		GEvent.addListener(marker, 'click', function(){clickMarker(location.href="shop/hamamatsu.html");});



	        //アップ	
		var marker = new GMarker(new GLatLng(34.79, 137.40682125091553),icon7);
		map.addOverlay(marker);
		GEvent.addListener(marker, 'click', function(){clickMarker(location.href="shop/up_mukaiyama.html");});

	        //フォーム内容クリア
		document.searchForm.mfr.selectedIndex = 0 ;



	} else {
		document.getElementById('map').innerHTML='ご利用の環境ではこのマップをご覧いただけません。';	
	}
}
