// 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.20547,139.0394));
	points.push(new GLatLng(35.20548,139.0392));
	points.push(new GLatLng(35.20548,139.0388));
	points.push(new GLatLng(35.20552,139.0386));
	points.push(new GLatLng(35.20553,139.0384));
	points.push(new GLatLng(35.20553,139.0382));
	points.push(new GLatLng(35.20553,139.0379));
	points.push(new GLatLng(35.20553,139.0377));
	points.push(new GLatLng(35.20548,139.0376));
	points.push(new GLatLng(35.20547,139.0374));
	points.push(new GLatLng(35.20532,139.037));
	points.push(new GLatLng(35.20532,139.037));
	points.push(new GLatLng(35.20527,139.0368));
	points.push(new GLatLng(35.2052,139.0367));
	points.push(new GLatLng(35.20507,139.0365));
	points.push(new GLatLng(35.20503,139.0365));
	points.push(new GLatLng(35.20503,139.0363));
	points.push(new GLatLng(35.20507,139.0363));
	points.push(new GLatLng(35.20522,139.0362));
	points.push(new GLatLng(35.20532,139.0362));
	points.push(new GLatLng(35.2054,139.0363));
	points.push(new GLatLng(35.20548,139.0363));
	points.push(new GLatLng(35.20567,139.0363));
	points.push(new GLatLng(35.20576,139.0364));
	points.push(new GLatLng(35.20583,139.0363));
	points.push(new GLatLng(35.20588,139.0363));
	points.push(new GLatLng(35.2059,139.0361));
	points.push(new GLatLng(35.2059,139.036));
	points.push(new GLatLng(35.20588,139.0359));
	points.push(new GLatLng(35.20585,139.0358));
	points.push(new GLatLng(35.20575,139.0355));
	points.push(new GLatLng(35.2057,139.0353));
	points.push(new GLatLng(35.20567,139.0352));
	points.push(new GLatLng(35.20564,139.035));
	points.push(new GLatLng(35.20558,139.0348));
	points.push(new GLatLng(35.20557,139.0347));
	points.push(new GLatLng(35.20553,139.0347));
	points.push(new GLatLng(35.20548,139.0347));
	points.push(new GLatLng(35.20547,139.0347));
	points.push(new GLatLng(35.2054,139.0346));
	points.push(new GLatLng(35.2054,139.0345));
	points.push(new GLatLng(35.20538,139.0344));
	points.push(new GLatLng(35.20535,139.0342));
	points.push(new GLatLng(35.20532,139.0341));
	points.push(new GLatLng(35.20527,139.034));
	points.push(new GLatLng(35.20522,139.0339));
	points.push(new GLatLng(35.20513,139.0337));
	points.push(new GLatLng(35.20512,139.0335));
	points.push(new GLatLng(35.20508,139.0334));
	points.push(new GLatLng(35.20507,139.0333));
	points.push(new GLatLng(35.20502,139.033));
	points.push(new GLatLng(35.205,139.0329));
	points.push(new GLatLng(35.20495,139.0327));
	points.push(new GLatLng(35.20495,139.0326));
	points.push(new GLatLng(35.20495,139.0323));
	points.push(new GLatLng(35.205,139.0323));
	points.push(new GLatLng(35.20503,139.0322));
	points.push(new GLatLng(35.20508,139.0321));
	points.push(new GLatLng(35.20517,139.032));
	points.push(new GLatLng(35.20517,139.032));
	points.push(new GLatLng(35.20522,139.032));
	points.push(new GLatLng(35.20533,139.032));
	points.push(new GLatLng(35.2054,139.0319));
	points.push(new GLatLng(35.20547,139.0319));
	points.push(new GLatLng(35.20553,139.0319));
	points.push(new GLatLng(35.2057,139.0319));
	points.push(new GLatLng(35.2058,139.0319));
	points.push(new GLatLng(35.2059,139.032));
	points.push(new GLatLng(35.20598,139.032));
	points.push(new GLatLng(35.20612,139.0322));
	points.push(new GLatLng(35.2062,139.0323));
	points.push(new GLatLng(35.20628,139.0323));
	points.push(new GLatLng(35.20635,139.0324));
	points.push(new GLatLng(35.20653,139.0324));
	points.push(new GLatLng(35.20662,139.0324));
	points.push(new GLatLng(35.20667,139.0323));
	points.push(new GLatLng(35.20675,139.0322));
	points.push(new GLatLng(35.20687,139.032));
	points.push(new GLatLng(35.20693,139.0318));
	points.push(new GLatLng(35.20705,139.0318));
	points.push(new GLatLng(35.20718,139.0317));
	points.push(new GLatLng(35.20743,139.0317));
	points.push(new GLatLng(35.20757,139.0317));
	points.push(new GLatLng(35.20768,139.0316));
	points.push(new GLatLng(35.20788,139.0315));
	points.push(new GLatLng(35.20797,139.0314));
	points.push(new GLatLng(35.20805,139.0313));
	points.push(new GLatLng(35.20813,139.0311));
	points.push(new GLatLng(35.2082,139.031));
	points.push(new GLatLng(35.20832,139.0307));
	points.push(new GLatLng(35.20838,139.0306));
	points.push(new GLatLng(35.20842,139.0305));
	points.push(new GLatLng(35.20847,139.0303));
	points.push(new GLatLng(35.2086,139.0301));
	points.push(new GLatLng(35.20865,139.03));
	points.push(new GLatLng(35.20865,139.0298));
	points.push(new GLatLng(35.20863,139.0297));
	points.push(new GLatLng(35.20852,139.0295));
	points.push(new GLatLng(35.20847,139.0295));
	points.push(new GLatLng(35.20837,139.0294));
	points.push(new GLatLng(35.20827,139.0293));
	points.push(new GLatLng(35.20805,139.0292));
	points.push(new GLatLng(35.20795,139.0292));
	points.push(new GLatLng(35.20785,139.0291));
	points.push(new GLatLng(35.20777,139.0291));
	points.push(new GLatLng(35.20758,139.0289));
	points.push(new GLatLng(35.2075,139.0288));
	points.push(new GLatLng(35.20743,139.0287));
	points.push(new GLatLng(35.20737,139.0286));
	points.push(new GLatLng(35.20723,139.0284));
	points.push(new GLatLng(35.2071,139.0282));
	points.push(new GLatLng(35.2071,139.0282));
	points.push(new GLatLng(35.207,139.028));
	points.push(new GLatLng(35.20683,139.0278));
	points.push(new GLatLng(35.20675,139.0277));
	points.push(new GLatLng(35.20667,139.0276));
	points.push(new GLatLng(35.20658,139.0274));
	points.push(new GLatLng(35.20642,139.0272));
	points.push(new GLatLng(35.20633,139.0271));
	points.push(new GLatLng(35.20625,139.0269));
	points.push(new GLatLng(35.20615,139.0268));
	points.push(new GLatLng(35.206,139.0266));
	points.push(new GLatLng(35.20595,139.0264));
	points.push(new GLatLng(35.2059,139.0263));
	points.push(new GLatLng(35.2059,139.0262));
	points.push(new GLatLng(35.20597,139.0259));
	points.push(new GLatLng(35.20602,139.0258));
	points.push(new GLatLng(35.20609,139.0256));
	points.push(new GLatLng(35.20615,139.0255));
	points.push(new GLatLng(35.20632,139.0251));
	points.push(new GLatLng(35.20645,139.0249));
	points.push(new GLatLng(35.20645,139.0249));
	points.push(new GLatLng(35.20652,139.0247));
	points.push(new GLatLng(35.20665,139.0244));
	points.push(new GLatLng(35.2067,139.0243));
	points.push(new GLatLng(35.20677,139.0241));
	points.push(new GLatLng(35.20683,139.024));
	points.push(new GLatLng(35.20695,139.0237));
	points.push(new GLatLng(35.20704,139.0235));
	points.push(new GLatLng(35.20712,139.0234));
	points.push(new GLatLng(35.20718,139.0232));
	points.push(new GLatLng(35.20733,139.0229));
	points.push(new GLatLng(35.2074,139.0227));
	points.push(new GLatLng(35.20745,139.0225));
	points.push(new GLatLng(35.20752,139.0224));
	points.push(new GLatLng(35.20765,139.022));
	points.push(new GLatLng(35.20773,139.0219));
	points.push(new GLatLng(35.20782,139.0218));
	points.push(new GLatLng(35.20792,139.0217));
	points.push(new GLatLng(35.20822,139.0219));
	points.push(new GLatLng(35.20835,139.022));
	points.push(new GLatLng(35.20848,139.022));
	points.push(new GLatLng(35.20862,139.022));
	points.push(new GLatLng(35.20887,139.0218));
	points.push(new GLatLng(35.20907,139.0215));
	points.push(new GLatLng(35.20907,139.0215));
	points.push(new GLatLng(35.20915,139.0213));
	points.push(new GLatLng(35.20933,139.021));
	points.push(new GLatLng(35.20942,139.0208));
	points.push(new GLatLng(35.2095,139.0207));
	points.push(new GLatLng(35.20958,139.0205));
	points.push(new GLatLng(35.20973,139.0202));
	points.push(new GLatLng(35.2098,139.02));
	points.push(new GLatLng(35.20987,139.0198));
	points.push(new GLatLng(35.20997,139.0197));
	points.push(new GLatLng(35.21017,139.0194));
	points.push(new GLatLng(35.21029,139.0193));
	points.push(new GLatLng(35.21041,139.0192));
	points.push(new GLatLng(35.21057,139.0192));
	points.push(new GLatLng(35.21087,139.0191));
	points.push(new GLatLng(35.21102,139.0191));
	points.push(new GLatLng(35.21117,139.0191));
	points.push(new GLatLng(35.21132,139.0191));
	points.push(new GLatLng(35.21192,139.019));
	points.push(new GLatLng(35.21192,139.019));
	points.push(new GLatLng(35.21205,139.019));
	points.push(new GLatLng(35.2122,139.0189));
	points.push(new GLatLng(35.2124,139.0188));
	points.push(new GLatLng(35.21257,139.0187));
	points.push(new GLatLng(35.21238,139.0191));
	points.push(new GLatLng(35.2103,139.0161));
	points.push(new GLatLng(35.21052,139.0157));
	points.push(new GLatLng(35.21052,139.0157));
	points.push(new GLatLng(35.21065,139.0155));
	points.push(new GLatLng(35.21088,139.0154));
	points.push(new GLatLng(35.21095,139.0154));
	points.push(new GLatLng(35.211,139.0153));
	points.push(new GLatLng(35.21105,139.0153));
	points.push(new GLatLng(35.21118,139.0152));
	points.push(new GLatLng(35.21128,139.0152));
	points.push(new GLatLng(35.21138,139.0151));
	points.push(new GLatLng(35.2115,139.015));
	points.push(new GLatLng(35.21173,139.0149));
	points.push(new GLatLng(35.21185,139.0149));
	points.push(new GLatLng(35.21197,139.0148));
	points.push(new GLatLng(35.21208,139.0148));
	points.push(new GLatLng(35.21232,139.0146));
	points.push(new GLatLng(35.21243,139.0146));
	points.push(new GLatLng(35.21255,139.0145));
	points.push(new GLatLng(35.21267,139.0145));
	points.push(new GLatLng(35.21293,139.0144));
	points.push(new GLatLng(35.21323,139.0145));
	points.push(new GLatLng(35.21323,139.0145));
	points.push(new GLatLng(35.21335,139.0146));
	points.push(new GLatLng(35.21362,139.0148));
	points.push(new GLatLng(35.21373,139.0149));
	points.push(new GLatLng(35.21385,139.015));
	points.push(new GLatLng(35.21398,139.0151));
	points.push(new GLatLng(35.21423,139.0153));
	points.push(new GLatLng(35.21438,139.0153));
	points.push(new GLatLng(35.21452,139.0153));
	points.push(new GLatLng(35.21463,139.0152));
	points.push(new GLatLng(35.21482,139.015));
	points.push(new GLatLng(35.21488,139.0149));
	points.push(new GLatLng(35.21493,139.0148));
	points.push(new GLatLng(35.21498,139.0146));
	points.push(new GLatLng(35.21505,139.0143));
	points.push(new GLatLng(35.2151,139.0141));
	points.push(new GLatLng(35.21513,139.0139));
	points.push(new GLatLng(35.21518,139.0137));
	points.push(new GLatLng(35.21528,139.0134));
	points.push(new GLatLng(35.21535,139.0132));
	points.push(new GLatLng(35.21544,139.0131));
	points.push(new GLatLng(35.21553,139.013));
	points.push(new GLatLng(35.21598,139.013));
	points.push(new GLatLng(35.21598,139.013));
	points.push(new GLatLng(35.21612,139.013));
	points.push(new GLatLng(35.21627,139.013));
	points.push(new GLatLng(35.21657,139.013));
	points.push(new GLatLng(35.2167,139.013));
	points.push(new GLatLng(35.21684,139.0129));
	points.push(new GLatLng(35.2171,139.0128));
	points.push(new GLatLng(35.21723,139.0127));
	points.push(new GLatLng(35.21737,139.0126));
	points.push(new GLatLng(35.2175,139.0125));
	points.push(new GLatLng(35.2176,139.0124));
	points.push(new GLatLng(35.2178,139.0122));
	points.push(new GLatLng(35.2179,139.0121));
	points.push(new GLatLng(35.218,139.012));
	points.push(new GLatLng(35.21807,139.0118));
	points.push(new GLatLng(35.21828,139.0116));
	points.push(new GLatLng(35.21838,139.0114));
	points.push(new GLatLng(35.21847,139.0113));
	points.push(new GLatLng(35.21853,139.0111));
	points.push(new GLatLng(35.2186,139.0108));
	points.push(new GLatLng(35.2186,139.0106));
	points.push(new GLatLng(35.2186,139.0104));
	points.push(new GLatLng(35.2186,139.0102));
	points.push(new GLatLng(35.21847,139.0096));
	points.push(new GLatLng(35.21847,139.0096));
	points.push(new GLatLng(35.21843,139.0095));
	points.push(new GLatLng(35.21838,139.0093));
	points.push(new GLatLng(35.21825,139.009));
	points.push(new GLatLng(35.21815,139.0089));
	points.push(new GLatLng(35.21805,139.0087));
	points.push(new GLatLng(35.21797,139.0086));
	points.push(new GLatLng(35.21778,139.0083));
	points.push(new GLatLng(35.21768,139.0082));
	points.push(new GLatLng(35.2176,139.0081));
	points.push(new GLatLng(35.21752,139.0079));
	points.push(new GLatLng(35.21735,139.0076));
	points.push(new GLatLng(35.21732,139.0075));
	points.push(new GLatLng(35.21727,139.0074));
	points.push(new GLatLng(35.21725,139.0072));
	points.push(new GLatLng(35.21722,139.0069));
	points.push(new GLatLng(35.2172,139.0067));
	points.push(new GLatLng(35.2172,139.0066));
	points.push(new GLatLng(35.21725,139.0063));
	points.push(new GLatLng(35.21732,139.0061));
	points.push(new GLatLng(35.21738,139.006));
	points.push(new GLatLng(35.21748,139.0059));
	points.push(new GLatLng(35.2176,139.0058));
	points.push(new GLatLng(35.21783,139.0057));
	points.push(new GLatLng(35.21798,139.0056));
	points.push(new GLatLng(35.21812,139.0056));
	points.push(new GLatLng(35.21825,139.0055));
	points.push(new GLatLng(35.21855,139.0055));
	points.push(new GLatLng(35.2187,139.0055));
	points.push(new GLatLng(35.21885,139.0056));
	points.push(new GLatLng(35.219,139.0056));
	points.push(new GLatLng(35.21932,139.0057));
	points.push(new GLatLng(35.21947,139.0057));
	points.push(new GLatLng(35.21964,139.0057));
	points.push(new GLatLng(35.21995,139.0056));
	points.push(new GLatLng(35.2201,139.0056));
	points.push(new GLatLng(35.22025,139.0056));
	points.push(new GLatLng(35.22042,139.0056));
	points.push(new GLatLng(35.2206,139.0056));
	points.push(new GLatLng(35.22092,139.0055));
	points.push(new GLatLng(35.22107,139.0056));
	points.push(new GLatLng(35.2212,139.0056));
	points.push(new GLatLng(35.22133,139.0057));
	points.push(new GLatLng(35.22158,139.0059));
	points.push(new GLatLng(35.22173,139.006));
	points.push(new GLatLng(35.22188,139.0062));
	points.push(new GLatLng(35.22203,139.0063));
	points.push(new GLatLng(35.22237,139.0065));
	points.push(new GLatLng(35.22272,139.0066));
	points.push(new GLatLng(35.22272,139.0066));
	points.push(new GLatLng(35.22287,139.0066));
	points.push(new GLatLng(35.22313,139.0065));
	points.push(new GLatLng(35.22327,139.0064));
	points.push(new GLatLng(35.22333,139.0063));
	points.push(new GLatLng(35.2234,139.0061));
	points.push(new GLatLng(35.22352,139.0058));
	points.push(new GLatLng(35.22355,139.0055));
	points.push(new GLatLng(35.22362,139.0054));
	points.push(new GLatLng(35.22365,139.0051));
	points.push(new GLatLng(35.22377,139.0047));
	points.push(new GLatLng(35.22382,139.0045));
	points.push(new GLatLng(35.22387,139.0044));
	points.push(new GLatLng(35.22393,139.0042));
	points.push(new GLatLng(35.2241,139.004));
	points.push(new GLatLng(35.2242,139.0039));
	points.push(new GLatLng(35.22435,139.0039));
	points.push(new GLatLng(35.22448,139.0038));
	points.push(new GLatLng(35.22475,139.0038));
	points.push(new GLatLng(35.2249,139.0038));
	points.push(new GLatLng(35.22503,139.0038));
	points.push(new GLatLng(35.22515,139.0038));
	points.push(new GLatLng(35.22548,139.004));
	points.push(new GLatLng(35.2256,139.0042));
	points.push(new GLatLng(35.2257,139.0042));
	points.push(new GLatLng(35.22583,139.0043));
	points.push(new GLatLng(35.22607,139.0043));
	points.push(new GLatLng(35.22618,139.0043));
	points.push(new GLatLng(35.22628,139.0042));
	points.push(new GLatLng(35.2264,139.0041));
	points.push(new GLatLng(35.22662,139.0038));
	points.push(new GLatLng(35.22673,139.0036));
	points.push(new GLatLng(35.22687,139.0035));
	points.push(new GLatLng(35.22697,139.0033));
	points.push(new GLatLng(35.22718,139.0031));
	points.push(new GLatLng(35.22728,139.0029));
	points.push(new GLatLng(35.2274,139.0029));
	points.push(new GLatLng(35.22753,139.0028));
	points.push(new GLatLng(35.22777,139.0027));
	points.push(new GLatLng(35.22788,139.0027));
	points.push(new GLatLng(35.22798,139.0026));
	points.push(new GLatLng(35.22807,139.0025));
	points.push(new GLatLng(35.22818,139.0024));
	points.push(new GLatLng(35.22823,139.0024));
	points.push(new GLatLng(35.22822,139.0022));
	points.push(new GLatLng(35.22803,139.0021));
	points.push(new GLatLng(35.22762,139.0017));
	points.push(new GLatLng(35.22755,139.0016));
	points.push(new GLatLng(35.2275,139.0014));
	points.push(new GLatLng(35.22748,139.0013));
	points.push(new GLatLng(35.22757,139.0009));
	points.push(new GLatLng(35.22762,139.0008));
	points.push(new GLatLng(35.22766,139.0006));
	points.push(new GLatLng(35.22775,139.0004));
	points.push(new GLatLng(35.2279,139.0001));
	points.push(new GLatLng(35.228,138.9999));
	points.push(new GLatLng(35.22808,138.9998));
	points.push(new GLatLng(35.22817,138.9996));
	points.push(new GLatLng(35.22832,138.9993));
	points.push(new GLatLng(35.2285,138.9991));
	points.push(new GLatLng(35.2285,138.9991));
	points.push(new GLatLng(35.2286,138.999));
	points.push(new GLatLng(35.2288,138.9988));
	points.push(new GLatLng(35.22892,138.9987));
	points.push(new GLatLng(35.22902,138.9986));
	points.push(new GLatLng(35.22915,138.9984));
	points.push(new GLatLng(35.2294,138.9982));
	points.push(new GLatLng(35.22953,138.9981));
	points.push(new GLatLng(35.22967,138.998));
	points.push(new GLatLng(35.22978,138.998));
	points.push(new GLatLng(35.23005,138.9979));
	points.push(new GLatLng(35.2302,138.998));
	points.push(new GLatLng(35.23037,138.9981));
	points.push(new GLatLng(35.23053,138.9982));
	points.push(new GLatLng(35.23083,138.9983));
	points.push(new GLatLng(35.23098,138.9983));
	points.push(new GLatLng(35.23132,138.9984));
	points.push(new GLatLng(35.23132,138.9984));
	points.push(new GLatLng(35.23168,138.9985));
	points.push(new GLatLng(35.23183,138.9986));
	points.push(new GLatLng(35.23197,138.9987));
	points.push(new GLatLng(35.2321,138.9988));
	points.push(new GLatLng(35.23233,138.999));
	points.push(new GLatLng(35.23247,138.9991));
	points.push(new GLatLng(35.23258,138.9992));
	points.push(new GLatLng(35.23272,138.9993));
	points.push(new GLatLng(35.23298,138.9995));
	points.push(new GLatLng(35.2331,138.9996));
	points.push(new GLatLng(35.23322,138.9997));
	points.push(new GLatLng(35.23332,138.9997));
	points.push(new GLatLng(35.23362,138.9998));
	points.push(new GLatLng(35.23375,138.9998));
	points.push(new GLatLng(35.23382,138.9996));
	points.push(new GLatLng(35.23402,138.9993));
	points.push(new GLatLng(35.23417,138.9993));
	points.push(new GLatLng(35.2343,138.9993));
	points.push(new GLatLng(35.23445,138.9993));
	points.push(new GLatLng(35.23458,138.9994));
	points.push(new GLatLng(35.23482,138.9996));
	points.push(new GLatLng(35.23492,138.9998));
	points.push(new GLatLng(35.23502,138.9999));
	points.push(new GLatLng(35.23508,139));
	points.push(new GLatLng(35.2352,139.0004));
	points.push(new GLatLng(35.23525,139.0005));
	points.push(new GLatLng(35.23528,139.0007));
	points.push(new GLatLng(35.23535,139.0009));
	points.push(new GLatLng(35.2355,139.0011));
	points.push(new GLatLng(35.23561,139.0012));
	points.push(new GLatLng(35.23575,139.0013));
	points.push(new GLatLng(35.2359,139.0014));
	points.push(new GLatLng(35.23618,139.0016));
	points.push(new GLatLng(35.23632,139.0016));
	points.push(new GLatLng(35.23643,139.0018));
	points.push(new GLatLng(35.23655,139.0018));
	points.push(new GLatLng(35.23678,139.002));
	points.push(new GLatLng(35.23689,139.002));
	points.push(new GLatLng(35.23698,139.002));
	points.push(new GLatLng(35.23703,139.0021));
	points.push(new GLatLng(35.2371,139.0023));
	points.push(new GLatLng(35.23713,139.0023));
	points.push(new GLatLng(35.23718,139.0024));
	points.push(new GLatLng(35.23725,139.0025));
	points.push(new GLatLng(35.23742,139.0026));
	points.push(new GLatLng(35.23753,139.0026));
	points.push(new GLatLng(35.23765,139.0026));
	points.push(new GLatLng(35.23777,139.0025));
	points.push(new GLatLng(35.23807,139.0025));
	points.push(new GLatLng(35.2382,139.0025));
	points.push(new GLatLng(35.23835,139.0025));
	points.push(new GLatLng(35.2385,139.0025));
	points.push(new GLatLng(35.23878,139.0023));
	points.push(new GLatLng(35.23907,139.0022));
	points.push(new GLatLng(35.2392,139.0021));
	points.push(new GLatLng(35.2396,139.0018));
	points.push(new GLatLng(35.2396,139.0018));
	points.push(new GLatLng(35.23975,139.0018));
	points.push(new GLatLng(35.23988,139.0017));
	points.push(new GLatLng(35.24015,139.0016));
	points.push(new GLatLng(35.2403,139.0016));
	points.push(new GLatLng(35.24043,139.0015));
	points.push(new GLatLng(35.24057,139.0015));
	points.push(new GLatLng(35.24077,139.0014));
	points.push(new GLatLng(35.24088,139.0014));
	points.push(new GLatLng(35.24095,139.0014));
	points.push(new GLatLng(35.24102,139.0015));
	points.push(new GLatLng(35.24107,139.0017));
	points.push(new GLatLng(35.24105,139.0018));
	points.push(new GLatLng(35.24098,139.0019));
	points.push(new GLatLng(35.24092,139.002));
	points.push(new GLatLng(35.24075,139.0022));
	points.push(new GLatLng(35.24065,139.0023));
	points.push(new GLatLng(35.24057,139.0024));
	points.push(new GLatLng(35.24048,139.0025));
	points.push(new GLatLng(35.2403,139.0028));
	points.push(new GLatLng(35.24022,139.0029));
	points.push(new GLatLng(35.24012,139.003));
	points.push(new GLatLng(35.24003,139.0031));
	points.push(new GLatLng(35.23987,139.0034));
	points.push(new GLatLng(35.23981,139.0035));
	points.push(new GLatLng(35.23981,139.0037));
	points.push(new GLatLng(35.23987,139.0038));
	points.push(new GLatLng(35.24012,139.0038));
	points.push(new GLatLng(35.24023,139.0038));
	points.push(new GLatLng(35.24038,139.0037));
	points.push(new GLatLng(35.24055,139.0037));
	points.push(new GLatLng(35.24087,139.0037));
	points.push(new GLatLng(35.24102,139.0037));
	points.push(new GLatLng(35.24112,139.0037));
	points.push(new GLatLng(35.24118,139.0038));
	points.push(new GLatLng(35.24123,139.004));
	points.push(new GLatLng(35.2412,139.004));
	points.push(new GLatLng(35.24113,139.0041));
	points.push(new GLatLng(35.24103,139.0042));
	points.push(new GLatLng(35.24083,139.0043));
	points.push(new GLatLng(35.24073,139.0044));
	points.push(new GLatLng(35.24062,139.0045));
	points.push(new GLatLng(35.2405,139.0046));
	points.push(new GLatLng(35.2403,139.0049));
	points.push(new GLatLng(35.24018,139.005));
	points.push(new GLatLng(35.24005,139.0052));
	points.push(new GLatLng(35.24005,139.0052));
	points.push(new GLatLng(35.24012,139.0055));
	points.push(new GLatLng(35.24018,139.0056));
	points.push(new GLatLng(35.2403,139.0056));
	points.push(new GLatLng(35.2404,139.0056));
	points.push(new GLatLng(35.2407,139.0056));
	points.push(new GLatLng(35.24087,139.0055));
	points.push(new GLatLng(35.241,139.0055));
	points.push(new GLatLng(35.24115,139.0054));
	points.push(new GLatLng(35.2414,139.0054));
	points.push(new GLatLng(35.24154,139.0054));
	points.push(new GLatLng(35.24163,139.0054));
	points.push(new GLatLng(35.2417,139.0055));
	points.push(new GLatLng(35.24177,139.0057));
	points.push(new GLatLng(35.24178,139.0058));
	points.push(new GLatLng(35.2418,139.006));
	points.push(new GLatLng(35.2418,139.0061));
	points.push(new GLatLng(35.24188,139.0064));
	points.push(new GLatLng(35.24195,139.0065));
	points.push(new GLatLng(35.24203,139.0066));
	points.push(new GLatLng(35.2421,139.0067));
	points.push(new GLatLng(35.24227,139.007));
	points.push(new GLatLng(35.24235,139.0072));
	points.push(new GLatLng(35.24243,139.0073));
	points.push(new GLatLng(35.24253,139.0074));
	points.push(new GLatLng(35.24285,139.0077));
	points.push(new GLatLng(35.24295,139.0079));
	points.push(new GLatLng(35.24305,139.008));
	points.push(new GLatLng(35.24328,139.0082));
	points.push(new GLatLng(35.24342,139.0083));
	points.push(new GLatLng(35.24353,139.0085));
	points.push(new GLatLng(35.24365,139.0086));
	points.push(new GLatLng(35.24385,139.0088));
	points.push(new GLatLng(35.24392,139.0089));
	points.push(new GLatLng(35.244,139.0091));
	points.push(new GLatLng(35.24405,139.0092));
	points.push(new GLatLng(35.24425,139.0094));
	points.push(new GLatLng(35.24437,139.0095));
	points.push(new GLatLng(35.24448,139.0095));
	points.push(new GLatLng(35.24462,139.0096));
	points.push(new GLatLng(35.2449,139.0096));
	points.push(new GLatLng(35.24505,139.0095));
	points.push(new GLatLng(35.24518,139.0095));
	points.push(new GLatLng(35.24533,139.0094));
	points.push(new GLatLng(35.24563,139.0093));
	points.push(new GLatLng(35.24578,139.0093));
	points.push(new GLatLng(35.24592,139.0092));
	points.push(new GLatLng(35.24605,139.0092));
	points.push(new GLatLng(35.2463,139.0092));
	points.push(new GLatLng(35.24642,139.0093));
	points.push(new GLatLng(35.24653,139.0094));
	points.push(new GLatLng(35.24662,139.0095));
	points.push(new GLatLng(35.2468,139.0097));
	points.push(new GLatLng(35.24688,139.0098));
	points.push(new GLatLng(35.24697,139.0099));
	points.push(new GLatLng(35.24705,139.0101));
	points.push(new GLatLng(35.24723,139.0103));
	points.push(new GLatLng(35.24733,139.0104));
	points.push(new GLatLng(35.24745,139.0105));
	points.push(new GLatLng(35.24757,139.0106));
	points.push(new GLatLng(35.24782,139.0107));
	points.push(new GLatLng(35.24865,139.011));
	points.push(new GLatLng(35.24878,139.011));
	points.push(new GLatLng(35.24892,139.011));
	points.push(new GLatLng(35.2492,139.0109));
	points.push(new GLatLng(35.24935,139.0109));
	points.push(new GLatLng(35.24949,139.0108));
	points.push(new GLatLng(35.24963,139.0107));
	points.push(new GLatLng(35.24988,139.0106));
	points.push(new GLatLng(35.25,139.0107));
	points.push(new GLatLng(35.25012,139.0107));
	points.push(new GLatLng(35.25022,139.0107));
	points.push(new GLatLng(35.25025,139.0109));
	points.push(new GLatLng(35.25018,139.0111));
	points.push(new GLatLng(35.2501,139.0112));
	points.push(new GLatLng(35.24998,139.0113));


	// 表示の中心位置・サイズを算出します。
	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;
}
