if (GBrowserIsCompatible()) {
// ===== ここがマップの初期設定===== 
	var map = new GMap2(document.getElementById("map"));
	map.addControl(new GSmallMapControl());
	map.addControl(new GMapTypeControl());
                map.addControl(new GOverviewMapControl(new GSize(200,150)));
	map.setCenter(new GLatLng(33.421237,130.656882), 15);
	map.enableDoubleClickZoom();
	map.enableContinuousZoom();


// ===== ここからアイコン設定=====
	var icon = new GIcon();
	icon.iconSize = new GSize(30, 37);
	icon.shadowSize = new GSize(37, 37);	
	icon.iconAnchor = new GPoint(25, 37);
	icon.infoWindowAnchor = new GPoint(9, 2);
	icon.infoShadowAnchor = new GPoint(18, 25);

function createMarker(point, text, type) {
if(type == "01_look_見どころ"){ icon.image = "http://www.gsweb.co.jp/mt/mt-static/style/images/asakura/mpcon_look.png";}
else if(type == "02_food_飲食店"){ icon.image = "http://www.gsweb.co.jp/mt/mt-static/style/images/asakura/mpcon_food.png";}
else if(type == "03_beauty_美容・服飾店"){ icon.image = "http://www.gsweb.co.jp/mt/mt-static/style/images/asakura/mpcon_beauty.png";}
else if(type == "04_event_イベント"){ icon.image = "http://www.gsweb.co.jp/mt/mt-static/style/images/asakura/mpcon_event.png";}
else if(type == "05_home_不動産"){ icon.image = "http://www.gsweb.co.jp/mt/mt-static/style/images/asakura/mpcon_home.png";}
else if(type == "06_diary_スタッフ日記"){ icon.image = "http://www.gsweb.co.jp/mt/mt-static/style/images/asakura/mpcon_diary.png";}
else{
icon.image = "http://www.gsweb.co.jp/mt/mt-static/style/images/asakura/mpcon_etcetera.png"; 
}
	var marker = new GMarker(point, icon);
	var html = "<div class=\"info\">" + text + "</div>";
	GEvent.addListener(marker, "click", function() {
	marker.openInfoWindowHtml(html);
		});

	return marker;
	}
}
// ===== ここからXML呼び出し=====
var request = GXmlHttp.create();
request.open("GET", "http://www.gsweb.co.jp/asakura/mark.xml", true);
	request.onreadystatechange = function() {
		if (request.readyState == 4) {
		var xmlDoc = request.responseXML;
		var markers = xmlDoc.documentElement.getElementsByTagName("marker");
		for (var i = 0; i < markers.length; i++) {
		var point = new GPoint(parseFloat(markers[i].getAttribute("lon")),parseFloat(markers[i].getAttribute("lat")));
		var marker = createMarker(point, markers[i].firstChild.nodeValue, markers[i].getAttribute("type"));
		map.addOverlay(marker);
					}
		}
	}
request.send(null);

