//<![CDATA[
var mapobj = null;
var geocoder = null;
var mapdisp = 0;

function map_disp()
{
	if (!mapdisp)
	{
		mapdisp = 1;
		load();
	}
}

function load()
{
	if (GBrowserIsCompatible())
	{
		mapobj = new GMap2(document.getElementById("area_map"));
		mapobj.addControl(new GLargeMapControl());
		if (store_path == "")
		{
			mapobj.addControl(new GMapTypeControl());
			var lat = 35.765096;
			var lng = 139.67693;
		}
		else
		{
			var lat = 35.764901;
			var lng = 139.676313;
		}
		geocoder = new GClientGeocoder();
		var point = new GLatLng(lat, lng);
		mapobj.setCenter(point, 16);

		/* エリアA */
		var polygon_a = new GPolygon([
			new GLatLng(35.763806,139.676903),
			new GLatLng(35.763662, 139.676549),
			new GLatLng(35.764703,139.674039),
			new GLatLng(35.764269,139.673696),
			new GLatLng(35.764735,139.67251),
			new GLatLng(35.765984,139.672794),
			new GLatLng(35.765358,139.675085),
			new GLatLng(35.765086,139.676903),
			new GLatLng(35.764174,139.676713),
			new GLatLng(35.764047,139.677035),
			new GLatLng(35.763806,139.676903)
		],
		"#ff0000", /* 枠線の色 */
		3, /* ピクセル単位の線の幅 */
		1, /* 枠線の有無 */
		"#ff6699", /* ポリゴン領域の色 */
		0.3 /* 透明度（0～１の間の数値） */
		);
		GEvent.addListener(polygon_a, "click", function(latlng){
			location.href = store_path + "area_result.php?p=1";
        });
        mapobj.addOverlay(polygon_a);

		var marker_a = new GIcon();
		marker_a.image = store_path + "img/area_a.png";
		marker_a.iconSize = new GSize(50, 50);
		marker_a.iconAnchor = new GPoint(0, 0);
		var markerPoint_a = new GMarker(new GLatLng(35.765049, 139.674994), marker_a);
		mapobj.addOverlay(markerPoint_a);
		GEvent.addListener(markerPoint_a, 'click', function() {
			location.href = store_path + "area_result.php?p=1";
		});

		/* エリアB */
		var polygon_b = new GPolygon([
			new GLatLng(35.765134,139.676906),
			new GLatLng(35.765305,139.675444),
			new GLatLng(35.765993,139.672805),
			new GLatLng(35.766966,139.672792),
			new GLatLng(35.76699,139.675817),
			new GLatLng(35.766692,139.677464),
			new GLatLng(35.765686,139.677351),
			new GLatLng(35.765752,139.677027),
			new GLatLng(35.765134,139.676906)

//			new GLatLng(35.765134,139.676906),
//			new GLatLng(35.765305,139.675444),
//			new GLatLng(35.765993,139.672805),
//			new GLatLng(35.766966,139.672792),
//			new GLatLng(35.766372,139.677418),
//			new GLatLng(35.765686,139.677351),
//			new GLatLng(35.765752,139.677027),
//			new GLatLng(35.765134,139.676906)
		],
		"#0000bb", /* 枠線の色 */
		3, /* ピクセル単位の線の幅 */
		1, /* 枠線の有無 */
		"#8180c6", /* ポリゴン領域の色 */
		0.3 /* 透明度（0～１の間の数値） */
		);
		GEvent.addListener(polygon_b, "click", function(latlng){
			location.href = store_path + "area_result.php?p=2";
		});
		mapobj.addOverlay(polygon_b);

		var marker_b = new GIcon();
		marker_b.image = store_path + "img/area_b.png";
		marker_b.iconSize = new GSize(50, 50);
		marker_b.iconAnchor = new GPoint(0, 0);
		var markerPoint_b = new GMarker(new GLatLng(35.766492,139.675061), marker_b);
		mapobj.addOverlay(markerPoint_b);
		GEvent.addListener(markerPoint_b, 'click', function() {
			location.href = store_path + "area_result.php?p=2";
		});

		/* エリアC */
		var polygon_c = new GPolygon([
			new GLatLng(35.763799,139.676992),
			new GLatLng(35.763475,139.677131),
			new GLatLng(35.762315,139.679497),
			new GLatLng(35.763205,139.680009),
			new GLatLng(35.763799,139.679891),
			new GLatLng(35.764252,139.679975),
			new GLatLng(35.764537,139.67685),
			new GLatLng(35.764213,139.676785),
			new GLatLng(35.764078,139.677158),
			new GLatLng(35.763799,139.676992)
		],
		"#00e31f", /* 枠線の色 */
		3, /* ピクセル単位の線の幅 */
		1, /* 枠線の有無 */
		"#7ce88d", /* ポリゴン領域の色 */
		0.3 /* 透明度（0～１の間の数値） */
		);
		GEvent.addListener(polygon_c, "click", function(latlng){
			location.href = store_path + "area_result.php?p=3";
		});
		mapobj.addOverlay(polygon_c);

		var marker_c = new GIcon();
		marker_c.image = store_path + "img/area_c.png";
		marker_c.iconSize = new GSize(50, 50);
		marker_c.iconAnchor = new GPoint(0, 0);
		var markerPoint_c = new GMarker(new GLatLng(35.763852,139.678481), marker_c);
		mapobj.addOverlay(markerPoint_c);
		GEvent.addListener(markerPoint_c, 'click', function() {
			location.href = store_path + "area_result.php?p=3";
		});

		/* エリアD */
		var polygon_d = new GPolygon([
			new GLatLng(35.764572,139.676863),
			new GLatLng(35.764293,139.679988),
			new GLatLng(35.766759,139.680374),
			new GLatLng(35.766687,139.677477),
			new GLatLng(35.765634,139.677384),
			new GLatLng(35.765688,139.677075),
			new GLatLng(35.764572,139.676863)

//			new GLatLng(35.764572,139.676863),
//			new GLatLng(35.764293,139.679988),
//			new GLatLng(35.766132,139.680251),
//			new GLatLng(35.766368,139.677461),
//			new GLatLng(35.765634,139.677384),
//			new GLatLng(35.765688,139.677075),
//			new GLatLng(35.764572,139.676863)
		],
		"#fe9100", /* 枠線の色 */
		3, /* ピクセル単位の線の幅 */
		1, /* 枠線の有無 */
		"#faaf4b", /* ポリゴン領域の色 */
		0.3 /* 透明度（0～１の間の数値） */
		);
		GEvent.addListener(polygon_d, "click", function(latlng){
			location.href = store_path + "area_result.php?p=4";
		});
		mapobj.addOverlay(polygon_d);

		var marker_d = new GIcon();
		marker_d.image = store_path + "img/area_d.png";
		marker_d.iconSize = new GSize(50, 50);
		marker_d.iconAnchor = new GPoint(0, 0);
		var markerPoint_d = new GMarker(new GLatLng(35.765691,139.678499), marker_d);
		mapobj.addOverlay(markerPoint_d);
		GEvent.addListener(markerPoint_d, 'click', function() {
			location.href = store_path + "area_result.php?p=4";
		});
	}
}
//]]>
