// Generated by trk2googlemaps and kml ( http://etoh.minidns.net/gps/ )
// 本コードはtrk2googlemaps and kmlによって自動生成されました。
numofwaypoints=0;
posofwaypoints=0;
numofphotos=0;
posofphotos=0;
waypoint_markers = [];
waypoint_infos   = [];
photo_markers    = [];
photo_infos      = [];
var points = [];
var map;
var currentzoom;
var key = "ABQIAAAAp5iNeNMofrJ-5adb3xUcVxSNnD69peFuQmlIV4MTbdSWu4WmeRSE9SJx2ZUtREn2YvdC6CicmYtJVQ";
var movemarkerIcon;
   

// ウェイポイント表示用関数
function addWayPoints(map, nType, lat, lon, title)
{
	var point=new GLatLng(lon, lat);
	var Icon = new GIcon();
	var nn;
	if (nType==1){ // 小さな赤いマーカ
		nn=posofphotos+1;
		Icon.image = "http://labs.google.com/ridefinder/images/mm_20_red.png";
		Icon.shadow = "http://labs.google.com/ridefinder/images/mm_20_shadow.png";
		Icon.iconSize = new GSize(12, 20);
		Icon.shadowSize = new GSize(22, 20);
		Icon.iconAnchor = new GPoint(6, 20);
		Icon.infoWindowAnchor = new GPoint(5, 1);

		photo_markers.push(new GMarker(point, Icon));
		photo_infos.push('<div style="width: 12em; style: font-size: small">'+title+'</div>');
		GEvent.addListener(photo_markers[posofphotos], "click", function(){jumpphotomarker(nn);});
		map.addOverlay(photo_markers[posofphotos]);
		posofphotos = posofphotos+1;

	}
	else
	{ // |>の形状のマーカ
		nn=posofwaypoints+1;
		Icon.image = "http://www.google.com/mapfiles/dd-start.png";
		Icon.shadow = "http://www.google.com/mapfiles/shadow50.png";
		Icon.iconSize = new GSize(20, 34);
		Icon.shadowSize = new GSize(37, 34);
		Icon.iconAnchor = new GPoint(9, 34);
		Icon.infoWindowAnchor = new GPoint(9, 2);

		waypoint_markers.push(new GMarker(point, Icon));
		waypoint_infos.push('<div style="width: 12em; style: font-size: small">'+title+'</div>');
		GEvent.addListener(waypoint_markers[posofwaypoints], "click",function(){jumpwaypointmarker(nn);});
		map.addOverlay(waypoint_markers[posofwaypoints]);
		posofwaypoints=posofwaypoints+1;
	}
}
	

// HTMLロード時
function load()
{
	// 初期化パラメータ
	var mapwidth=640;  // 地図の幅を設定します。
	var mapheight=480; // 地図の高さを設定します。
	var zoom=-1;    // この値を変更すると初期ズーム値が変わります。-1の場合は自動となります。
	var linecolor="#FF0000"; // この値を変更すると、線の色が変わります。
	var linewidth=2; // この値を変更すると、線の太さが変わります。 
	var lineopacity=1.00;   // この値を変更すると、線の透明度が変わります。
	var defaultmaptype=0; // この値を変更すると初期のマップタイプが変更されます。
	var wpt_points = [];

	// トラックデータ列です。
		points.push(new GLatLng(35.2478,138.9975));
	points.push(new GLatLng(35.24773,138.9974));
	points.push(new GLatLng(35.24767,138.9973));
	points.push(new GLatLng(35.24758,138.9972));
	points.push(new GLatLng(35.24745,138.9969));
	points.push(new GLatLng(35.24737,138.9969));
	points.push(new GLatLng(35.24726,138.9968));
	points.push(new GLatLng(35.24717,138.9968));
	points.push(new GLatLng(35.24697,138.9969));
	points.push(new GLatLng(35.24688,138.9969));
	points.push(new GLatLng(35.2468,138.997));
	points.push(new GLatLng(35.24672,138.9971));
	points.push(new GLatLng(35.24655,138.9973));
	points.push(new GLatLng(35.24647,138.9974));
	points.push(new GLatLng(35.24637,138.9975));
	points.push(new GLatLng(35.24627,138.9976));
	points.push(new GLatLng(35.24605,138.9977));
	points.push(new GLatLng(35.24593,138.9978));
	points.push(new GLatLng(35.24583,138.9978));
	points.push(new GLatLng(35.24574,138.9979));
	points.push(new GLatLng(35.24548,138.9982));
	points.push(new GLatLng(35.24548,138.9982));
	points.push(new GLatLng(35.24538,138.9984));
	points.push(new GLatLng(35.24529,138.9984));
	points.push(new GLatLng(35.24505,138.9985));
	points.push(new GLatLng(35.24493,138.9985));
	points.push(new GLatLng(35.2448,138.9985));
	points.push(new GLatLng(35.24468,138.9985));
	points.push(new GLatLng(35.24443,138.9986));
	points.push(new GLatLng(35.24434,138.9987));
	points.push(new GLatLng(35.24423,138.9989));
	points.push(new GLatLng(35.24413,138.9989));
	points.push(new GLatLng(35.24393,138.9992));
	points.push(new GLatLng(35.24383,138.9993));
	points.push(new GLatLng(35.24373,138.9994));
	points.push(new GLatLng(35.24363,138.9995));
	points.push(new GLatLng(35.24345,138.9996));
	points.push(new GLatLng(35.24335,138.9997));
	points.push(new GLatLng(35.24323,138.9998));
	points.push(new GLatLng(35.24312,138.9998));
	points.push(new GLatLng(35.2429,138.9998));
	points.push(new GLatLng(35.2427,138.9997));
	points.push(new GLatLng(35.2427,138.9997));
	points.push(new GLatLng(35.2426,138.9996));
	points.push(new GLatLng(35.24238,138.9995));
	points.push(new GLatLng(35.24228,138.9995));
	points.push(new GLatLng(35.24218,138.9994));
	points.push(new GLatLng(35.24207,138.9993));
	points.push(new GLatLng(35.24188,138.9992));
	points.push(new GLatLng(35.2418,138.9991));
	points.push(new GLatLng(35.24172,138.999));
	points.push(new GLatLng(35.24165,138.9988));
	points.push(new GLatLng(35.24155,138.9985));
	points.push(new GLatLng(35.24154,138.9984));
	points.push(new GLatLng(35.2415,138.9982));
	points.push(new GLatLng(35.2415,138.9981));
	points.push(new GLatLng(35.24147,138.9977));
	points.push(new GLatLng(35.24145,138.9975));
	points.push(new GLatLng(35.24143,138.9974));
	points.push(new GLatLng(35.24142,138.9972));
	points.push(new GLatLng(35.24137,138.9969));
	points.push(new GLatLng(35.24135,138.9967));
	points.push(new GLatLng(35.24132,138.9964));
	points.push(new GLatLng(35.24132,138.9964));
	points.push(new GLatLng(35.24128,138.996));
	points.push(new GLatLng(35.24127,138.9959));
	points.push(new GLatLng(35.24125,138.9957));
	points.push(new GLatLng(35.24123,138.9955));
	points.push(new GLatLng(35.24118,138.9952));
	points.push(new GLatLng(35.24117,138.995));
	points.push(new GLatLng(35.24115,138.9949));
	points.push(new GLatLng(35.24113,138.9947));
	points.push(new GLatLng(35.2411,138.9944));
	points.push(new GLatLng(35.24109,138.9942));
	points.push(new GLatLng(35.24105,138.994));
	points.push(new GLatLng(35.24102,138.9939));
	points.push(new GLatLng(35.24087,138.9936));
	points.push(new GLatLng(35.24077,138.9935));
	points.push(new GLatLng(35.24065,138.9934));
	points.push(new GLatLng(35.24053,138.9933));
	points.push(new GLatLng(35.24025,138.9932));
	points.push(new GLatLng(35.24012,138.9932));
	points.push(new GLatLng(35.23997,138.9933));
	points.push(new GLatLng(35.23983,138.9933));
	points.push(new GLatLng(35.23955,138.9936));
	points.push(new GLatLng(35.2394,138.9937));
	points.push(new GLatLng(35.23927,138.9938));
	points.push(new GLatLng(35.23913,138.9939));
	points.push(new GLatLng(35.2389,138.9941));
	points.push(new GLatLng(35.23878,138.9942));
	points.push(new GLatLng(35.23858,138.9945));
	points.push(new GLatLng(35.23858,138.9945));
	points.push(new GLatLng(35.23838,138.9948));
	points.push(new GLatLng(35.23829,138.9949));
	points.push(new GLatLng(35.23818,138.995));
	points.push(new GLatLng(35.23808,138.9952));
	points.push(new GLatLng(35.23788,138.9955));
	points.push(new GLatLng(35.23782,138.9957));
	points.push(new GLatLng(35.23775,138.9958));
	points.push(new GLatLng(35.23768,138.996));
	points.push(new GLatLng(35.23757,138.9964));
	points.push(new GLatLng(35.23752,138.9965));
	points.push(new GLatLng(35.23743,138.9966));
	points.push(new GLatLng(35.23734,138.9968));
	points.push(new GLatLng(35.23713,138.997));
	points.push(new GLatLng(35.23701,138.9971));
	points.push(new GLatLng(35.2369,138.9973));
	points.push(new GLatLng(35.23678,138.9974));
	points.push(new GLatLng(35.23652,138.9975));
	points.push(new GLatLng(35.23638,138.9976));
	points.push(new GLatLng(35.23623,138.9977));
	points.push(new GLatLng(35.23608,138.9977));
	points.push(new GLatLng(35.2358,138.9977));
	points.push(new GLatLng(35.23567,138.9977));
	points.push(new GLatLng(35.23555,138.9977));
	points.push(new GLatLng(35.23543,138.9977));
	points.push(new GLatLng(35.23522,138.9978));
	points.push(new GLatLng(35.2351,138.9978));
	points.push(new GLatLng(35.23498,138.9978));
	points.push(new GLatLng(35.23488,138.9978));
	points.push(new GLatLng(35.2347,138.9978));
	points.push(new GLatLng(35.23462,138.9978));
	points.push(new GLatLng(35.23457,138.9979));
	points.push(new GLatLng(35.23452,138.998));
	points.push(new GLatLng(35.23455,138.9982));
	points.push(new GLatLng(35.2346,138.9982));
	points.push(new GLatLng(35.23468,138.9983));
	points.push(new GLatLng(35.23478,138.9983));
	points.push(new GLatLng(35.235,138.9983));
	points.push(new GLatLng(35.23512,138.9982));
	points.push(new GLatLng(35.23525,138.9982));
	points.push(new GLatLng(35.23538,138.9982));
	points.push(new GLatLng(35.23563,138.9982));
	points.push(new GLatLng(35.23578,138.9982));
	points.push(new GLatLng(35.23592,138.9982));
	points.push(new GLatLng(35.23605,138.9982));
	points.push(new GLatLng(35.23632,138.9982));
	points.push(new GLatLng(35.23645,138.9981));
	points.push(new GLatLng(35.23658,138.9981));
	points.push(new GLatLng(35.23672,138.9981));
	points.push(new GLatLng(35.23698,138.9981));
	points.push(new GLatLng(35.2371,138.9981));
	points.push(new GLatLng(35.23723,138.9981));
	points.push(new GLatLng(35.23735,138.9981));
	points.push(new GLatLng(35.23758,138.9981));
	points.push(new GLatLng(35.2377,138.9981));
	points.push(new GLatLng(35.2378,138.9981));
	points.push(new GLatLng(35.23788,138.9981));
	points.push(new GLatLng(35.23798,138.9983));
	points.push(new GLatLng(35.23802,138.9984));
	points.push(new GLatLng(35.23802,138.9985));
	points.push(new GLatLng(35.23803,138.9987));
	points.push(new GLatLng(35.23803,138.9989));
	points.push(new GLatLng(35.23805,138.9991));
	points.push(new GLatLng(35.23808,138.9992));
	points.push(new GLatLng(35.23812,138.9994));
	points.push(new GLatLng(35.23825,138.9996));
	points.push(new GLatLng(35.2383,138.9998));
	points.push(new GLatLng(35.23835,138.9999));
	points.push(new GLatLng(35.23837,139.0001));
	points.push(new GLatLng(35.23832,139.0004));
	points.push(new GLatLng(35.23827,139.0005));
	points.push(new GLatLng(35.23822,139.0007));
	points.push(new GLatLng(35.2381,139.001));
	points.push(new GLatLng(35.23803,139.0011));
	points.push(new GLatLng(35.23798,139.0013));
	points.push(new GLatLng(35.23792,139.0014));
	points.push(new GLatLng(35.23783,139.0016));
	points.push(new GLatLng(35.23763,139.0018));
	points.push(new GLatLng(35.23752,139.0019));
	points.push(new GLatLng(35.23738,139.002));
	points.push(new GLatLng(35.23727,139.002));
	points.push(new GLatLng(35.23701,139.0021));
	points.push(new GLatLng(35.23689,139.002));
	points.push(new GLatLng(35.23677,139.002));
	points.push(new GLatLng(35.23663,139.002));
	points.push(new GLatLng(35.2364,139.0018));
	points.push(new GLatLng(35.23627,139.0017));
	points.push(new GLatLng(35.23613,139.0016));
	points.push(new GLatLng(35.23598,139.0015));
	points.push(new GLatLng(35.23572,139.0013));
	points.push(new GLatLng(35.23557,139.0013));
	points.push(new GLatLng(35.2353,139.0011));
	points.push(new GLatLng(35.2353,139.0011));
	points.push(new GLatLng(35.23512,139.0008));
	points.push(new GLatLng(35.23505,139.0006));
	points.push(new GLatLng(35.235,139.0004));
	points.push(new GLatLng(35.23495,139.0002));
	points.push(new GLatLng(35.2348,138.9998));
	points.push(new GLatLng(35.2347,138.9997));
	points.push(new GLatLng(35.2346,138.9995));
	points.push(new GLatLng(35.23447,138.9994));
	points.push(new GLatLng(35.23418,138.9993));
	points.push(new GLatLng(35.23403,138.9993));
	points.push(new GLatLng(35.23388,138.9993));
	points.push(new GLatLng(35.23373,138.9994));
	points.push(new GLatLng(35.23347,138.9996));
	points.push(new GLatLng(35.23333,138.9997));
	points.push(new GLatLng(35.2332,138.9998));
	points.push(new GLatLng(35.23307,138.9998));
	points.push(new GLatLng(35.23283,138.9996));
	points.push(new GLatLng(35.23258,138.9994));
	points.push(new GLatLng(35.23258,138.9994));
	points.push(new GLatLng(35.23247,138.9993));
	points.push(new GLatLng(35.2322,138.9991));
	points.push(new GLatLng(35.23207,138.9989));
	points.push(new GLatLng(35.23193,138.9988));
	points.push(new GLatLng(35.2318,138.9987));
	points.push(new GLatLng(35.2315,138.9984));
	points.push(new GLatLng(35.23135,138.9984));
	points.push(new GLatLng(35.2312,138.9983));
	points.push(new GLatLng(35.23105,138.9983));
	points.push(new GLatLng(35.23075,138.9983));
	points.push(new GLatLng(35.2306,138.9983));
	points.push(new GLatLng(35.23046,138.9982));
	points.push(new GLatLng(35.23033,138.9982));
	points.push(new GLatLng(35.22985,138.9981));
	points.push(new GLatLng(35.22985,138.9981));
	points.push(new GLatLng(35.2297,138.9981));
	points.push(new GLatLng(35.22953,138.9982));
	points.push(new GLatLng(35.22925,138.9985));
	points.push(new GLatLng(35.22912,138.9987));
	points.push(new GLatLng(35.22898,138.9988));
	points.push(new GLatLng(35.22883,138.999));
	points.push(new GLatLng(35.22855,138.9992));
	points.push(new GLatLng(35.22842,138.9994));
	points.push(new GLatLng(35.22832,138.9995));
	points.push(new GLatLng(35.22822,138.9997));
	points.push(new GLatLng(35.228,139));
	points.push(new GLatLng(35.22788,139.0002));
	points.push(new GLatLng(35.22777,139.0004));
	points.push(new GLatLng(35.22768,139.0006));
	points.push(new GLatLng(35.22753,139.001));
	points.push(new GLatLng(35.22752,139.0014));
	points.push(new GLatLng(35.22757,139.0016));
	points.push(new GLatLng(35.22775,139.0019));
	points.push(new GLatLng(35.22785,139.002));
	points.push(new GLatLng(35.22797,139.0022));
	points.push(new GLatLng(35.22803,139.0023));
	points.push(new GLatLng(35.22808,139.0026));
	points.push(new GLatLng(35.22803,139.0027));
	points.push(new GLatLng(35.22795,139.0029));
	points.push(new GLatLng(35.22777,139.0029));
	points.push(new GLatLng(35.22735,139.003));
	points.push(new GLatLng(35.2272,139.0031));
	points.push(new GLatLng(35.22705,139.0032));
	points.push(new GLatLng(35.22692,139.0033));
	points.push(new GLatLng(35.22667,139.0036));
	points.push(new GLatLng(35.22655,139.0037));
	points.push(new GLatLng(35.22645,139.0038));
	points.push(new GLatLng(35.22632,139.004));
	points.push(new GLatLng(35.2261,139.0043));
	points.push(new GLatLng(35.22597,139.0044));
	points.push(new GLatLng(35.22583,139.0045));
	points.push(new GLatLng(35.22572,139.0045));
	points.push(new GLatLng(35.22548,139.0044));
	points.push(new GLatLng(35.22537,139.0043));
	points.push(new GLatLng(35.22525,139.0043));
	points.push(new GLatLng(35.22513,139.0042));
	points.push(new GLatLng(35.22477,139.0043));
	points.push(new GLatLng(35.22477,139.0043));
	points.push(new GLatLng(35.22463,139.0043));
	points.push(new GLatLng(35.2245,139.0042));
	points.push(new GLatLng(35.22425,139.0042));
	points.push(new GLatLng(35.22413,139.0041));
	points.push(new GLatLng(35.22402,139.0042));
	points.push(new GLatLng(35.2239,139.0043));
	points.push(new GLatLng(35.22377,139.0045));
	points.push(new GLatLng(35.22372,139.0047));
	points.push(new GLatLng(35.22367,139.0049));
	points.push(new GLatLng(35.22362,139.005));
	points.push(new GLatLng(35.22352,139.0053));
	points.push(new GLatLng(35.22346,139.0055));
	points.push(new GLatLng(35.22342,139.0056));
	points.push(new GLatLng(35.22335,139.0058));
	points.push(new GLatLng(35.22325,139.0061));
	points.push(new GLatLng(35.2232,139.0063));
	points.push(new GLatLng(35.22313,139.0064));
	points.push(new GLatLng(35.22301,139.0065));
	points.push(new GLatLng(35.22278,139.0066));
	points.push(new GLatLng(35.22263,139.0066));
	points.push(new GLatLng(35.22248,139.0065));
	points.push(new GLatLng(35.22235,139.0065));
	points.push(new GLatLng(35.22205,139.0063));
	points.push(new GLatLng(35.2219,139.0063));
	points.push(new GLatLng(35.22175,139.0062));
	points.push(new GLatLng(35.2216,139.0061));
	points.push(new GLatLng(35.22133,139.0059));
	points.push(new GLatLng(35.2212,139.0058));
	points.push(new GLatLng(35.22108,139.0057));
	points.push(new GLatLng(35.22097,139.0056));
	points.push(new GLatLng(35.22072,139.0056));
	points.push(new GLatLng(35.22058,139.0056));
	points.push(new GLatLng(35.22043,139.0055));
	points.push(new GLatLng(35.22028,139.0056));
	points.push(new GLatLng(35.21997,139.0056));
	points.push(new GLatLng(35.2198,139.0057));
	points.push(new GLatLng(35.21964,139.0057));
	points.push(new GLatLng(35.2193,139.0057));
	points.push(new GLatLng(35.21913,139.0057));
	points.push(new GLatLng(35.21895,139.0057));
	points.push(new GLatLng(35.21878,139.0056));
	points.push(new GLatLng(35.21862,139.0056));
	points.push(new GLatLng(35.2183,139.0056));
	points.push(new GLatLng(35.21813,139.0057));
	points.push(new GLatLng(35.21797,139.0058));
	points.push(new GLatLng(35.21782,139.0058));
	points.push(new GLatLng(35.2175,139.006));
	points.push(new GLatLng(35.21738,139.0061));
	points.push(new GLatLng(35.21729,139.0063));
	points.push(new GLatLng(35.21722,139.0065));
	points.push(new GLatLng(35.21717,139.0069));
	points.push(new GLatLng(35.2172,139.0071));
	points.push(new GLatLng(35.21722,139.0073));
	points.push(new GLatLng(35.21725,139.0075));
	points.push(new GLatLng(35.21735,139.0079));
	points.push(new GLatLng(35.21743,139.0081));
	points.push(new GLatLng(35.21753,139.0082));
	points.push(new GLatLng(35.21765,139.0084));
	points.push(new GLatLng(35.21788,139.0087));
	points.push(new GLatLng(35.2181,139.009));
	points.push(new GLatLng(35.2181,139.009));
	points.push(new GLatLng(35.21822,139.0092));
	points.push(new GLatLng(35.2184,139.0094));
	points.push(new GLatLng(35.21847,139.0096));
	points.push(new GLatLng(35.2185,139.0098));
	points.push(new GLatLng(35.21853,139.01));
	points.push(new GLatLng(35.21855,139.0104));
	points.push(new GLatLng(35.21855,139.0106));
	points.push(new GLatLng(35.21855,139.0108));
	points.push(new GLatLng(35.21857,139.0109));
	points.push(new GLatLng(35.21853,139.0113));
	points.push(new GLatLng(35.21848,139.0114));
	points.push(new GLatLng(35.21842,139.0115));
	points.push(new GLatLng(35.21832,139.0116));
	points.push(new GLatLng(35.21808,139.0119));
	points.push(new GLatLng(35.21798,139.012));
	points.push(new GLatLng(35.21788,139.0121));
	points.push(new GLatLng(35.21768,139.0124));
	points.push(new GLatLng(35.21758,139.0125));
	points.push(new GLatLng(35.21747,139.0126));
	points.push(new GLatLng(35.21735,139.0127));
	points.push(new GLatLng(35.21722,139.0128));
	points.push(new GLatLng(35.21692,139.013));
	points.push(new GLatLng(35.21677,139.013));
	points.push(new GLatLng(35.2166,139.0131));
	points.push(new GLatLng(35.21643,139.0131));
	points.push(new GLatLng(35.21608,139.0132));
	points.push(new GLatLng(35.2159,139.0132));
	points.push(new GLatLng(35.21575,139.0132));
	points.push(new GLatLng(35.21558,139.0132));
	points.push(new GLatLng(35.21533,139.0133));
	points.push(new GLatLng(35.21523,139.0134));
	points.push(new GLatLng(35.21517,139.0136));
	points.push(new GLatLng(35.21512,139.0138));
	points.push(new GLatLng(35.21503,139.0142));
	points.push(new GLatLng(35.21495,139.0146));
	points.push(new GLatLng(35.21495,139.0146));
	points.push(new GLatLng(35.21492,139.0147));
	points.push(new GLatLng(35.2148,139.015));
	points.push(new GLatLng(35.2147,139.0152));
	points.push(new GLatLng(35.21458,139.0153));
	points.push(new GLatLng(35.21447,139.0154));
	points.push(new GLatLng(35.21418,139.0153));
	points.push(new GLatLng(35.21405,139.0153));
	points.push(new GLatLng(35.21392,139.0152));
	points.push(new GLatLng(35.2138,139.0151));
	points.push(new GLatLng(35.21357,139.0148));
	points.push(new GLatLng(35.21345,139.0148));
	points.push(new GLatLng(35.21332,139.0146));
	points.push(new GLatLng(35.21318,139.0146));
	points.push(new GLatLng(35.2129,139.0145));
	points.push(new GLatLng(35.21275,139.0145));
	points.push(new GLatLng(35.21258,139.0146));
	points.push(new GLatLng(35.21243,139.0146));
	points.push(new GLatLng(35.21213,139.0148));
	points.push(new GLatLng(35.21197,139.0149));
	points.push(new GLatLng(35.2118,139.015));
	points.push(new GLatLng(35.21167,139.0151));
	points.push(new GLatLng(35.2114,139.0152));
	points.push(new GLatLng(35.21127,139.0153));
	points.push(new GLatLng(35.21113,139.0154));
	points.push(new GLatLng(35.21098,139.0154));
	points.push(new GLatLng(35.21072,139.0155));
	points.push(new GLatLng(35.2106,139.0157));
	points.push(new GLatLng(35.21052,139.0158));
	points.push(new GLatLng(35.21045,139.0159));
	points.push(new GLatLng(35.21038,139.0163));
	points.push(new GLatLng(35.2104,139.0165));
	points.push(new GLatLng(35.21045,139.0166));
	points.push(new GLatLng(35.21053,139.0168));
	points.push(new GLatLng(35.21077,139.017));
	points.push(new GLatLng(35.21088,139.0171));
	points.push(new GLatLng(35.21103,139.0172));
	points.push(new GLatLng(35.21117,139.0173));
	points.push(new GLatLng(35.21143,139.0175));
	points.push(new GLatLng(35.21158,139.0176));
	points.push(new GLatLng(35.21172,139.0176));
	points.push(new GLatLng(35.21187,139.0177));
	points.push(new GLatLng(35.21212,139.0179));
	points.push(new GLatLng(35.2123,139.0181));
	points.push(new GLatLng(35.2123,139.0181));
	points.push(new GLatLng(35.21235,139.0182));
	points.push(new GLatLng(35.21235,139.0185));
	points.push(new GLatLng(35.21233,139.0187));
	points.push(new GLatLng(35.2123,139.0188));
	points.push(new GLatLng(35.21218,139.0189));
	points.push(new GLatLng(35.21192,139.019));
	points.push(new GLatLng(35.21175,139.0191));
	points.push(new GLatLng(35.21158,139.0191));
	points.push(new GLatLng(35.21142,139.0191));
	points.push(new GLatLng(35.21108,139.0191));
	points.push(new GLatLng(35.21092,139.0192));
	points.push(new GLatLng(35.21075,139.0192));
	points.push(new GLatLng(35.21058,139.0192));
	points.push(new GLatLng(35.21029,139.0193));
	points.push(new GLatLng(35.21015,139.0195));
	points.push(new GLatLng(35.21,139.0196));
	points.push(new GLatLng(35.20988,139.0197));
	points.push(new GLatLng(35.20957,139.0202));
	points.push(new GLatLng(35.2095,139.0204));
	points.push(new GLatLng(35.20943,139.0206));
	points.push(new GLatLng(35.20927,139.021));
	points.push(new GLatLng(35.20917,139.0212));
	points.push(new GLatLng(35.20907,139.0213));
	points.push(new GLatLng(35.20895,139.0215));
	points.push(new GLatLng(35.20877,139.0218));
	points.push(new GLatLng(35.20867,139.0219));
	points.push(new GLatLng(35.20856,139.022));
	points.push(new GLatLng(35.20845,139.0221));
	points.push(new GLatLng(35.2082,139.0221));
	points.push(new GLatLng(35.20805,139.0221));
	points.push(new GLatLng(35.20792,139.022));
	points.push(new GLatLng(35.2078,139.022));
	points.push(new GLatLng(35.20761,139.022));
	points.push(new GLatLng(35.20753,139.0221));
	points.push(new GLatLng(35.20747,139.0223));
	points.push(new GLatLng(35.2074,139.0224));
	points.push(new GLatLng(35.20727,139.0227));
	points.push(new GLatLng(35.20722,139.0229));
	points.push(new GLatLng(35.20715,139.023));
	points.push(new GLatLng(35.2071,139.0232));
	points.push(new GLatLng(35.20697,139.0236));
	points.push(new GLatLng(35.2069,139.0237));
	points.push(new GLatLng(35.20683,139.0239));
	points.push(new GLatLng(35.20677,139.0241));
	points.push(new GLatLng(35.20663,139.0245));
	points.push(new GLatLng(35.20655,139.0247));
	points.push(new GLatLng(35.20648,139.0249));
	points.push(new GLatLng(35.20642,139.0251));
	points.push(new GLatLng(35.20627,139.0254));
	points.push(new GLatLng(35.20618,139.0256));
	points.push(new GLatLng(35.20612,139.0258));
	points.push(new GLatLng(35.20605,139.026));
	points.push(new GLatLng(35.20593,139.0263));
	points.push(new GLatLng(35.20588,139.0265));
	points.push(new GLatLng(35.20592,139.0267));
	points.push(new GLatLng(35.20613,139.027));
	points.push(new GLatLng(35.20625,139.0272));
	points.push(new GLatLng(35.20638,139.0273));
	points.push(new GLatLng(35.20652,139.0275));
	points.push(new GLatLng(35.20663,139.0277));
	points.push(new GLatLng(35.20685,139.028));
	points.push(new GLatLng(35.20697,139.0282));
	points.push(new GLatLng(35.20707,139.0283));
	points.push(new GLatLng(35.20717,139.0285));
	points.push(new GLatLng(35.20737,139.0288));
	points.push(new GLatLng(35.20749,139.0289));
	points.push(new GLatLng(35.20758,139.0291));
	points.push(new GLatLng(35.20773,139.0292));
	points.push(new GLatLng(35.20802,139.0293));
	points.push(new GLatLng(35.20818,139.0294));
	points.push(new GLatLng(35.2083,139.0295));
	points.push(new GLatLng(35.20845,139.0296));
	points.push(new GLatLng(35.20863,139.0298));
	points.push(new GLatLng(35.20865,139.0299));
	points.push(new GLatLng(35.20865,139.03));
	points.push(new GLatLng(35.20855,139.0303));
	points.push(new GLatLng(35.20847,139.0305));
	points.push(new GLatLng(35.20838,139.0307));
	points.push(new GLatLng(35.20832,139.0309));
	points.push(new GLatLng(35.20823,139.031));
	points.push(new GLatLng(35.20802,139.0314));
	points.push(new GLatLng(35.20788,139.0315));
	points.push(new GLatLng(35.20775,139.0316));
	points.push(new GLatLng(35.20757,139.0317));
	points.push(new GLatLng(35.20725,139.0317));
	points.push(new GLatLng(35.20712,139.0318));
	points.push(new GLatLng(35.20698,139.0318));
	points.push(new GLatLng(35.20687,139.0319));
	points.push(new GLatLng(35.20673,139.0321));
	points.push(new GLatLng(35.20667,139.0322));
	points.push(new GLatLng(35.20662,139.0323));
	points.push(new GLatLng(35.20652,139.0324));
	points.push(new GLatLng(35.2063,139.0324));
	points.push(new GLatLng(35.20621,139.0323));
	points.push(new GLatLng(35.20612,139.0322));
	points.push(new GLatLng(35.20603,139.0321));
	points.push(new GLatLng(35.20583,139.0319));
	points.push(new GLatLng(35.20583,139.0319));
	points.push(new GLatLng(35.2058,139.0319));
	points.push(new GLatLng(35.20572,139.0319));
	points.push(new GLatLng(35.2057,139.0319));
	points.push(new GLatLng(35.20565,139.0319));
	points.push(new GLatLng(35.20558,139.0319));
	points.push(new GLatLng(35.20553,139.032));
	points.push(new GLatLng(35.2054,139.032));
	points.push(new GLatLng(35.20532,139.032));
	points.push(new GLatLng(35.20522,139.0321));
	points.push(new GLatLng(35.20513,139.0321));
	points.push(new GLatLng(35.205,139.0323));
	points.push(new GLatLng(35.20495,139.0325));
	points.push(new GLatLng(35.20495,139.0327));
	points.push(new GLatLng(35.20495,139.0328));
	points.push(new GLatLng(35.20502,139.0332));
	points.push(new GLatLng(35.20507,139.0334));
	points.push(new GLatLng(35.20512,139.0335));
	points.push(new GLatLng(35.20513,139.0337));
	points.push(new GLatLng(35.20522,139.0339));
	points.push(new GLatLng(35.20527,139.034));
	points.push(new GLatLng(35.2053,139.0341));
	points.push(new GLatLng(35.20533,139.0341));
	points.push(new GLatLng(35.2054,139.0344));
	points.push(new GLatLng(35.2054,139.0345));
	points.push(new GLatLng(35.20545,139.0347));
	points.push(new GLatLng(35.20548,139.0348));
	points.push(new GLatLng(35.20564,139.0352));
	points.push(new GLatLng(35.20564,139.0352));
	points.push(new GLatLng(35.20567,139.0354));
	points.push(new GLatLng(35.20575,139.0356));
	points.push(new GLatLng(35.20583,139.0359));
	points.push(new GLatLng(35.20588,139.0361));
	points.push(new GLatLng(35.2059,139.0362));
	points.push(new GLatLng(35.2059,139.0363));
	points.push(new GLatLng(35.20578,139.0365));
	points.push(new GLatLng(35.20567,139.0365));
	points.push(new GLatLng(35.20557,139.0365));
	points.push(new GLatLng(35.20543,139.0365));
	points.push(new GLatLng(35.2052,139.0364));
	points.push(new GLatLng(35.20508,139.0364));
	points.push(new GLatLng(35.205,139.0365));
	points.push(new GLatLng(35.20495,139.0365));
	points.push(new GLatLng(35.20503,139.0367));
	points.push(new GLatLng(35.20513,139.0368));
	points.push(new GLatLng(35.20522,139.037));
	points.push(new GLatLng(35.2053,139.0371));
	points.push(new GLatLng(35.20545,139.0374));
	points.push(new GLatLng(35.20548,139.0376));
	points.push(new GLatLng(35.20553,139.0377));
	points.push(new GLatLng(35.20557,139.0379));
	points.push(new GLatLng(35.20558,139.0383));
	points.push(new GLatLng(35.20553,139.0387));
	points.push(new GLatLng(35.20553,139.0387));
	points.push(new GLatLng(35.20553,139.039));
	points.push(new GLatLng(35.20552,139.0394));
	points.push(new GLatLng(35.20548,139.0396));


	// 表示の中心位置・サイズを算出します。
	var xavg=0;
	var yavg=0;
	var xmin=181;
	var xmax=-181;
	var ymin=91;
	var ymax=-91;
	for (var i=0; i<points.length; i++)
	{
		if (xmin>points[i].x) xmin=points[i].x;
		if (xmax<points[i].x) xmax=points[i].x;
		if (ymin>points[i].y) ymin=points[i].y;
		if (ymax<points[i].y) ymax=points[i].y;
	}
	for (var i=0; i<wpt_points.length; i++)
	{
		if (xmin>wpt_points[i].x) xmin=wpt_points[i].x;
		if (xmax<wpt_points[i].x) xmax=wpt_points[i].x;
		if (ymin>wpt_points[i].y) ymin=wpt_points[i].y;
		if (ymax<wpt_points[i].y) ymax=wpt_points[i].y;
	}
		
	xavg=(xmax+xmin)/2;
	yavg=(ymax+ymin)/2;
	var centerpos=new GLatLng( yavg, xavg);
	var region=new GLatLngBounds(new GLatLng(ymin,xmin), new GLatLng(ymax, xmax));
	
	// マップ初期化	
	map = new GMap2(document.getElementById("map"));
	map.addControl(new GLargeMapControl());
	map.addMapType(G_PHYSICAL_MAP);
	map.addControl(new GHierarchicalMapTypeControl());
	map.enableContinuousZoom();
	map.enableDoubleClickZoom();
	map.addControl(new GOverviewMapControl());
	
	if (zoom>0)
	{
		map.setCenter(centerpos, 17-zoom);
	}
	else
	{
		map.setCenter(centerpos, map.getBoundsZoomLevel(region));
	}
	
	// 軌跡再生アイコン
	movemarkerIcon = new GIcon();
	movemarkerIcon.iconSize = new GSize(32, 32);
	movemarkerIcon.shadowSize = new GSize(59, 32);
	movemarkerIcon.iconAnchor = new GPoint(16, 16);
	movemarkerIcon.infoWindowAnchor = new GPoint(1, 1);
	movemarkerIcon.image = "http://maps.google.co.jp/mapfiles/ms/icons/hospitals.png";
	movemarkerIcon.shadow = "http://maps.google.co.jp/mapfiles/ms/icons/hospitals.shadow.png";

	var overlay;
	if (points.length > 0)
	{
		//var encoded_points = "{36}";
		//var encoded_levels = "{37}";
		//overlay = GPolyline.fromEncoded({color: linecolor,
	    //                                      weight: linewidth,
	    //                                      points: encoded_points,
	    //                                      zoomFactor: 32,
		//                                      levels: encoded_levels,
		//                                      numLevels: 4
		//                                    });
		//map.addOverlay(overlay); 
		
		// トラックログがあった場合：
		// 線の色と幅と不透明度を設定します。
		var polyline= new GPolyline(points, linecolor, linewidth, lineopacity);

		// 線を描画します。
		map.addOverlay(polyline);
	}
		
	// 初期マップタイプ設定
	switch(defaultmaptype)
	{
		case 0:
		map.setMapType(G_NORMAL_MAP);   	//This is the normal street map type.
		break;
		
		case 1:
		map.setMapType(G_SATELLITE_MAP); //This map type shows Google Earth satellite images.
		break;
	
		case 2:
		map.setMapType(G_HYBRID_MAP); 	//This map type shows transparent street maps over Google Earth satellite images.
		break;
		
		case 3:
		map.setMapType(G_PHYSICAL_MAP); 
		break;		
	
		default:
		map.setMapType(G_NORMAL_MAP);
		break;
	}


	if (numofwaypoints == 0)
	{
		hiddenLAYER('waypointcombo');
	}
	if (numofphotos==0)
	{
		hiddenLAYER('photocombo');
	}
	if (callHiddenLayers==1)
	{
		hiddenLayers();
	}
	
} // end of load() function.


var moveMarker;
var obj2;
var strStart ="開始";
var strStop = "始点へ";
var strPause ="一時停止";
function operateTracking(obj) 
{
	if(obj.value == strStart)
	{
		obj.value = strPause;
		panTo(strStart, obj);
		obj2 = obj;
	}
	else if (obj.value == strPause)
	{
		panTo(strPause, obj);
		obj2 = obj;
	}
	else if (obj.value == strStop)
	{
		panTo(strStop, obj);
		if (obj2) obj2.value=strStart;
	}
	else
	{
		obj.value="";
	}
}
    

var iCurrent=0;
var timerID;
function panTo(state, obj)
{
	if (state==strStart)
	{
		map.panTo(points[iCurrent]);
		if (moveMarker == null)
		{
			moveMarker = new GMarker(points[iCurrent], movemarkerIcon);
			map.addOverlay(moveMarker);
		}
		else
		{
			moveMarker.setLatLng(points[iCurrent]);
		}
		iCurrent++;
		if (timerID != null) window.clearTimeout(timerID);
		timerID = window.setTimeout(function(){ panTo(strStart, obj); }, 60000/points.length);
		if (iCurrent==points.length)
		{
			obj.value=strStart;
			panTo(strStop, obj);
		}
	}
	else if (state==strStop)
	{
		iCurrent=0;
		if (moveMarker == null)
		{
			moveMarker = new GMarker(points[iCurrent], movemarkerIcon);
			map.addOverlay(moveMarker);
		}
		else
		{
			moveMarker.setLatLng(points[iCurrent]);
		}
		map.panTo(points[iCurrent]);
		if (timerID != null) window.clearTimeout(timerID);
	}
	else
	{
		obj.value = strStart;
		if (timerID != null) window.clearTimeout(timerID);
	}
}	

// 指定された写真へジャンプ
function jumpphotomarker(n)
{
	photo_markers[n-1].openInfoWindowHtml(photo_infos[n-1]);
	location.hash="#googlemap";
}
	
// 指定されたマーカーへジャンプ
function jumpwaypointmarker(n)
{
	waypoint_markers[n-1].openInfoWindowHtml(waypoint_infos[n-1]);
	location.hash="#googlemap";
}

// グラフは初期状態では消しておく
function hiddenLayers()
{
}

// 指定したレイヤーを非表示にする
function hiddenLAYER(idName)
{ 
	if ( document.getElementById )
	{
		document.getElementById( idName ).style.visibility='hidden';
	}
	else if ( document.all )
	{
		document.all( idName ).style.visibility = 'hidden';
	}
	else if ( document.layers )
	{
		document.layers[ idName ].visibility = 'hidden';
	}
}

// 指定したレイヤーを表示する
function showLAYER(idName)
{
	if ( document.getElementById )
	{
		document.getElementById( idName ).style.visibility   = 'visible';
	}
	else if ( document.all )
	{
		document.all( idName ).style.visibility = 'visible';
	}
	else if ( document.layers )
	{
		document.layers[ idName ].visibility = 'visible';
	}
}

// 地図を表示する
function showMapPop( idName, lat, lon )
{ 
	var svalue;
	var zoomlevel;
	if (map == null)
	{
		if (currentzoom == null)
		{
			zoomlevel=12; // 指定がない場合	
		}
		else
		{
			zoomlevel=currentzoom; // htmlファイルに?xxでズームレベルが渡されたとき
		}
	}
	else
	{
		zoomlevel=map.getZoom();
	}
	svalue = ".<img src=\"http://maps.google.com/staticmap?center="+lat+","+lon+"&markers="+lat+","+lon+",blue&zoom="+zoomlevel+"&size=240x240&key="+key+"\" width=\"240\" height=\"240\"  />.";

	if ( document.getElementById )
	{
		document.getElementById( idName ).style.display="block";
		document.getElementById( idName ).innerHTML = svalue;
	}
	else if ( document.all )
	{
		 document.all( idName ).style.display="block";
		 document.all( idName ).innerHTML=svalue;
	}
	else if ( document.layers )
	{ 
		document.layers[ idName ].display = "block";
		document.layers[ idName ].innerHTML  = svalue;
	}
}

// 地図を消す
function hideMapPop( idName )
{
	if ( document.getElementById )
	{
		document.getElementById( idName ).style.display="none";
	}
	else if ( document.all )
	{
		document.all( idName ).style.display="none";
	}
	else if ( document.layers )
	{
		document.layers[ idName ].display="none";
	}
}

// ズームレベルを渡しながらページを移動する。
function goPhotopage(url, hash)
{
	location.href=url+"?"+map.getZoom()+hash;
}
