// 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 = "WG20090815235501.files/time-alt.png";

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

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

	// 距離－高度
	var d_alt = new Image();
	d_alt.src = "WG20090815235501.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.16486,141.3426));
	points.push(new GLatLng(43.16487,141.3425));
	points.push(new GLatLng(43.16484,141.3426));
	points.push(new GLatLng(43.16472,141.3427));
	points.push(new GLatLng(43.16467,141.3428));
	points.push(new GLatLng(43.16499,141.343));
	points.push(new GLatLng(43.16544,141.3431));
	points.push(new GLatLng(43.16558,141.3424));
	points.push(new GLatLng(43.16616,141.3421));
	points.push(new GLatLng(43.16655,141.342));
	points.push(new GLatLng(43.16689,141.3417));
	points.push(new GLatLng(43.16708,141.3407));
	points.push(new GLatLng(43.16748,141.3393));
	points.push(new GLatLng(43.16768,141.3383));
	points.push(new GLatLng(43.16787,141.337));
	points.push(new GLatLng(43.16781,141.3346));
	points.push(new GLatLng(43.16771,141.3334));
	points.push(new GLatLng(43.16749,141.3308));
	points.push(new GLatLng(43.16743,141.3296));
	points.push(new GLatLng(43.16755,141.3284));
	points.push(new GLatLng(43.16785,141.3271));
	points.push(new GLatLng(43.16826,141.3249));
	points.push(new GLatLng(43.16854,141.3238));
	points.push(new GLatLng(43.16893,141.3228));
	points.push(new GLatLng(43.16936,141.3219));
	points.push(new GLatLng(43.16987,141.3208));
	points.push(new GLatLng(43.17084,141.3188));
	points.push(new GLatLng(43.17136,141.3177));
	points.push(new GLatLng(43.17183,141.3167));
	points.push(new GLatLng(43.17238,141.3156));
	points.push(new GLatLng(43.17324,141.3159));
	points.push(new GLatLng(43.17413,141.3167));
	points.push(new GLatLng(43.17468,141.3166));
	points.push(new GLatLng(43.17553,141.313));
	points.push(new GLatLng(43.17654,141.3087));
	points.push(new GLatLng(43.17708,141.3065));
	points.push(new GLatLng(43.17753,141.3043));
	points.push(new GLatLng(43.17775,141.3033));
	points.push(new GLatLng(43.17779,141.3026));
	points.push(new GLatLng(43.17783,141.3025));
	points.push(new GLatLng(43.17785,141.3025));
	points.push(new GLatLng(43.17802,141.302));
	points.push(new GLatLng(43.17876,141.3006));
	points.push(new GLatLng(43.17991,141.2984));
	points.push(new GLatLng(43.18053,141.2982));
	points.push(new GLatLng(43.1813,141.2981));
	points.push(new GLatLng(43.18232,141.2976));
	points.push(new GLatLng(43.18324,141.2972));
	points.push(new GLatLng(43.18413,141.2968));
	points.push(new GLatLng(43.18669,141.2961));
	points.push(new GLatLng(43.18758,141.2958));
	points.push(new GLatLng(43.18811,141.2961));
	points.push(new GLatLng(43.18906,141.2956));
	points.push(new GLatLng(43.18993,141.2952));
	points.push(new GLatLng(43.19076,141.2949));
	points.push(new GLatLng(43.19231,141.2945));
	points.push(new GLatLng(43.19313,141.2942));
	points.push(new GLatLng(43.19449,141.2938));
	points.push(new GLatLng(43.19496,141.2928));
	points.push(new GLatLng(43.19552,141.2917));
	points.push(new GLatLng(43.19618,141.2911));
	points.push(new GLatLng(43.19694,141.2908));
	points.push(new GLatLng(43.19775,141.2907));
	points.push(new GLatLng(43.19854,141.2904));
	points.push(new GLatLng(43.19938,141.2903));
	points.push(new GLatLng(43.20019,141.2907));
	points.push(new GLatLng(43.2009,141.2917));
	points.push(new GLatLng(43.20156,141.2929));
	points.push(new GLatLng(43.20298,141.2949));
	points.push(new GLatLng(43.20361,141.2958));
	points.push(new GLatLng(43.2061,141.2993));
	points.push(new GLatLng(43.20859,141.3029));
	points.push(new GLatLng(43.20918,141.304));
	points.push(new GLatLng(43.20984,141.3049));
	points.push(new GLatLng(43.21046,141.306));
	points.push(new GLatLng(43.21114,141.3069));
	points.push(new GLatLng(43.21181,141.3078));
	points.push(new GLatLng(43.21244,141.3089));
	points.push(new GLatLng(43.21308,141.3093));
	points.push(new GLatLng(43.21334,141.3096));
	points.push(new GLatLng(43.21441,141.3114));
	points.push(new GLatLng(43.21528,141.3115));
	points.push(new GLatLng(43.21576,141.3126));
	points.push(new GLatLng(43.21642,141.3135));
	points.push(new GLatLng(43.21675,141.3144));
	points.push(new GLatLng(43.21738,141.3152));
	points.push(new GLatLng(43.21798,141.3161));
	points.push(new GLatLng(43.21854,141.3171));
	points.push(new GLatLng(43.21917,141.3179));
	points.push(new GLatLng(43.2194,141.3187));
	points.push(new GLatLng(43.22003,141.3193));
	points.push(new GLatLng(43.22144,141.3211));
	points.push(new GLatLng(43.22216,141.3217));
	points.push(new GLatLng(43.22396,141.3245));
	points.push(new GLatLng(43.22454,141.3254));
	points.push(new GLatLng(43.22514,141.3262));
	points.push(new GLatLng(43.22577,141.3272));
	points.push(new GLatLng(43.22735,141.3288));
	points.push(new GLatLng(43.22812,141.3295));
	points.push(new GLatLng(43.23032,141.3319));
	points.push(new GLatLng(43.23094,141.3328));
	points.push(new GLatLng(43.23174,141.3335));
	points.push(new GLatLng(43.23252,141.3344));
	points.push(new GLatLng(43.23318,141.3352));
	points.push(new GLatLng(43.23389,141.336));
	points.push(new GLatLng(43.2345,141.3369));
	points.push(new GLatLng(43.23531,141.3374));
	points.push(new GLatLng(43.23599,141.3383));
	points.push(new GLatLng(43.23667,141.3392));
	points.push(new GLatLng(43.23813,141.3407));
	points.push(new GLatLng(43.23878,141.3415));
	points.push(new GLatLng(43.24012,141.3433));
	points.push(new GLatLng(43.241,141.3441));
	points.push(new GLatLng(43.24246,141.3455));
	points.push(new GLatLng(43.24315,141.3463));
	points.push(new GLatLng(43.24399,141.3466));
	points.push(new GLatLng(43.24475,141.3473));
	points.push(new GLatLng(43.24673,141.3496));
	points.push(new GLatLng(43.24748,141.3503));
	points.push(new GLatLng(43.24817,141.3511));
	points.push(new GLatLng(43.24892,141.3517));
	points.push(new GLatLng(43.24978,141.3519));
	points.push(new GLatLng(43.2506,141.3526));
	points.push(new GLatLng(43.25201,141.3538));
	points.push(new GLatLng(43.25275,141.3546));
	points.push(new GLatLng(43.25357,141.3549));
	points.push(new GLatLng(43.25436,141.3554));
	points.push(new GLatLng(43.25509,141.3561));
	points.push(new GLatLng(43.25589,141.3569));
	points.push(new GLatLng(43.25665,141.3575));
	points.push(new GLatLng(43.25702,141.3582));
	points.push(new GLatLng(43.25657,141.3595));
	points.push(new GLatLng(43.25618,141.3604));
	points.push(new GLatLng(43.25551,141.3606));
	points.push(new GLatLng(43.25477,141.3603));
	points.push(new GLatLng(43.25394,141.3597));
	points.push(new GLatLng(43.25295,141.3595));
	points.push(new GLatLng(43.25202,141.3592));
	points.push(new GLatLng(43.25132,141.3585));
	points.push(new GLatLng(43.25058,141.3579));
	points.push(new GLatLng(43.24975,141.3574));
	points.push(new GLatLng(43.24895,141.357));
	points.push(new GLatLng(43.2481,141.3568));
	points.push(new GLatLng(43.2474,141.3556));
	points.push(new GLatLng(43.24679,141.3543));
	points.push(new GLatLng(43.24624,141.3533));
	points.push(new GLatLng(43.245,141.3517));
	points.push(new GLatLng(43.24443,141.3508));
	points.push(new GLatLng(43.24371,141.3502));
	points.push(new GLatLng(43.24247,141.3482));
	points.push(new GLatLng(43.24037,141.346));
	points.push(new GLatLng(43.23934,141.3459));
	points.push(new GLatLng(43.23771,141.3448));
	points.push(new GLatLng(43.23678,141.3445));
	points.push(new GLatLng(43.23596,141.3441));
	points.push(new GLatLng(43.23436,141.3432));
	points.push(new GLatLng(43.23337,141.343));
	points.push(new GLatLng(43.23243,141.3426));
	points.push(new GLatLng(43.23159,141.342));
	points.push(new GLatLng(43.23071,141.3415));
	points.push(new GLatLng(43.22964,141.3413));
	points.push(new GLatLng(43.22876,141.341));
	points.push(new GLatLng(43.22841,141.3421));
	points.push(new GLatLng(43.22775,141.345));
	points.push(new GLatLng(43.22732,141.3467));
	points.push(new GLatLng(43.22686,141.3481));
	points.push(new GLatLng(43.22644,141.349));
	points.push(new GLatLng(43.22669,141.3496));
	points.push(new GLatLng(43.22786,141.3507));
	points.push(new GLatLng(43.22898,141.3521));
	points.push(new GLatLng(43.22989,141.3526));
	points.push(new GLatLng(43.2306,141.3534));
	points.push(new GLatLng(43.23182,141.3552));
	points.push(new GLatLng(43.23375,141.3579));
	points.push(new GLatLng(43.23438,141.3589));
	points.push(new GLatLng(43.23507,141.3595));
	points.push(new GLatLng(43.23528,141.3609));
	points.push(new GLatLng(43.23601,141.3614));
	points.push(new GLatLng(43.23692,141.3619));
	points.push(new GLatLng(43.23763,141.3629));
	points.push(new GLatLng(43.23829,141.3638));
	points.push(new GLatLng(43.23911,141.3646));
	points.push(new GLatLng(43.23993,141.3656));
	points.push(new GLatLng(43.24213,141.3683));
	points.push(new GLatLng(43.24276,141.3692));
	points.push(new GLatLng(43.24306,141.3696));
	points.push(new GLatLng(43.24368,141.3702));
	points.push(new GLatLng(43.24405,141.3702));
	points.push(new GLatLng(43.24408,141.3701));
	points.push(new GLatLng(43.24402,141.3703));
	points.push(new GLatLng(43.24388,141.3705));
	points.push(new GLatLng(43.24373,141.3708));
	points.push(new GLatLng(43.24339,141.3717));
	points.push(new GLatLng(43.24258,141.3743));
	points.push(new GLatLng(43.24236,141.3756));
	points.push(new GLatLng(43.24231,141.3769));
	points.push(new GLatLng(43.24258,141.3797));
	points.push(new GLatLng(43.24268,141.381));
	points.push(new GLatLng(43.24277,141.3835));
	points.push(new GLatLng(43.24286,141.3847));
	points.push(new GLatLng(43.2426,141.386));
	points.push(new GLatLng(43.24181,141.3886));
	points.push(new GLatLng(43.241,141.3911));
	points.push(new GLatLng(43.24068,141.3921));
	points.push(new GLatLng(43.23978,141.3947));
	points.push(new GLatLng(43.23936,141.3961));
	points.push(new GLatLng(43.23822,141.3997));
	points.push(new GLatLng(43.23779,141.4011));
	points.push(new GLatLng(43.23726,141.4036));
	points.push(new GLatLng(43.23721,141.4048));
	points.push(new GLatLng(43.23702,141.406));
	points.push(new GLatLng(43.23672,141.4088));
	points.push(new GLatLng(43.2365,141.4101));
	points.push(new GLatLng(43.23612,141.4114));
	points.push(new GLatLng(43.23526,141.4119));
	points.push(new GLatLng(43.23424,141.4123));
	points.push(new GLatLng(43.23327,141.4131));
	points.push(new GLatLng(43.23244,141.4141));
	points.push(new GLatLng(43.22992,141.4165));
	points.push(new GLatLng(43.22745,141.4186));
	points.push(new GLatLng(43.22648,141.4193));
	points.push(new GLatLng(43.22551,141.4201));
	points.push(new GLatLng(43.22438,141.4203));
	points.push(new GLatLng(43.22207,141.4211));
	points.push(new GLatLng(43.22102,141.4214));
	points.push(new GLatLng(43.22011,141.4215));
	points.push(new GLatLng(43.21801,141.4221));
	points.push(new GLatLng(43.2171,141.4223));
	points.push(new GLatLng(43.21611,141.4226));
	points.push(new GLatLng(43.21508,141.4233));
	points.push(new GLatLng(43.21419,141.4241));
	points.push(new GLatLng(43.2133,141.4249));
	points.push(new GLatLng(43.21244,141.4258));
	points.push(new GLatLng(43.21147,141.4266));
	points.push(new GLatLng(43.21047,141.4277));
	points.push(new GLatLng(43.209,141.4301));
	points.push(new GLatLng(43.20851,141.4315));
	points.push(new GLatLng(43.20803,141.4329));
	points.push(new GLatLng(43.20711,141.4355));
	points.push(new GLatLng(43.20667,141.4367));
	points.push(new GLatLng(43.20622,141.4379));
	points.push(new GLatLng(43.20575,141.4393));
	points.push(new GLatLng(43.20541,141.4407));
	points.push(new GLatLng(43.20534,141.4422));
	points.push(new GLatLng(43.20557,141.4437));
	points.push(new GLatLng(43.20595,141.4449));
	points.push(new GLatLng(43.2076,141.4447));
	points.push(new GLatLng(43.20777,141.444));
	points.push(new GLatLng(43.2077,141.4431));
	points.push(new GLatLng(43.20761,141.4427));
	points.push(new GLatLng(43.20752,141.4427));
	points.push(new GLatLng(43.20735,141.442));
	points.push(new GLatLng(43.20709,141.4401));
	points.push(new GLatLng(43.20721,141.4398));
	points.push(new GLatLng(43.20736,141.4395));
	points.push(new GLatLng(43.20775,141.4393));
	points.push(new GLatLng(43.20816,141.4392));
	points.push(new GLatLng(43.20856,141.4394));
	points.push(new GLatLng(43.20884,141.4397));
	points.push(new GLatLng(43.20907,141.4402));
	points.push(new GLatLng(43.20926,141.441));
	points.push(new GLatLng(43.20955,141.4417));
	points.push(new GLatLng(43.21008,141.4421));
	points.push(new GLatLng(43.21052,141.4422));
	points.push(new GLatLng(43.21082,141.4419));
	points.push(new GLatLng(43.21062,141.4422));
	points.push(new GLatLng(43.21014,141.4421));
	points.push(new GLatLng(43.20929,141.4409));
	points.push(new GLatLng(43.2085,141.4394));
	points.push(new GLatLng(43.20711,141.4403));
	points.push(new GLatLng(43.20761,141.4429));
	points.push(new GLatLng(43.20733,141.4451));
	points.push(new GLatLng(43.20618,141.4455));
	points.push(new GLatLng(43.20581,141.4455));
	points.push(new GLatLng(43.20498,141.4456));
	points.push(new GLatLng(43.20396,141.4457));
	points.push(new GLatLng(43.20285,141.4459));
	points.push(new GLatLng(43.20066,141.4462));
	points.push(new GLatLng(43.19867,141.4466));
	points.push(new GLatLng(43.1976,141.4467));
	points.push(new GLatLng(43.19659,141.4469));
	points.push(new GLatLng(43.19459,141.4471));
	points.push(new GLatLng(43.19368,141.4473));
	points.push(new GLatLng(43.19323,141.4465));
	points.push(new GLatLng(43.19311,141.4453));
	points.push(new GLatLng(43.19294,141.444));
	points.push(new GLatLng(43.19273,141.4418));
	points.push(new GLatLng(43.19267,141.4408));
	points.push(new GLatLng(43.19234,141.4364));
	points.push(new GLatLng(43.19223,141.4352));
	points.push(new GLatLng(43.19217,141.4342));
	points.push(new GLatLng(43.19199,141.432));
	points.push(new GLatLng(43.1918,141.4298));
	points.push(new GLatLng(43.19173,141.4286));
	points.push(new GLatLng(43.19163,141.4275));
	points.push(new GLatLng(43.19133,141.4268));
	points.push(new GLatLng(43.19053,141.4268));
	points.push(new GLatLng(43.18861,141.427));
	points.push(new GLatLng(43.18767,141.4272));
	points.push(new GLatLng(43.18676,141.4273));
	points.push(new GLatLng(43.1867,141.4273));
	points.push(new GLatLng(43.18603,141.4275));
	points.push(new GLatLng(43.18499,141.4276));
	points.push(new GLatLng(43.18275,141.428));
	points.push(new GLatLng(43.18169,141.4281));
	points.push(new GLatLng(43.18062,141.4283));
	points.push(new GLatLng(43.17855,141.4286));
	points.push(new GLatLng(43.17646,141.4288));
	points.push(new GLatLng(43.1761,141.4274));
	points.push(new GLatLng(43.17582,141.4264));
	points.push(new GLatLng(43.17521,141.4249));
	points.push(new GLatLng(43.17479,141.424));
	points.push(new GLatLng(43.1744,141.4232));
	points.push(new GLatLng(43.17358,141.4215));
	points.push(new GLatLng(43.17286,141.4199));
	points.push(new GLatLng(43.17188,141.4179));
	points.push(new GLatLng(43.17089,141.4156));
	points.push(new GLatLng(43.16893,141.4112));
	points.push(new GLatLng(43.16879,141.4107));
	points.push(new GLatLng(43.16872,141.4106));
	points.push(new GLatLng(43.1687,141.4107));
	points.push(new GLatLng(43.16854,141.4104));
	points.push(new GLatLng(43.1683,141.4097));
	points.push(new GLatLng(43.16798,141.4087));
	points.push(new GLatLng(43.16779,141.4074));
	points.push(new GLatLng(43.16772,141.4062));
	points.push(new GLatLng(43.16777,141.405));
	points.push(new GLatLng(43.16795,141.4028));
	points.push(new GLatLng(43.16815,141.402));
	points.push(new GLatLng(43.16854,141.4009));
	points.push(new GLatLng(43.16885,141.3999));
	points.push(new GLatLng(43.16925,141.3991));
	points.push(new GLatLng(43.1696,141.3983));
	points.push(new GLatLng(43.17013,141.3974));
	points.push(new GLatLng(43.17078,141.3964));
	points.push(new GLatLng(43.17123,141.3957));
	points.push(new GLatLng(43.1712,141.3956));
	points.push(new GLatLng(43.17147,141.3953));
	points.push(new GLatLng(43.17202,141.3944));
	points.push(new GLatLng(43.17289,141.3929));
	points.push(new GLatLng(43.17342,141.3919));
	points.push(new GLatLng(43.17388,141.391));
	points.push(new GLatLng(43.17431,141.3903));
	points.push(new GLatLng(43.17477,141.3897));
	points.push(new GLatLng(43.17516,141.3889));
	points.push(new GLatLng(43.17559,141.3882));
	points.push(new GLatLng(43.17613,141.3872));
	points.push(new GLatLng(43.17675,141.3863));
	points.push(new GLatLng(43.17723,141.3854));
	points.push(new GLatLng(43.17763,141.3846));
	points.push(new GLatLng(43.17805,141.384));
	points.push(new GLatLng(43.17842,141.3832));
	points.push(new GLatLng(43.17986,141.3808));
	points.push(new GLatLng(43.18094,141.3784));
	points.push(new GLatLng(43.18128,141.3775));
	points.push(new GLatLng(43.18188,141.3748));
	points.push(new GLatLng(43.1819,141.3739));
	points.push(new GLatLng(43.18194,141.3709));
	points.push(new GLatLng(43.18179,141.3698));
	points.push(new GLatLng(43.18167,141.3686));
	points.push(new GLatLng(43.18162,141.3675));
	points.push(new GLatLng(43.18153,141.3663));
	points.push(new GLatLng(43.18147,141.3652));
	points.push(new GLatLng(43.18128,141.363));
	points.push(new GLatLng(43.18107,141.361));
	points.push(new GLatLng(43.18096,141.3599));
	points.push(new GLatLng(43.18068,141.3575));
	points.push(new GLatLng(43.18059,141.3564));
	points.push(new GLatLng(43.18039,141.3531));
	points.push(new GLatLng(43.18034,141.3519));
	points.push(new GLatLng(43.17983,141.3516));
	points.push(new GLatLng(43.17795,141.3519));
	points.push(new GLatLng(43.17708,141.352));
	points.push(new GLatLng(43.17612,141.3522));
	points.push(new GLatLng(43.17518,141.3523));
	points.push(new GLatLng(43.1744,141.3526));
	points.push(new GLatLng(43.17442,141.3535));
	points.push(new GLatLng(43.17387,141.3534));
	points.push(new GLatLng(43.17308,141.353));
	points.push(new GLatLng(43.17227,141.3525));
	points.push(new GLatLng(43.17164,141.3521));
	points.push(new GLatLng(43.16925,141.3508));
	points.push(new GLatLng(43.16896,141.3507));
	points.push(new GLatLng(43.16827,141.351));
	points.push(new GLatLng(43.16559,141.3509));
	points.push(new GLatLng(43.16554,141.3498));
	points.push(new GLatLng(43.16537,141.3496));
	points.push(new GLatLng(43.16538,141.3496));
	points.push(new GLatLng(43.16527,141.3492));
	points.push(new GLatLng(43.16575,141.3475));
	points.push(new GLatLng(43.16639,141.3461));
	points.push(new GLatLng(43.16617,141.3448));
	points.push(new GLatLng(43.16581,141.3441));
	points.push(new GLatLng(43.16569,141.3432));
	points.push(new GLatLng(43.16505,141.3426));
	points.push(new GLatLng(43.16499,141.3426));
	points.push(new GLatLng(43.16505,141.3427));
	points.push(new GLatLng(43.16501,141.3426));
	points.push(new GLatLng(43.16502,141.3423));
	points.push(new GLatLng(43.16502,141.3424));


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

