// Generated by trk2googlemaps and kml ( http://etoh.minidns.net/gps/ )
// 本コードはtrk2googlemaps and kmlによって自動生成されました。
numofwaypoints=0;
posofwaypoints=0;
numofphotos=13;
posofphotos=0;
waypoint_markers = [];
waypoint_infos   = [];
photo_markers    = [];
photo_infos      = [];
var points = [];
var map;
var currentzoom;
var key = "ABQIAAAAvjZd_JDk5wPw86UfmaYAdxS-3qfp1sLmxQ-OAHtUVe1j7exPahRehzrtMXbZmWx3qkc6fD6RJ8-O8Q";
var movemarkerIcon;
   
// グラフマウスオーバ用のJavaScript
if (document.images)
{
	// 時刻－高度
	var alt = new Image();
	alt.src = "oldnow.files/time-alt.png";

	// 時刻－距離
	var dist = new Image();
	dist.src = "oldnow.files/time-dst.png";

	// 時刻－速度
	var speed = new Image();
	speed.src = "oldnow.files/time-speed.png";
}

// マウスオーバ時
function On(name) 
{
	if (document.images) 
	{
		document.images['graphimage'].src = eval(name + '.src');
	}
}

// ウェイポイント表示用関数
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.84794,139.6297));
	points.push(new GLatLng(35.84736,139.6285));
	points.push(new GLatLng(35.84658,139.6266));
	points.push(new GLatLng(35.84684,139.6257));
	points.push(new GLatLng(35.84818,139.6253));
	points.push(new GLatLng(35.85532,139.6229));
	points.push(new GLatLng(35.86158,139.6208));
	points.push(new GLatLng(35.87349,139.6196));
	points.push(new GLatLng(35.87551,139.6189));
	points.push(new GLatLng(35.88382,139.6154));
	points.push(new GLatLng(35.8845,139.6151));
	points.push(new GLatLng(35.88555,139.6146));
	points.push(new GLatLng(35.88733,139.6137));
	points.push(new GLatLng(35.88993,139.6125));
	points.push(new GLatLng(35.89426,139.6078));
	points.push(new GLatLng(35.89497,139.6068));
	points.push(new GLatLng(35.89809,139.6026));
	points.push(new GLatLng(35.90459,139.5973));
	points.push(new GLatLng(35.9051,139.5971));
	points.push(new GLatLng(35.90765,139.5953));
	points.push(new GLatLng(35.90888,139.5945));
	points.push(new GLatLng(35.91092,139.5937));
	points.push(new GLatLng(35.91853,139.5929));
	points.push(new GLatLng(35.9198,139.5928));
	points.push(new GLatLng(35.92448,139.5925));
	points.push(new GLatLng(35.92622,139.5921));
	points.push(new GLatLng(35.92647,139.5902));
	points.push(new GLatLng(35.92568,139.5884));
	points.push(new GLatLng(35.92495,139.5854));
	points.push(new GLatLng(35.9251,139.5854));
	points.push(new GLatLng(35.93106,139.5944));
	points.push(new GLatLng(35.9362,139.5988));
	points.push(new GLatLng(35.94019,139.6022));
	points.push(new GLatLng(35.94252,139.6042));
	points.push(new GLatLng(35.94456,139.6059));
	points.push(new GLatLng(35.9465,139.6075));
	points.push(new GLatLng(35.95302,139.608));
	points.push(new GLatLng(35.95396,139.6084));
	points.push(new GLatLng(35.95456,139.6098));
	points.push(new GLatLng(35.9577,139.6202));
	points.push(new GLatLng(35.95787,139.621));
	points.push(new GLatLng(35.95795,139.6212));
	points.push(new GLatLng(35.9581,139.6221));
	points.push(new GLatLng(35.95967,139.6258));
	points.push(new GLatLng(35.96027,139.6266));
	points.push(new GLatLng(35.96113,139.6278));
	points.push(new GLatLng(35.9622,139.6293));
	points.push(new GLatLng(35.96748,139.6329));
	points.push(new GLatLng(35.97531,139.6382));
	points.push(new GLatLng(35.97771,139.6398));
	points.push(new GLatLng(35.97877,139.6405));
	points.push(new GLatLng(35.97945,139.641));
	points.push(new GLatLng(35.98027,139.6417));
	points.push(new GLatLng(35.98215,139.6431));
	points.push(new GLatLng(35.98387,139.6445));
	points.push(new GLatLng(35.98469,139.6451));
	points.push(new GLatLng(35.98868,139.6481));
	points.push(new GLatLng(35.99005,139.6492));
	points.push(new GLatLng(35.99164,139.6504));
	points.push(new GLatLng(35.99409,139.6523));
	points.push(new GLatLng(35.99759,139.6549));
	points.push(new GLatLng(35.999,139.6555));
	points.push(new GLatLng(36.01559,139.6536));
	points.push(new GLatLng(36.02241,139.6528));
	points.push(new GLatLng(36.03093,139.6516));
	points.push(new GLatLng(36.03228,139.6515));
	points.push(new GLatLng(36.04565,139.6555));
	points.push(new GLatLng(36.04685,139.6558));
	points.push(new GLatLng(36.05619,139.6576));
	points.push(new GLatLng(36.06254,139.6588));
	points.push(new GLatLng(36.0685,139.6601));
	points.push(new GLatLng(36.07009,139.6609));
	points.push(new GLatLng(36.07794,139.6676));
	points.push(new GLatLng(36.0782,139.6678));
	points.push(new GLatLng(36.08131,139.6705));
	points.push(new GLatLng(36.08638,139.6749));
	points.push(new GLatLng(36.08863,139.6761));
	points.push(new GLatLng(36.09314,139.6757));
	points.push(new GLatLng(36.09434,139.6755));
	points.push(new GLatLng(36.09758,139.6749));
	points.push(new GLatLng(36.09842,139.6747));
	points.push(new GLatLng(36.0988,139.6747));
	points.push(new GLatLng(36.09987,139.6745));
	points.push(new GLatLng(36.10425,139.6733));
	points.push(new GLatLng(36.10747,139.6721));
	points.push(new GLatLng(36.10917,139.6719));
	points.push(new GLatLng(36.1109,139.6723));
	points.push(new GLatLng(36.11408,139.6732));
	points.push(new GLatLng(36.11625,139.6739));
	points.push(new GLatLng(36.11822,139.675));
	points.push(new GLatLng(36.11914,139.6768));
	points.push(new GLatLng(36.11998,139.6788));
	points.push(new GLatLng(36.12024,139.6794));
	points.push(new GLatLng(36.12077,139.6803));
	points.push(new GLatLng(36.12178,139.682));
	points.push(new GLatLng(36.12311,139.6842));
	points.push(new GLatLng(36.1238,139.6853));
	points.push(new GLatLng(36.12401,139.6857));
	points.push(new GLatLng(36.12483,139.688));
	points.push(new GLatLng(36.12517,139.6909));
	points.push(new GLatLng(36.12929,139.6998));
	points.push(new GLatLng(36.13008,139.7013));
	points.push(new GLatLng(36.13062,139.7023));
	points.push(new GLatLng(36.13118,139.7034));
	points.push(new GLatLng(36.13268,139.7063));
	points.push(new GLatLng(36.13307,139.7071));
	points.push(new GLatLng(36.13442,139.7069));
	points.push(new GLatLng(36.14083,139.704));
	points.push(new GLatLng(36.14193,139.7035));
	points.push(new GLatLng(36.14253,139.7039));
	points.push(new GLatLng(36.14337,139.7052));
	points.push(new GLatLng(36.14517,139.708));
	points.push(new GLatLng(36.14691,139.7107));
	points.push(new GLatLng(36.14712,139.711));
	points.push(new GLatLng(36.14832,139.7145));
	points.push(new GLatLng(36.14893,139.7158));
	points.push(new GLatLng(36.15075,139.721));
	points.push(new GLatLng(36.15096,139.722));
	points.push(new GLatLng(36.1512,139.7247));
	points.push(new GLatLng(36.15455,139.7346));
	points.push(new GLatLng(36.15892,139.7471));
	points.push(new GLatLng(36.15981,139.7527));
	points.push(new GLatLng(36.16013,139.7546));
	points.push(new GLatLng(36.16075,139.7557));
	points.push(new GLatLng(36.16143,139.7569));
	points.push(new GLatLng(36.1618,139.7576));
	points.push(new GLatLng(36.16689,139.7677));
	points.push(new GLatLng(36.1669,139.7682));
	points.push(new GLatLng(36.16682,139.7692));
	points.push(new GLatLng(36.16809,139.7787));
	points.push(new GLatLng(36.16828,139.7795));
	points.push(new GLatLng(36.16993,139.795));
	points.push(new GLatLng(36.17276,139.7983));
	points.push(new GLatLng(36.17289,139.7987));
	points.push(new GLatLng(36.17257,139.8084));
	points.push(new GLatLng(36.17249,139.8086));
	points.push(new GLatLng(36.1689,139.8179));
	points.push(new GLatLng(36.16847,139.8187));
	points.push(new GLatLng(36.16834,139.819));
	points.push(new GLatLng(36.16753,139.8235));
	points.push(new GLatLng(36.16747,139.8238));
	points.push(new GLatLng(36.16734,139.8248));
	points.push(new GLatLng(36.16736,139.8313));
	points.push(new GLatLng(36.16684,139.8339));
	points.push(new GLatLng(36.16682,139.8343));
	points.push(new GLatLng(36.16781,139.8365));
	points.push(new GLatLng(36.16794,139.8366));
	points.push(new GLatLng(36.17045,139.8388));
	points.push(new GLatLng(36.16845,139.851));
	points.push(new GLatLng(36.17075,139.8595));
	points.push(new GLatLng(36.17259,139.8721));
	points.push(new GLatLng(36.17234,139.8737));
	points.push(new GLatLng(36.17169,139.8768));
	points.push(new GLatLng(36.17113,139.8781));
	points.push(new GLatLng(36.17057,139.8794));
	points.push(new GLatLng(36.16822,139.8855));
	points.push(new GLatLng(36.16781,139.8862));
	points.push(new GLatLng(36.16673,139.8871));
	points.push(new GLatLng(36.165,139.8883));
	points.push(new GLatLng(36.16216,139.8916));
	points.push(new GLatLng(36.16167,139.8925));
	points.push(new GLatLng(36.15965,139.8954));
	points.push(new GLatLng(36.15933,139.8957));
	points.push(new GLatLng(36.15834,139.8965));
	points.push(new GLatLng(36.15807,139.8971));
	points.push(new GLatLng(36.1589,139.9027));
	points.push(new GLatLng(36.15953,139.9045));
	points.push(new GLatLng(36.15985,139.9051));
	points.push(new GLatLng(36.16236,139.9108));
	points.push(new GLatLng(36.15957,139.9182));
	points.push(new GLatLng(36.15847,139.9229));
	points.push(new GLatLng(36.15794,139.9232));
	points.push(new GLatLng(36.15547,139.9214));
	points.push(new GLatLng(36.14972,139.9188));
	points.push(new GLatLng(36.14952,139.9186));
	points.push(new GLatLng(36.15193,139.9196));
	points.push(new GLatLng(36.15508,139.9209));
	points.push(new GLatLng(36.15517,139.921));
	points.push(new GLatLng(36.15693,139.9228));
	points.push(new GLatLng(36.15843,139.9229));
	points.push(new GLatLng(36.15871,139.9199));
	points.push(new GLatLng(36.1613,139.9158));
	points.push(new GLatLng(36.16233,139.9115));
	points.push(new GLatLng(36.16227,139.9109));
	points.push(new GLatLng(36.16163,139.9083));
	points.push(new GLatLng(36.16174,139.9079));
	points.push(new GLatLng(36.1618,139.9144));
	points.push(new GLatLng(36.16122,139.9161));
	points.push(new GLatLng(36.16111,139.9163));
	points.push(new GLatLng(36.15871,139.92));
	points.push(new GLatLng(36.15858,139.9218));
	points.push(new GLatLng(36.15852,139.9226));
	points.push(new GLatLng(36.15792,139.9232));
	points.push(new GLatLng(36.15635,139.9224));
	points.push(new GLatLng(36.15538,139.9213));
	points.push(new GLatLng(36.15023,139.9193));
	points.push(new GLatLng(36.15017,139.92));
	points.push(new GLatLng(36.1486,139.92));
	points.push(new GLatLng(36.14888,139.9206));
	points.push(new GLatLng(36.14942,139.9187));
	points.push(new GLatLng(36.14923,139.9181));
	points.push(new GLatLng(36.15706,139.9229));
	points.push(new GLatLng(36.15845,139.9229));
	points.push(new GLatLng(36.15852,139.9219));
	points.push(new GLatLng(36.16109,139.9162));
	points.push(new GLatLng(36.16118,139.916));
	points.push(new GLatLng(36.16094,139.9066));
	points.push(new GLatLng(36.15976,139.9051));
	points.push(new GLatLng(36.15968,139.9049));
	points.push(new GLatLng(36.15918,139.9038));
	points.push(new GLatLng(36.15852,139.9018));
	points.push(new GLatLng(36.15837,139.899));
	points.push(new GLatLng(36.15833,139.8982));
	points.push(new GLatLng(36.15826,139.8966));
	points.push(new GLatLng(36.15929,139.8958));
	points.push(new GLatLng(36.15944,139.8957));
	points.push(new GLatLng(36.16152,139.8927));
	points.push(new GLatLng(36.16233,139.8915));
	points.push(new GLatLng(36.16335,139.89));
	points.push(new GLatLng(36.16393,139.8893));
	points.push(new GLatLng(36.16916,139.8828));
	points.push(new GLatLng(36.17148,139.8769));
	points.push(new GLatLng(36.17167,139.8763));
	points.push(new GLatLng(36.17169,139.8763));
	points.push(new GLatLng(36.17193,139.8751));
	points.push(new GLatLng(36.17195,139.8751));
	points.push(new GLatLng(36.17212,139.874));
	points.push(new GLatLng(36.17242,139.8721));
	points.push(new GLatLng(36.17186,139.8694));
	points.push(new GLatLng(36.17159,139.868));
	points.push(new GLatLng(36.17045,139.8613));
	points.push(new GLatLng(36.17032,139.8568));
	points.push(new GLatLng(36.16884,139.8479));
	points.push(new GLatLng(36.16897,139.8475));
	points.push(new GLatLng(36.17096,139.841));
	points.push(new GLatLng(36.17092,139.8403));
	points.push(new GLatLng(36.17083,139.8399));
	points.push(new GLatLng(36.16768,139.8218));
	points.push(new GLatLng(36.16783,139.8207));
	points.push(new GLatLng(36.16813,139.8194));
	points.push(new GLatLng(36.16888,139.8178));
	points.push(new GLatLng(36.17197,139.8107));
	points.push(new GLatLng(36.17229,139.8092));
	points.push(new GLatLng(36.17309,139.8033));
	points.push(new GLatLng(36.17307,139.8011));
	points.push(new GLatLng(36.17231,139.7974));
	points.push(new GLatLng(36.1721,139.7971));
	points.push(new GLatLng(36.1712,139.7963));
	points.push(new GLatLng(36.16993,139.795));
	points.push(new GLatLng(36.16796,139.7874));
	points.push(new GLatLng(36.16817,139.7825));
	points.push(new GLatLng(36.16815,139.7814));
	points.push(new GLatLng(36.16751,139.7774));
	points.push(new GLatLng(36.16654,139.7709));
	points.push(new GLatLng(36.16678,139.7668));
	points.push(new GLatLng(36.16658,139.7654));
	points.push(new GLatLng(36.16652,139.7652));
	points.push(new GLatLng(36.16141,139.7569));
	points.push(new GLatLng(36.16049,139.7552));
	points.push(new GLatLng(36.15982,139.7539));
	points.push(new GLatLng(36.15933,139.7494));
	points.push(new GLatLng(36.15931,139.7493));
	points.push(new GLatLng(36.15903,139.7477));
	points.push(new GLatLng(36.15895,139.7473));
	points.push(new GLatLng(36.15865,139.7461));
	points.push(new GLatLng(36.15776,139.7436));
	points.push(new GLatLng(36.15659,139.7404));
	points.push(new GLatLng(36.15575,139.7381));
	points.push(new GLatLng(36.15459,139.7348));
	points.push(new GLatLng(36.15444,139.7345));
	points.push(new GLatLng(36.15409,139.7335));
	points.push(new GLatLng(36.15124,139.7253));
	points.push(new GLatLng(36.15092,139.7221));
	points.push(new GLatLng(36.15073,139.7211));
	points.push(new GLatLng(36.15004,139.7188));
	points.push(new GLatLng(36.14894,139.716));
	points.push(new GLatLng(36.147,139.7126));
	points.push(new GLatLng(36.14601,139.7101));
	points.push(new GLatLng(36.14581,139.7098));
	points.push(new GLatLng(36.14519,139.7088));
	points.push(new GLatLng(36.1441,139.707));
	points.push(new GLatLng(36.14154,139.7037));
	points.push(new GLatLng(36.14062,139.7042));
	points.push(new GLatLng(36.13826,139.7052));
	points.push(new GLatLng(36.13648,139.7058));
	points.push(new GLatLng(36.13339,139.7077));
	points.push(new GLatLng(36.13264,139.7074));
	points.push(new GLatLng(36.1318,139.7052));
	points.push(new GLatLng(36.12906,139.6997));
	points.push(new GLatLng(36.12749,139.6966));
	points.push(new GLatLng(36.12487,139.6895));
	points.push(new GLatLng(36.1247,139.688));
	points.push(new GLatLng(36.12459,139.6873));
	points.push(new GLatLng(36.12232,139.6832));
	points.push(new GLatLng(36.1209,139.6808));
	points.push(new GLatLng(36.12037,139.6799));
	points.push(new GLatLng(36.11863,139.6757));
	points.push(new GLatLng(36.11824,139.675));
	points.push(new GLatLng(36.11818,139.6747));
	points.push(new GLatLng(36.11779,139.674));
	points.push(new GLatLng(36.11753,139.6626));
	points.push(new GLatLng(36.11951,139.6581));
	points.push(new GLatLng(36.11985,139.6559));
	points.push(new GLatLng(36.12099,139.6507));
	points.push(new GLatLng(36.12449,139.6433));
	points.push(new GLatLng(36.12635,139.6398));
	points.push(new GLatLng(36.12627,139.6386));
	points.push(new GLatLng(36.12629,139.6375));
	points.push(new GLatLng(36.12635,139.6362));
	points.push(new GLatLng(36.1262,139.632));
	points.push(new GLatLng(36.12476,139.6269));
	points.push(new GLatLng(36.12434,139.6251));
	points.push(new GLatLng(36.12388,139.6232));
	points.push(new GLatLng(36.12363,139.6224));
	points.push(new GLatLng(36.1232,139.6205));
	points.push(new GLatLng(36.12376,139.6116));
	points.push(new GLatLng(36.1241,139.6116));
	points.push(new GLatLng(36.12609,139.6124));
	points.push(new GLatLng(36.12622,139.6115));
	points.push(new GLatLng(36.12736,139.6061));
	points.push(new GLatLng(36.12792,139.6043));
	points.push(new GLatLng(36.1294,139.6002));
	points.push(new GLatLng(36.13008,139.5983));
	points.push(new GLatLng(36.13103,139.5957));
	points.push(new GLatLng(36.13131,139.595));
	points.push(new GLatLng(36.13159,139.5942));
	points.push(new GLatLng(36.13187,139.5886));
	points.push(new GLatLng(36.13204,139.5874));
	points.push(new GLatLng(36.13258,139.5863));
	points.push(new GLatLng(36.13305,139.5854));
	points.push(new GLatLng(36.13412,139.5877));
	points.push(new GLatLng(36.13315,139.5902));
	points.push(new GLatLng(36.13195,139.5921));
	points.push(new GLatLng(36.13189,139.5933));
	points.push(new GLatLng(36.13178,139.5938));
	points.push(new GLatLng(36.13081,139.5965));
	points.push(new GLatLng(36.12983,139.5992));
	points.push(new GLatLng(36.12972,139.5995));
	points.push(new GLatLng(36.12852,139.6028));
	points.push(new GLatLng(36.12772,139.605));
	points.push(new GLatLng(36.12414,139.624));
	points.push(new GLatLng(36.12618,139.6317));
	points.push(new GLatLng(36.12642,139.6332));
	points.push(new GLatLng(36.12646,139.6339));
	points.push(new GLatLng(36.12646,139.6343));
	points.push(new GLatLng(36.12635,139.639));
	points.push(new GLatLng(36.12646,139.6403));
	points.push(new GLatLng(36.1262,139.6409));
	points.push(new GLatLng(36.12367,139.6446));
	points.push(new GLatLng(36.12281,139.6451));
	points.push(new GLatLng(36.12215,139.6446));
	points.push(new GLatLng(36.11832,139.6432));
	points.push(new GLatLng(36.11592,139.6415));
	points.push(new GLatLng(36.11438,139.6399));
	points.push(new GLatLng(36.11386,139.6395));
	points.push(new GLatLng(36.11245,139.6379));
	points.push(new GLatLng(36.11069,139.637));
	points.push(new GLatLng(36.10884,139.6374));
	points.push(new GLatLng(36.10884,139.6364));
	points.push(new GLatLng(36.1085,139.6374));
	points.push(new GLatLng(36.10815,139.6376));
	points.push(new GLatLng(36.08689,139.6385));
	points.push(new GLatLng(36.08346,139.6394));
	points.push(new GLatLng(36.08241,139.6397));
	points.push(new GLatLng(36.07927,139.641));
	points.push(new GLatLng(36.07876,139.6413));
	points.push(new GLatLng(36.07547,139.643));
	points.push(new GLatLng(36.07496,139.6429));
	points.push(new GLatLng(36.07509,139.641));
	points.push(new GLatLng(36.07513,139.6405));
	points.push(new GLatLng(36.07612,139.637));
	points.push(new GLatLng(36.07672,139.6351));
	points.push(new GLatLng(36.07839,139.6301));
	points.push(new GLatLng(36.07874,139.6279));
	points.push(new GLatLng(36.07949,139.6262));
	points.push(new GLatLng(36.07994,139.6239));
	points.push(new GLatLng(36.07955,139.6232));
	points.push(new GLatLng(36.07281,139.6152));
	points.push(new GLatLng(36.07148,139.6133));
	points.push(new GLatLng(36.07103,139.6123));
	points.push(new GLatLng(36.06951,139.6077));
	points.push(new GLatLng(36.06897,139.6058));
	points.push(new GLatLng(36.06824,139.6043));
	points.push(new GLatLng(36.06378,139.5981));
	points.push(new GLatLng(36.0528,139.5885));
	points.push(new GLatLng(36.05065,139.5872));
	points.push(new GLatLng(36.04926,139.5864));
	points.push(new GLatLng(36.04857,139.5859));
	points.push(new GLatLng(36.04779,139.5855));
	points.push(new GLatLng(36.04425,139.5834));
	points.push(new GLatLng(36.03616,139.5782));
	points.push(new GLatLng(36.03559,139.5776));
	points.push(new GLatLng(36.03318,139.5753));
	points.push(new GLatLng(36.03213,139.5744));
	points.push(new GLatLng(36.03093,139.5735));
	points.push(new GLatLng(36.02443,139.5686));
	points.push(new GLatLng(36.02312,139.5677));
	points.push(new GLatLng(36.02089,139.5663));
	points.push(new GLatLng(36.01016,139.5633));
	points.push(new GLatLng(36.00919,139.564));
	wpt_points.push(new GLatLng(36.1501,139.918966666667));
	wpt_points.push(new GLatLng(36.15085,139.919283333333));
	wpt_points.push(new GLatLng(36.1501833333333,139.919816666667));
	wpt_points.push(new GLatLng(36.1497333333333,139.92005));
	wpt_points.push(new GLatLng(36.14915,139.919616666667));
	wpt_points.push(new GLatLng(36.1493666666667,139.918916666667));
	wpt_points.push(new GLatLng(36.1333,139.707266666667));
	wpt_points.push(new GLatLng(36.1493666666667,139.918933333333));
	wpt_points.push(new GLatLng(36.1432833333333,139.7057));
	wpt_points.push(new GLatLng(36.1344166666667,139.587433333333));
	wpt_points.push(new GLatLng(36.1302333333333,139.596333333333));
	wpt_points.push(new GLatLng(36.13055,139.59675));
	wpt_points.push(new GLatLng(36.13055,139.59635));


	// 表示の中心位置・サイズを算出します。
	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/motorcycling.png";
	movemarkerIcon.shadow = "http://maps.google.co.jp/mapfiles/ms/icons/motorcycling.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;
	}
	addWayPoints(map, 1,139.918966666667,36.1501,"<b><a href=\""+relativepathtomainhtml+"#photoID1\">IMG_3562</a></b><br /><a href=\""+relativepathtosubfolder+"IMG_3562.jpg\"  target=\"_blank\"><img src=\""+relativepathtosubfolder+"IMG_3562-thumb.jpg\" border=\"0\" width=\"128\" height=\"96\" /></a><br /><small>2008:05:05 07:51:30<br />E139°55′8.28″<br />N36°9′0.36″<br />32m<br />茨城県結城郡千代川村五箇<hr /></small>");
	addWayPoints(map, 1,139.919283333333,36.15085,"<b><a href=\""+relativepathtomainhtml+"#photoID2\">IMG_3570</a></b><br /><a href=\""+relativepathtosubfolder+"IMG_3570.jpg\"  target=\"_blank\"><img src=\""+relativepathtosubfolder+"IMG_3570-thumb.jpg\" border=\"0\" width=\"128\" height=\"96\" /></a><br /><small>2008:05:05 07:57:07<br />E139°55′9.42″<br />N36°9′3.06″<br />35m<br />茨城県結城郡千代川村村岡<hr /></small>");
	addWayPoints(map, 1,139.919816666667,36.1501833333333,"<b><a href=\""+relativepathtomainhtml+"#photoID3\">IMG_3588</a></b><br /><a href=\""+relativepathtosubfolder+"IMG_3588.jpg\"  target=\"_blank\"><img src=\""+relativepathtosubfolder+"IMG_3588-thumb.jpg\" border=\"0\" width=\"128\" height=\"96\" /></a><br /><small>2008:05:05 08:31:27<br />E139°55′11.34″<br />N36°9′0.66″<br />32m<br />茨城県結城郡千代川村村岡<hr /></small>");
	addWayPoints(map, 1,139.92005,36.1497333333333,"<b><a href=\""+relativepathtomainhtml+"#photoID4\">IMG_3602</a></b><br /><a href=\""+relativepathtosubfolder+"IMG_3602.jpg\"  target=\"_blank\"><img src=\""+relativepathtosubfolder+"IMG_3602-thumb.jpg\" border=\"0\" width=\"128\" height=\"96\" /></a><br /><small>2008:05:05 08:43:13<br />E139°55′12.18″<br />N36°8′59.04″<br />29m<br />茨城県結城郡千代川村五箇<hr /></small>");
	addWayPoints(map, 1,139.919616666667,36.14915,"<b><a href=\""+relativepathtomainhtml+"#photoID5\">IMG_3679</a></b><br /><a href=\""+relativepathtosubfolder+"IMG_3679.jpg\"  target=\"_blank\"><img src=\""+relativepathtosubfolder+"IMG_3679-thumb.jpg\" border=\"0\" width=\"128\" height=\"96\" /></a><br /><small>2008:05:05 14:29:12<br />E139°55′10.62″<br />N36°8′56.94″<br />茨城県結城郡千代川村五箇<hr /></small>");
	addWayPoints(map, 1,139.918916666667,36.1493666666667,"<b><a href=\""+relativepathtomainhtml+"#photoID6\">IMG_3747</a></b><br /><a href=\""+relativepathtosubfolder+"IMG_3747.jpg\"  target=\"_blank\"><img src=\""+relativepathtosubfolder+"IMG_3747-thumb.jpg\" border=\"0\" width=\"128\" height=\"96\" /></a><br /><small>2008:05:05 15:43:44<br />E139°55′8.10″<br />N36°8′57.72″<br />茨城県結城郡千代川村五箇<hr /></small>");
	addWayPoints(map, 1,139.707266666667,36.1333,"<b><a href=\""+relativepathtomainhtml+"#photoID7\">SANY1537</a></b><br /><a href=\""+relativepathtosubfolder+"SANY1537.jpg\"  target=\"_blank\"><img src=\""+relativepathtosubfolder+"SANY1537-thumb.jpg\" border=\"0\" width=\"128\" height=\"96\" /></a><br /><small>2008:05:05 06:26:44<br />E139°42′26.16″<br />N36°7′59.88″<br />25m<br />埼玉県北葛飾郡栗橋町東五丁目<hr /></small>");
	addWayPoints(map, 1,139.918933333333,36.1493666666667,"<b><a href=\""+relativepathtomainhtml+"#photoID8\">SANY1589</a></b><br /><a href=\""+relativepathtosubfolder+"SANY1589.jpg\"  target=\"_blank\"><img src=\""+relativepathtosubfolder+"SANY1589-thumb.jpg\" border=\"0\" width=\"128\" height=\"96\" /></a><br /><small>2008:05:05 15:41:49<br />E139°55′8.16″<br />N36°8′57.72″<br />茨城県結城郡千代川村五箇<hr /></small>");
	addWayPoints(map, 1,139.7057,36.1432833333333,"<b><a href=\""+relativepathtomainhtml+"#photoID9\">SANY1599</a></b><br /><a href=\""+relativepathtosubfolder+"SANY1599.jpg\"  target=\"_blank\"><img src=\""+relativepathtosubfolder+"SANY1599-thumb.jpg\" border=\"0\" width=\"128\" height=\"96\" /></a><br /><small>2008:05:05 16:46:04<br />E139°42′20.52″<br />N36°8′35.82″<br />34m<br />埼玉県北葛飾郡栗橋町北二丁目<hr /></small>");
	addWayPoints(map, 1,139.587433333333,36.1344166666667,"<b><a href=\""+relativepathtomainhtml+"#photoID10\">SANY1601</a></b><br /><a href=\""+relativepathtosubfolder+"SANY1601.jpg\"  target=\"_blank\"><img src=\""+relativepathtosubfolder+"SANY1601-thumb.jpg\" border=\"0\" width=\"128\" height=\"96\" /></a><br /><small>2008:05:05 17:10:32<br />E139°35′14.76″<br />N36°8′3.90″<br />25m<br />埼玉県加須市不動岡二丁目<hr /></small>");
	addWayPoints(map, 1,139.596333333333,36.1302333333333,"<b><a href=\""+relativepathtomainhtml+"#photoID11\">SANY1602</a></b><br /><a href=\""+relativepathtosubfolder+"SANY1602.jpg\"  target=\"_blank\"><img src=\""+relativepathtosubfolder+"SANY1602-thumb.jpg\" border=\"0\" width=\"128\" height=\"96\" /></a><br /><small>2008:05:05 17:32:44<br />E139°35′46.80″<br />N36°7′48.84″<br />埼玉県加須市大門町<hr /></small>");
	addWayPoints(map, 1,139.59675,36.13055,"<b><a href=\""+relativepathtomainhtml+"#photoID12\">SANY1603</a></b><br /><a href=\""+relativepathtosubfolder+"SANY1603.jpg\"  target=\"_blank\"><img src=\""+relativepathtosubfolder+"SANY1603-thumb.jpg\" border=\"0\" width=\"128\" height=\"96\" /></a><br /><small>2008:05:05 17:32:50<br />E139°35′48.30″<br />N36°7′49.98″<br />埼玉県加須市大門町<hr /></small>");
	addWayPoints(map, 1,139.59635,36.13055,"<b><a href=\""+relativepathtomainhtml+"#photoID13\">SANY1604</a></b><br /><a href=\""+relativepathtosubfolder+"SANY1604.jpg\"  target=\"_blank\"><img src=\""+relativepathtosubfolder+"SANY1604-thumb.jpg\" border=\"0\" width=\"128\" height=\"96\" /></a><br /><small>2008:05:05 17:42:36<br />E139°35′46.86″<br />N36°7′49.98″<br />埼玉県加須市大門町<hr /></small>");


	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()
{
	hiddenLAYER('graph1');
	hiddenLAYER('graph2');
	hiddenLAYER('graph3');
}

// 指定したレイヤーを非表示にする
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;
}
