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

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

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

	// 距離－高度
	var d_alt = new Image();
	d_alt.src = "20090412.files/dist-alt.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>');
		if (map != null){
			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>');
		if (map != null){
			GEvent.addListener(waypoint_markers[posofwaypoints], "click",function(){jumpwaypointmarker(nn);});
			map.addOverlay(waypoint_markers[posofwaypoints]);
		}
		posofwaypoints=posofwaypoints+1;
	}
}

// 写真表示モードロード時	
function photo_load()
{
	InitStreetView();
	AddAllWaypoints();
}
// ウェイポイント追加
function AddAllWaypoints()
{

	return;
}
// ストリートビュー初期化
function InitStreetView()
{
	streetObj = new GStreetviewPanorama(document.getElementById("streetview"));
	GEvent.addListener(streetObj, "error", 
	function(err){
	    if (err == 600 || err == 603) {
	        timerID3 = window.setTimeout(function() { streetObj.remove(); clearTimeout(timerID3); }, 600); // 少しディレイさせて消去
	    }
		return;
	});
}
// 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(43.16491,141.3426));
	points.push(new GLatLng(43.16492,141.3425));
	points.push(new GLatLng(43.16487,141.3425));
	points.push(new GLatLng(43.16556,141.3431));
	points.push(new GLatLng(43.16582,141.342));
	points.push(new GLatLng(43.16624,141.3417));
	points.push(new GLatLng(43.16673,141.3419));
	points.push(new GLatLng(43.16727,141.3398));
	points.push(new GLatLng(43.1679,141.3357));
	points.push(new GLatLng(43.16777,141.3344));
	points.push(new GLatLng(43.16761,141.3317));
	points.push(new GLatLng(43.16745,141.3303));
	points.push(new GLatLng(43.16748,141.329));
	points.push(new GLatLng(43.16854,141.3236));
	points.push(new GLatLng(43.16909,141.3223));
	points.push(new GLatLng(43.17084,141.3185));
	points.push(new GLatLng(43.17147,141.3173));
	points.push(new GLatLng(43.17215,141.3159));
	points.push(new GLatLng(43.17283,141.3159));
	points.push(new GLatLng(43.17455,141.3169));
	points.push(new GLatLng(43.17492,141.3157));
	points.push(new GLatLng(43.17588,141.3117));
	points.push(new GLatLng(43.17607,141.3099));
	points.push(new GLatLng(43.17645,141.3088));
	points.push(new GLatLng(43.17738,141.3046));
	points.push(new GLatLng(43.17766,141.3032));
	points.push(new GLatLng(43.17813,141.3021));
	points.push(new GLatLng(43.17806,141.3022));
	points.push(new GLatLng(43.17828,141.3017));
	points.push(new GLatLng(43.1789,141.3003));
	points.push(new GLatLng(43.17991,141.2984));
	points.push(new GLatLng(43.1805,141.2981));
	points.push(new GLatLng(43.18344,141.2971));
	points.push(new GLatLng(43.18483,141.2969));
	points.push(new GLatLng(43.18582,141.2964));
	points.push(new GLatLng(43.18782,141.2959));
	points.push(new GLatLng(43.18882,141.2955));
	points.push(new GLatLng(43.1898,141.2954));
	points.push(new GLatLng(43.19081,141.2951));
	points.push(new GLatLng(43.1919,141.2947));
	points.push(new GLatLng(43.19386,141.2942));
	points.push(new GLatLng(43.19463,141.2934));
	points.push(new GLatLng(43.19521,141.2919));
	points.push(new GLatLng(43.19602,141.291));
	points.push(new GLatLng(43.19714,141.2906));
	points.push(new GLatLng(43.19815,141.2903));
	points.push(new GLatLng(43.19915,141.2903));
	points.push(new GLatLng(43.20004,141.2909));
	points.push(new GLatLng(43.20065,141.2919));
	points.push(new GLatLng(43.20132,141.2928));
	points.push(new GLatLng(43.20256,141.2947));
	points.push(new GLatLng(43.20368,141.2961));
	points.push(new GLatLng(43.2042,141.2969));
	points.push(new GLatLng(43.20486,141.2981));
	points.push(new GLatLng(43.20541,141.2988));
	points.push(new GLatLng(43.20633,141.3002));
	points.push(new GLatLng(43.20785,141.3023));
	points.push(new GLatLng(43.20839,141.303));
	points.push(new GLatLng(43.20884,141.3036));
	points.push(new GLatLng(43.20984,141.305));
	points.push(new GLatLng(43.21043,141.3058));
	points.push(new GLatLng(43.21107,141.3068));
	points.push(new GLatLng(43.21287,141.3094));
	points.push(new GLatLng(43.2134,141.3103));
	points.push(new GLatLng(43.2139,141.311));
	points.push(new GLatLng(43.21438,141.3116));
	points.push(new GLatLng(43.21573,141.3122));
	points.push(new GLatLng(43.21625,141.313));
	points.push(new GLatLng(43.21663,141.314));
	points.push(new GLatLng(43.21698,141.3148));
	points.push(new GLatLng(43.21755,141.3156));
	points.push(new GLatLng(43.21857,141.3167));
	points.push(new GLatLng(43.21914,141.3178));
	points.push(new GLatLng(43.21933,141.3187));
	points.push(new GLatLng(43.21983,141.3192));
	points.push(new GLatLng(43.22041,141.32));
	points.push(new GLatLng(43.22102,141.3206));
	points.push(new GLatLng(43.22158,141.3215));
	points.push(new GLatLng(43.22224,141.3221));
	points.push(new GLatLng(43.22284,141.3233));
	points.push(new GLatLng(43.22339,141.3235));
	points.push(new GLatLng(43.22402,141.3243));
	points.push(new GLatLng(43.2245,141.3246));
	points.push(new GLatLng(43.22513,141.3257));
	points.push(new GLatLng(43.22565,141.3265));
	points.push(new GLatLng(43.22601,141.3271));
	points.push(new GLatLng(43.22661,141.3278));
	points.push(new GLatLng(43.2271,141.3284));
	points.push(new GLatLng(43.22756,141.3288));
	points.push(new GLatLng(43.2282,141.3294));
	points.push(new GLatLng(43.22891,141.3303));
	points.push(new GLatLng(43.22962,141.331));
	points.push(new GLatLng(43.23077,141.3322));
	points.push(new GLatLng(43.23143,141.3332));
	points.push(new GLatLng(43.23405,141.3361));
	points.push(new GLatLng(43.23465,141.3366));
	points.push(new GLatLng(43.23534,141.3373));
	points.push(new GLatLng(43.23703,141.3392));
	points.push(new GLatLng(43.23762,141.3397));
	points.push(new GLatLng(43.23829,141.3405));
	points.push(new GLatLng(43.23895,141.3416));
	points.push(new GLatLng(43.23963,141.3423));
	points.push(new GLatLng(43.24033,141.3432));
	points.push(new GLatLng(43.24098,141.3438));
	points.push(new GLatLng(43.24155,141.3443));
	points.push(new GLatLng(43.24288,141.3456));
	points.push(new GLatLng(43.24355,141.3463));
	points.push(new GLatLng(43.24433,141.3465));
	points.push(new GLatLng(43.24503,141.3472));
	points.push(new GLatLng(43.24553,141.3478));
	points.push(new GLatLng(43.24607,141.3484));
	points.push(new GLatLng(43.24728,141.3498));
	points.push(new GLatLng(43.24742,141.3501));
	points.push(new GLatLng(43.24741,141.35));
	points.push(new GLatLng(43.24743,141.3501));
	points.push(new GLatLng(43.24742,141.35));
	points.push(new GLatLng(43.2476,141.3501));
	points.push(new GLatLng(43.24819,141.3508));
	points.push(new GLatLng(43.24886,141.3515));
	points.push(new GLatLng(43.24963,141.3519));
	points.push(new GLatLng(43.25033,141.3524));
	points.push(new GLatLng(43.25181,141.3538));
	points.push(new GLatLng(43.25255,141.3541));
	points.push(new GLatLng(43.2533,141.3548));
	points.push(new GLatLng(43.25409,141.3549));
	points.push(new GLatLng(43.25473,141.3557));
	points.push(new GLatLng(43.25529,141.3565));
	points.push(new GLatLng(43.25591,141.3571));
	points.push(new GLatLng(43.25662,141.3578));
	points.push(new GLatLng(43.25674,141.3587));
	points.push(new GLatLng(43.25643,141.3597));
	points.push(new GLatLng(43.25614,141.3604));
	points.push(new GLatLng(43.25586,141.3609));
	points.push(new GLatLng(43.25495,141.3607));
	points.push(new GLatLng(43.25391,141.3603));
	points.push(new GLatLng(43.25277,141.3596));
	points.push(new GLatLng(43.25247,141.3593));
	points.push(new GLatLng(43.2515,141.3589));
	points.push(new GLatLng(43.24966,141.3578));
	points.push(new GLatLng(43.24923,141.3576));
	points.push(new GLatLng(43.24868,141.3572));
	points.push(new GLatLng(43.24794,141.3567));
	points.push(new GLatLng(43.24684,141.3553));
	points.push(new GLatLng(43.2461,141.3543));
	points.push(new GLatLng(43.24563,141.3535));
	points.push(new GLatLng(43.24488,141.3524));
	points.push(new GLatLng(43.24439,141.3517));
	points.push(new GLatLng(43.24346,141.3502));
	points.push(new GLatLng(43.24184,141.3478));
	points.push(new GLatLng(43.24126,141.347));
	points.push(new GLatLng(43.24043,141.3463));
	points.push(new GLatLng(43.23954,141.3459));
	points.push(new GLatLng(43.23951,141.3459));
	points.push(new GLatLng(43.2371,141.345));
	points.push(new GLatLng(43.23411,141.3438));
	points.push(new GLatLng(43.23049,141.3423));
	points.push(new GLatLng(43.22896,141.3417));
	points.push(new GLatLng(43.22831,141.3417));
	points.push(new GLatLng(43.22804,141.3427));
	points.push(new GLatLng(43.22783,141.3435));
	points.push(new GLatLng(43.22715,141.3471));
	points.push(new GLatLng(43.22691,141.3479));
	points.push(new GLatLng(43.22647,141.3489));
	points.push(new GLatLng(43.22645,141.3492));
	points.push(new GLatLng(43.22672,141.3495));
	points.push(new GLatLng(43.22849,141.3517));
	points.push(new GLatLng(43.22868,141.3519));
	points.push(new GLatLng(43.22866,141.3519));
	points.push(new GLatLng(43.22864,141.3519));
	points.push(new GLatLng(43.22909,141.3524));
	points.push(new GLatLng(43.23035,141.354));
	points.push(new GLatLng(43.23222,141.3563));
	points.push(new GLatLng(43.23278,141.3571));
	points.push(new GLatLng(43.23561,141.3606));
	points.push(new GLatLng(43.23614,141.3613));
	points.push(new GLatLng(43.23797,141.3635));
	points.push(new GLatLng(43.23851,141.3642));
	points.push(new GLatLng(43.23911,141.365));
	points.push(new GLatLng(43.23992,141.3659));
	points.push(new GLatLng(43.24127,141.3676));
	points.push(new GLatLng(43.2419,141.3684));
	points.push(new GLatLng(43.24249,141.3691));
	points.push(new GLatLng(43.24314,141.3699));
	points.push(new GLatLng(43.24364,141.3705));
	points.push(new GLatLng(43.24348,141.3716));
	points.push(new GLatLng(43.24307,141.3723));
	points.push(new GLatLng(43.24289,141.373));
	points.push(new GLatLng(43.24266,141.3738));
	points.push(new GLatLng(43.24249,141.3745));
	points.push(new GLatLng(43.24222,141.3761));
	points.push(new GLatLng(43.24216,141.377));
	points.push(new GLatLng(43.24225,141.378));
	points.push(new GLatLng(43.24236,141.379));
	points.push(new GLatLng(43.24262,141.3824));
	points.push(new GLatLng(43.24275,141.3842));
	points.push(new GLatLng(43.24282,141.3849));
	points.push(new GLatLng(43.24286,141.3849));
	points.push(new GLatLng(43.24283,141.3849));
	points.push(new GLatLng(43.2427,141.3854));
	points.push(new GLatLng(43.24195,141.388));
	points.push(new GLatLng(43.24127,141.39));
	points.push(new GLatLng(43.24128,141.3901));
	points.push(new GLatLng(43.24125,141.3901));
	points.push(new GLatLng(43.24119,141.3902));
	points.push(new GLatLng(43.24122,141.3902));
	points.push(new GLatLng(43.24128,141.3902));
	points.push(new GLatLng(43.24116,141.3904));
	points.push(new GLatLng(43.24093,141.3912));
	points.push(new GLatLng(43.24043,141.3929));
	points.push(new GLatLng(43.24004,141.3943));
	points.push(new GLatLng(43.2393,141.3965));
	points.push(new GLatLng(43.23915,141.3971));
	points.push(new GLatLng(43.23871,141.3983));
	points.push(new GLatLng(43.23855,141.3987));
	points.push(new GLatLng(43.23854,141.3988));
	points.push(new GLatLng(43.23854,141.3988));
	points.push(new GLatLng(43.23841,141.3989));
	points.push(new GLatLng(43.23835,141.3989));
	points.push(new GLatLng(43.23835,141.3989));
	points.push(new GLatLng(43.23782,141.3989));
	points.push(new GLatLng(43.23483,141.3994));
	points.push(new GLatLng(43.23419,141.3994));
	points.push(new GLatLng(43.23269,141.3997));
	points.push(new GLatLng(43.23044,141.4));
	points.push(new GLatLng(43.22993,141.4001));
	points.push(new GLatLng(43.22944,141.4002));
	points.push(new GLatLng(43.22791,141.4004));
	points.push(new GLatLng(43.2269,141.4005));
	points.push(new GLatLng(43.22528,141.4008));
	points.push(new GLatLng(43.22519,141.4008));
	points.push(new GLatLng(43.22519,141.4009));
	points.push(new GLatLng(43.22466,141.4009));
	points.push(new GLatLng(43.22247,141.4013));
	points.push(new GLatLng(43.22176,141.4014));
	points.push(new GLatLng(43.22062,141.4015));
	points.push(new GLatLng(43.22034,141.4016));
	points.push(new GLatLng(43.22033,141.4016));
	points.push(new GLatLng(43.22008,141.4016));
	points.push(new GLatLng(43.21801,141.4019));
	points.push(new GLatLng(43.21731,141.402));
	points.push(new GLatLng(43.21658,141.4023));
	points.push(new GLatLng(43.21486,141.4024));
	points.push(new GLatLng(43.21428,141.4025));
	points.push(new GLatLng(43.21395,141.4026));
	points.push(new GLatLng(43.21394,141.4026));
	points.push(new GLatLng(43.21375,141.4027));
	points.push(new GLatLng(43.21239,141.4029));
	points.push(new GLatLng(43.21181,141.4031));
	points.push(new GLatLng(43.21134,141.4032));
	points.push(new GLatLng(43.21082,141.4032));
	points.push(new GLatLng(43.21032,141.4032));
	points.push(new GLatLng(43.20976,141.4033));
	points.push(new GLatLng(43.20936,141.4033));
	points.push(new GLatLng(43.20886,141.4034));
	points.push(new GLatLng(43.20828,141.4035));
	points.push(new GLatLng(43.20775,141.4035));
	points.push(new GLatLng(43.20621,141.4037));
	points.push(new GLatLng(43.20545,141.404));
	points.push(new GLatLng(43.20311,141.4042));
	points.push(new GLatLng(43.20267,141.4043));
	points.push(new GLatLng(43.20217,141.4046));
	points.push(new GLatLng(43.20174,141.4046));
	points.push(new GLatLng(43.20155,141.4046));
	points.push(new GLatLng(43.20146,141.4046));
	points.push(new GLatLng(43.2009,141.4046));
	points.push(new GLatLng(43.19935,141.405));
	points.push(new GLatLng(43.1988,141.405));
	points.push(new GLatLng(43.19822,141.405));
	points.push(new GLatLng(43.19773,141.4051));
	points.push(new GLatLng(43.19764,141.4049));
	points.push(new GLatLng(43.19748,141.4051));
	points.push(new GLatLng(43.19691,141.4056));
	points.push(new GLatLng(43.19658,141.4059));
	points.push(new GLatLng(43.19619,141.4063));
	points.push(new GLatLng(43.1959,141.4065));
	points.push(new GLatLng(43.19558,141.4069));
	points.push(new GLatLng(43.19492,141.4077));
	points.push(new GLatLng(43.19495,141.4076));
	points.push(new GLatLng(43.19482,141.4076));
	points.push(new GLatLng(43.19451,141.4077));
	points.push(new GLatLng(43.19424,141.408));
	points.push(new GLatLng(43.19424,141.408));
	points.push(new GLatLng(43.19425,141.408));
	points.push(new GLatLng(43.19401,141.4082));
	points.push(new GLatLng(43.19358,141.4086));
	points.push(new GLatLng(43.19321,141.4089));
	points.push(new GLatLng(43.19284,141.4093));
	points.push(new GLatLng(43.19238,141.4097));
	points.push(new GLatLng(43.19195,141.41));
	points.push(new GLatLng(43.19088,141.411));
	points.push(new GLatLng(43.18959,141.4123));
	points.push(new GLatLng(43.18945,141.4124));
	points.push(new GLatLng(43.1889,141.4129));
	points.push(new GLatLng(43.18851,141.4133));
	points.push(new GLatLng(43.18747,141.4142));
	points.push(new GLatLng(43.18707,141.4146));
	points.push(new GLatLng(43.18672,141.4149));
	points.push(new GLatLng(43.18638,141.4152));
	points.push(new GLatLng(43.18581,141.4156));
	points.push(new GLatLng(43.18538,141.4159));
	points.push(new GLatLng(43.18495,141.4164));
	points.push(new GLatLng(43.18462,141.4166));
	points.push(new GLatLng(43.1837,141.4176));
	points.push(new GLatLng(43.18337,141.4179));
	points.push(new GLatLng(43.18309,141.4181));
	points.push(new GLatLng(43.18238,141.4187));
	points.push(new GLatLng(43.1809,141.42));
	points.push(new GLatLng(43.18055,141.4203));
	points.push(new GLatLng(43.17906,141.4216));
	points.push(new GLatLng(43.17834,141.4224));
	points.push(new GLatLng(43.17768,141.4231));
	points.push(new GLatLng(43.1773,141.4236));
	points.push(new GLatLng(43.17632,141.4248));
	points.push(new GLatLng(43.17593,141.4255));
	points.push(new GLatLng(43.17576,141.4258));
	points.push(new GLatLng(43.17569,141.426));
	points.push(new GLatLng(43.17554,141.426));
	points.push(new GLatLng(43.17553,141.426));
	points.push(new GLatLng(43.17443,141.4234));
	points.push(new GLatLng(43.17408,141.4228));
	points.push(new GLatLng(43.17364,141.4219));
	points.push(new GLatLng(43.17329,141.4208));
	points.push(new GLatLng(43.1724,141.419));
	points.push(new GLatLng(43.17179,141.4178));
	points.push(new GLatLng(43.17056,141.4151));
	points.push(new GLatLng(43.17009,141.4139));
	points.push(new GLatLng(43.16961,141.4128));
	points.push(new GLatLng(43.16908,141.4118));
	points.push(new GLatLng(43.16862,141.4107));
	points.push(new GLatLng(43.16827,141.4097));
	points.push(new GLatLng(43.16808,141.4085));
	points.push(new GLatLng(43.16784,141.4075));
	points.push(new GLatLng(43.1677,141.4064));
	points.push(new GLatLng(43.16771,141.4051));
	points.push(new GLatLng(43.16802,141.4028));
	points.push(new GLatLng(43.16816,141.4022));
	points.push(new GLatLng(43.16819,141.402));
	points.push(new GLatLng(43.16852,141.401));
	points.push(new GLatLng(43.16901,141.3998));
	points.push(new GLatLng(43.1696,141.3986));
	points.push(new GLatLng(43.17019,141.3976));
	points.push(new GLatLng(43.17073,141.3967));
	points.push(new GLatLng(43.17136,141.3957));
	points.push(new GLatLng(43.1721,141.3943));
	points.push(new GLatLng(43.17446,141.3901));
	points.push(new GLatLng(43.17514,141.3889));
	points.push(new GLatLng(43.17589,141.3878));
	points.push(new GLatLng(43.17896,141.3825));
	points.push(new GLatLng(43.17985,141.3809));
	points.push(new GLatLng(43.18065,141.3793));
	points.push(new GLatLng(43.18125,141.3777));
	points.push(new GLatLng(43.18162,141.3763));
	points.push(new GLatLng(43.18182,141.3749));
	points.push(new GLatLng(43.18195,141.3735));
	points.push(new GLatLng(43.18191,141.371));
	points.push(new GLatLng(43.18179,141.3695));
	points.push(new GLatLng(43.18166,141.3682));
	points.push(new GLatLng(43.18124,141.3641));
	points.push(new GLatLng(43.18114,141.3626));
	points.push(new GLatLng(43.18089,141.3596));
	points.push(new GLatLng(43.18086,141.358));
	points.push(new GLatLng(43.18064,141.3555));
	points.push(new GLatLng(43.18034,141.3525));
	points.push(new GLatLng(43.17992,141.3517));
	points.push(new GLatLng(43.17933,141.3515));
	points.push(new GLatLng(43.17861,141.3518));
	points.push(new GLatLng(43.17789,141.3519));
	points.push(new GLatLng(43.17678,141.352));
	points.push(new GLatLng(43.17446,141.3526));
	points.push(new GLatLng(43.17445,141.3537));
	points.push(new GLatLng(43.17405,141.3537));
	points.push(new GLatLng(43.17361,141.3534));
	points.push(new GLatLng(43.17305,141.353));
	points.push(new GLatLng(43.17198,141.3522));
	points.push(new GLatLng(43.17137,141.3521));
	points.push(new GLatLng(43.17082,141.3518));
	points.push(new GLatLng(43.16971,141.3513));
	points.push(new GLatLng(43.16885,141.3508));
	points.push(new GLatLng(43.16828,141.3511));
	points.push(new GLatLng(43.16769,141.3513));
	points.push(new GLatLng(43.167,141.3517));
	points.push(new GLatLng(43.16582,141.3521));
	points.push(new GLatLng(43.16559,141.3517));
	points.push(new GLatLng(43.16553,141.351));
	points.push(new GLatLng(43.16537,141.3504));
	points.push(new GLatLng(43.16524,141.3504));
	points.push(new GLatLng(43.16521,141.3501));
	points.push(new GLatLng(43.16527,141.3493));
	points.push(new GLatLng(43.16557,141.348));
	points.push(new GLatLng(43.16533,141.3469));
	points.push(new GLatLng(43.16593,141.3449));
	points.push(new GLatLng(43.16599,141.3438));
	points.push(new GLatLng(43.16557,141.3433));
	points.push(new GLatLng(43.16505,141.343));
	points.push(new GLatLng(43.16489,141.3427));
	points.push(new GLatLng(43.16493,141.3427));
	points.push(new GLatLng(43.16489,141.3427));
	points.push(new GLatLng(43.1649,141.3426));
	points.push(new GLatLng(43.16492,141.3427));
	points.push(new GLatLng(43.16495,141.3426));


	// 表示の中心位置・サイズを算出します。
	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());
	InitStreetView();
	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;
	}
	AddAllWaypoints();

	if (numofwaypoints == 0)
	{
		hiddenLAYER('waypointcombo');
	}
	if (numofphotos==0)
	{
		hiddenLAYER('photocombo');
	}
	if (callHiddenLayers==1)
	{
		hiddenLayers();
	}
	
} // end of load() function.


// トラッキング用API
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]);
		}
		var nstep=points.length/30; //(30 = 2000msec/60000);
		if (iCurrent % nstep >= 1 && iCurrent % nstep < 2)
		{
			// 約2秒毎にストリートビューを表示
		    moveSVLocation(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]);
		}
	    moveSVLocation(iCurrent);
		map.panTo(points[iCurrent]);
		if (timerID != null) window.clearTimeout(timerID);
	}
	else
	{
		obj.value = strStart;
		if (timerID != null) window.clearTimeout(timerID);
	}
}	


// ストリートビュー表示設定(トラックログ)
function moveSVLocation(i) 
{
    var spov = { yaw: 180, pitch: 0, zoom: 0 };
    var x = points[iCurrent + 1].latRadians() - points[iCurrent].latRadians();
    var y = points[iCurrent + 1].lngRadians() - points[iCurrent].lngRadians();
    yaw = 90 - Math.atan2(x, y) * 180 / Math.PI;
    if (yaw < 0) 
    {
	    yaw += 360;
	}
	spov.yaw = yaw;
	if (streetObj != null) 
	{
	    streetObj.setLocationAndPOV(points[i], spov);
	    timerID2 = window.setTimeout(function() { streetObj.show(); clearTimeout(timerID2); }, 500);  // 少しディレイさせて表示更新
	}

	// 全画面表示時にinfoウインドウの高さを変更
	var obj;
	if (document.getElementById) obj = document.getElementById("info");
	if (obj == null && document.all) obj = document.all("info"); // Ie6対策
	if (obj != null) obj.style.bottom = "235px";
}

// ストリートビュー表示設定(フォト・ウェイポイントマーカ)
function moveSVLocationLatLon(latlon) 
{
    if (streetObj != null) 
    {
        streetObj.setLocationAndPOV(latlon);
	    timerID2 = window.setTimeout(function() { streetObj.show(); clearTimeout(timerID2); }, 500);  // 少しディレイさせて表示更新
    }

	// 全画面表示時にinfoウインドウの高さを変更
	var obj;
	if (document.getElementById) obj = document.getElementById("info");
	if (obj == null && document.all) obj = document.all("info"); // Ie6対策
	if (obj != null) obj.style.bottom = "235px";
}

// 指定された写真へジャンプ
function jumpphotomarker(n)
{
	photo_markers[n-1].openInfoWindowHtml(photo_infos[n-1]);
	location.hash="#googlemap";
    moveSVLocationLatLon(photo_markers[n - 1].getPoint());

}
	
// 指定されたマーカーへジャンプ
function jumpwaypointmarker(n)
{
	waypoint_markers[n-1].openInfoWindowHtml(waypoint_infos[n-1]);
	location.hash="#googlemap";
	moveSVLocationLatLon(waypoint_markers[n - 1].getPoint());
}

// グラフは初期状態では消しておく
function hiddenLayers()
{
	hiddenLAYER('graph1');
	hiddenLAYER('graph2');
	hiddenLAYER('graph3');
	hiddenLAYER('graph4');
}

// 指定したレイヤーを非表示にする
function hiddenLAYER(idName)
{ 
	if ( document.getElementById )
	{
		document.getElementById( idName ).style.visibility='hidden';
	}
	else if ( document.all )
	{
		document.all( idName ).style.visibility = 'hidden';
	}
}

// 指定したレイヤーを表示する
function showLAYER(idName)
{
	if ( document.getElementById )
	{
		document.getElementById( idName ).style.visibility   = 'visible';
	}
	else if ( document.all )
	{
		document.all( idName ).style.visibility = 'visible'; // Ie6対策
	}
}

// 地図を表示する
function showMapPop( idName, lat, lon )
{ 
	var svalue;
	var zoomlevel;
	var i = idName.slice(6);
	moveSVLocationLatLon(photo_markers[Number(i) - 1].getPoint());
	
	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"; // Ie6対策
		 document.all( idName ).innerHTML=svalue;
	}
	moveSVLocationLatLon(photo_markers[Number(i) - 1].getPoint());

}

// 地図を消す
function hideMapPop( idName )
{
	if ( document.getElementById )
	{
		document.getElementById( idName ).style.display="none";
	}
	else if ( document.all )
	{
		document.all( idName ).style.display="none"; // Ie6対策
	}
}

// ズームレベルを渡しながらページを移動する。
function goPhotopage(url, hash)
{
	location.href=url+"?"+map.getZoom()+hash;
}

