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

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

function load()
{
	if (store_path == "")
	{
		var lat = 35.699042;
		var lng = 139.829049;
		var z = 17;
	}
	else
	{
		var lat = 35.699033
		var lng = 139.828776;
		var z = 16;
	}

	var latlng = new google.maps.LatLng(lat, lng);
	var myOptions =
	{
		zoom: z,
		center: latlng,
		mapTypeId: google.maps.MapTypeId.ROADMAP
	};
	mapobj = new google.maps.Map(document.getElementById("div_area"), myOptions);


	/* エリアA */
	var polygon_a_coords = 
	[
		new google.maps.LatLng(35.700067,139.825605),
		new google.maps.LatLng(35.699734,139.827426),
		new google.maps.LatLng(35.699336,139.827247),
		new google.maps.LatLng(35.698756,139.827316),
		new google.maps.LatLng(35.699024,139.825683),
		new google.maps.LatLng(35.700067,139.825605)
	];

	polygon_a = new google.maps.Polygon
	({
		paths: polygon_a_coords,
		strokeColor: "#FF0000",
		strokeWeight: 3,
		fillColor: "#FF6699",
		fillOpacity: 0.3
	});

	google.maps.event.addListener(polygon_a, "click", function(latlng){
		location.href = store_path + "area_result.php?p=1";
    });
    polygon_a.setMap(mapobj);

	var marker_a = new google.maps.LatLngBounds(new google.maps.LatLng(35.699303,139.826297), new google.maps.LatLng(35.699632,139.826753));
	var markerPoint_a = new google.maps.GroundOverlay(store_path + "img/area_1.png", marker_a, {clickable:true});
	google.maps.event.addListener(markerPoint_a, 'click', function() {
		location.href = store_path + "area_result.php?p=1";
	});
	markerPoint_a.setMap(mapobj);

	/* エリアB */
	var polygon_b_coords = 
	[
		new google.maps.LatLng(35.699734,139.827426),
		new google.maps.LatLng(35.699471,139.828754),
		new google.maps.LatLng(35.69851,139.828805),
		new google.maps.LatLng(35.698756,139.827316),
		new google.maps.LatLng(35.699336,139.827247),
		new google.maps.LatLng(35.699734,139.827426)
	];

	polygon_b = new google.maps.Polygon
	({
		paths: polygon_b_coords,
		strokeColor: "#0000BB",
		strokeWeight: 3,
		fillColor: "#8180c6",
		fillOpacity: 0.3
	});

	google.maps.event.addListener(polygon_b, "click", function(latlng){
		location.href = store_path + "area_result.php?p=2";
    });
    polygon_b.setMap(mapobj);

	var marker_b = new google.maps.LatLngBounds(new google.maps.LatLng(35.699018,139.827839), new google.maps.LatLng(35.699362,139.828303));
	var markerPoint_b = new google.maps.GroundOverlay(store_path + "img/area_2.png", marker_b, {clickable:true});
	google.maps.event.addListener(markerPoint_b, 'click', function() {
		location.href = store_path + "area_result.php?p=2";
	});
	markerPoint_b.setMap(mapobj);

	/* エリアC */
	var polygon_c_coords = 
	[
		new google.maps.LatLng(35.699471,139.828754),
		new google.maps.LatLng(35.699229,139.83013),
		new google.maps.LatLng(35.698349,139.830052),
		new google.maps.LatLng(35.69851,139.828805),
		new google.maps.LatLng(35.699471,139.828754)
	];

	polygon_c = new google.maps.Polygon
	({
		paths: polygon_c_coords,
		strokeColor: "#00E31F",
		strokeWeight: 3,
		fillColor: "#7CE88D",
		fillOpacity: 0.3
	});

	google.maps.event.addListener(polygon_c, "click", function(latlng){
		location.href = store_path + "area_result.php?p=3";
    });
    polygon_c.setMap(mapobj);

	var marker_c = new google.maps.LatLngBounds(new google.maps.LatLng(35.698737,139.829213), new google.maps.LatLng(35.699094,139.829655));
	var markerPoint_c = new google.maps.GroundOverlay(store_path + "img/area_3.png", marker_c, {clickable:true});
	google.maps.event.addListener(markerPoint_c, 'click', function() {
		location.href = store_path + "area_result.php?p=3";
	});
	markerPoint_c.setMap(mapobj);

	/* エリアD */
	var polygon_d_coords = 
	[
		new google.maps.LatLng(35.699229,139.83013),
		new google.maps.LatLng(35.698778,139.832737),
		new google.maps.LatLng(35.697972,139.832783),
		new google.maps.LatLng(35.698349,139.830052),
		new google.maps.LatLng(35.699229,139.83013)
	];

	polygon_d = new google.maps.Polygon
	({
		paths: polygon_d_coords,
		strokeColor: "#FE9100",
		strokeWeight: 3,
		fillColor: "#FAAF4B",
		fillOpacity: 0.3
	});

	google.maps.event.addListener(polygon_d, "click", function(latlng){
		location.href = store_path + "area_result.php?p=4";
    });
    polygon_d.setMap(mapobj);

	var marker_d = new google.maps.LatLngBounds(new google.maps.LatLng(35.698504,139.830991), new google.maps.LatLng(35.698841,139.831447));
	var markerPoint_d = new google.maps.GroundOverlay(store_path + "img/area_4.png", marker_d, {clickable:true});
	google.maps.event.addListener(markerPoint_d, 'click', function() {
		location.href = store_path + "area_result.php?p=4";
	});
	markerPoint_d.setMap(mapobj);
}
//]]>

