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

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

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

	// 距離－高度
	var d_alt = new Image();
	d_alt.src = "20090429.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.16507,141.3425));
	points.push(new GLatLng(43.16509,141.3425));
	points.push(new GLatLng(43.16509,141.3426));
	points.push(new GLatLng(43.16507,141.3425));
	points.push(new GLatLng(43.16505,141.3418));
	points.push(new GLatLng(43.16582,141.3427));
	points.push(new GLatLng(43.16595,141.3435));
	points.push(new GLatLng(43.16599,141.3444));
	points.push(new GLatLng(43.1658,141.3454));
	points.push(new GLatLng(43.16545,141.3463));
	points.push(new GLatLng(43.16528,141.3468));
	points.push(new GLatLng(43.16557,141.3476));
	points.push(new GLatLng(43.16534,141.3485));
	points.push(new GLatLng(43.16526,141.3495));
	points.push(new GLatLng(43.16541,141.3495));
	points.push(new GLatLng(43.16552,141.3495));
	points.push(new GLatLng(43.16555,141.3496));
	points.push(new GLatLng(43.16554,141.3496));
	points.push(new GLatLng(43.1655,141.3501));
	points.push(new GLatLng(43.16567,141.3519));
	points.push(new GLatLng(43.16638,141.3518));
	points.push(new GLatLng(43.16706,141.3514));
	points.push(new GLatLng(43.16876,141.3506));
	points.push(new GLatLng(43.16947,141.3507));
	points.push(new GLatLng(43.17015,141.351));
	points.push(new GLatLng(43.17083,141.3515));
	points.push(new GLatLng(43.17151,141.3518));
	points.push(new GLatLng(43.17419,141.3534));
	points.push(new GLatLng(43.17448,141.3531));
	points.push(new GLatLng(43.17449,141.3525));
	points.push(new GLatLng(43.17476,141.3523));
	points.push(new GLatLng(43.17551,141.3522));
	points.push(new GLatLng(43.17828,141.3516));
	points.push(new GLatLng(43.17912,141.3515));
	points.push(new GLatLng(43.1805,141.3515));
	points.push(new GLatLng(43.1806,141.3528));
	points.push(new GLatLng(43.1808,141.3538));
	points.push(new GLatLng(43.18085,141.3548));
	points.push(new GLatLng(43.18093,141.356));
	points.push(new GLatLng(43.181,141.357));
	points.push(new GLatLng(43.18118,141.3596));
	points.push(new GLatLng(43.18129,141.3607));
	points.push(new GLatLng(43.1815,141.362));
	points.push(new GLatLng(43.18164,141.3644));
	points.push(new GLatLng(43.18171,141.3653));
	points.push(new GLatLng(43.18191,141.3664));
	points.push(new GLatLng(43.18193,141.3678));
	points.push(new GLatLng(43.18198,141.3687));
	points.push(new GLatLng(43.18203,141.3695));
	points.push(new GLatLng(43.18221,141.3707));
	points.push(new GLatLng(43.18227,141.3716));
	points.push(new GLatLng(43.18204,141.3735));
	points.push(new GLatLng(43.18204,141.3745));
	points.push(new GLatLng(43.18194,141.3754));
	points.push(new GLatLng(43.18149,141.3775));
	points.push(new GLatLng(43.1808,141.3793));
	points.push(new GLatLng(43.18039,141.3801));
	points.push(new GLatLng(43.17901,141.3826));
	points.push(new GLatLng(43.17863,141.3833));
	points.push(new GLatLng(43.1777,141.3848));
	points.push(new GLatLng(43.17725,141.3856));
	points.push(new GLatLng(43.17683,141.3863));
	points.push(new GLatLng(43.1764,141.387));
	points.push(new GLatLng(43.17592,141.3878));
	points.push(new GLatLng(43.17521,141.389));
	points.push(new GLatLng(43.17441,141.3904));
	points.push(new GLatLng(43.17395,141.3912));
	points.push(new GLatLng(43.17344,141.3921));
	points.push(new GLatLng(43.1729,141.3931));
	points.push(new GLatLng(43.17194,141.3947));
	points.push(new GLatLng(43.17056,141.3971));
	points.push(new GLatLng(43.16999,141.398));
	points.push(new GLatLng(43.16954,141.3988));
	points.push(new GLatLng(43.1688,141.4006));
	points.push(new GLatLng(43.16853,141.4014));
	points.push(new GLatLng(43.16816,141.4034));
	points.push(new GLatLng(43.16806,141.4045));
	points.push(new GLatLng(43.16805,141.4055));
	points.push(new GLatLng(43.16824,141.4077));
	points.push(new GLatLng(43.16843,141.4087));
	points.push(new GLatLng(43.1689,141.4107));
	points.push(new GLatLng(43.16947,141.4122));
	points.push(new GLatLng(43.16982,141.4129));
	points.push(new GLatLng(43.17014,141.4135));
	points.push(new GLatLng(43.17027,141.4143));
	points.push(new GLatLng(43.17071,141.4151));
	points.push(new GLatLng(43.172,141.4178));
	points.push(new GLatLng(43.17241,141.4185));
	points.push(new GLatLng(43.17283,141.4195));
	points.push(new GLatLng(43.17297,141.4199));
	points.push(new GLatLng(43.17297,141.4199));
	points.push(new GLatLng(43.17331,141.4205));
	points.push(new GLatLng(43.17414,141.4223));
	points.push(new GLatLng(43.17468,141.4235));
	points.push(new GLatLng(43.17567,141.4255));
	points.push(new GLatLng(43.17616,141.4267));
	points.push(new GLatLng(43.17646,141.428));
	points.push(new GLatLng(43.17688,141.4286));
	points.push(new GLatLng(43.17795,141.4285));
	points.push(new GLatLng(43.17888,141.4283));
	points.push(new GLatLng(43.17978,141.4282));
	points.push(new GLatLng(43.18163,141.428));
	points.push(new GLatLng(43.18249,141.4278));
	points.push(new GLatLng(43.18422,141.4276));
	points.push(new GLatLng(43.18505,141.4274));
	points.push(new GLatLng(43.18582,141.4273));
	points.push(new GLatLng(43.18642,141.4272));
	points.push(new GLatLng(43.18711,141.4272));
	points.push(new GLatLng(43.188,141.427));
	points.push(new GLatLng(43.18886,141.4269));
	points.push(new GLatLng(43.18979,141.4267));
	points.push(new GLatLng(43.19061,141.4267));
	points.push(new GLatLng(43.19234,141.4264));
	points.push(new GLatLng(43.19482,141.4259));
	points.push(new GLatLng(43.19631,141.4257));
	points.push(new GLatLng(43.19811,141.4255));
	points.push(new GLatLng(43.19896,141.4253));
	points.push(new GLatLng(43.19979,141.4252));
	points.push(new GLatLng(43.2006,141.425));
	points.push(new GLatLng(43.20127,141.4249));
	points.push(new GLatLng(43.20199,141.4249));
	points.push(new GLatLng(43.20282,141.4247));
	points.push(new GLatLng(43.20467,141.4244));
	points.push(new GLatLng(43.20554,141.4243));
	points.push(new GLatLng(43.20649,141.4241));
	points.push(new GLatLng(43.20733,141.424));
	points.push(new GLatLng(43.2081,141.4239));
	points.push(new GLatLng(43.20873,141.4238));
	points.push(new GLatLng(43.20955,141.4236));
	points.push(new GLatLng(43.21035,141.4235));
	points.push(new GLatLng(43.21111,141.4233));
	points.push(new GLatLng(43.21352,141.423));
	points.push(new GLatLng(43.21433,141.4229));
	points.push(new GLatLng(43.21506,141.4229));
	points.push(new GLatLng(43.21579,141.4226));
	points.push(new GLatLng(43.21677,141.4225));
	points.push(new GLatLng(43.21762,141.422));
	points.push(new GLatLng(43.21949,141.4212));
	points.push(new GLatLng(43.22049,141.4211));
	points.push(new GLatLng(43.22145,141.4207));
	points.push(new GLatLng(43.22241,141.4207));
	points.push(new GLatLng(43.22334,141.4204));
	points.push(new GLatLng(43.2244,141.4202));
	points.push(new GLatLng(43.22538,141.4201));
	points.push(new GLatLng(43.22625,141.4194));
	points.push(new GLatLng(43.2269,141.4185));
	points.push(new GLatLng(43.22794,141.4178));
	points.push(new GLatLng(43.22858,141.4172));
	points.push(new GLatLng(43.22935,141.4167));
	points.push(new GLatLng(43.23016,141.4161));
	points.push(new GLatLng(43.23107,141.4153));
	points.push(new GLatLng(43.23184,141.4146));
	points.push(new GLatLng(43.23285,141.4135));
	points.push(new GLatLng(43.23358,141.4126));
	points.push(new GLatLng(43.23444,141.4122));
	points.push(new GLatLng(43.23536,141.4117));
	points.push(new GLatLng(43.23608,141.411));
	points.push(new GLatLng(43.23608,141.4102));
	points.push(new GLatLng(43.23619,141.41));
	points.push(new GLatLng(43.23645,141.409));
	points.push(new GLatLng(43.23666,141.4076));
	points.push(new GLatLng(43.23682,141.4068));
	points.push(new GLatLng(43.23698,141.4054));
	points.push(new GLatLng(43.23726,141.4043));
	points.push(new GLatLng(43.23748,141.4029));
	points.push(new GLatLng(43.23775,141.4016));
	points.push(new GLatLng(43.23815,141.4002));
	points.push(new GLatLng(43.23845,141.3989));
	points.push(new GLatLng(43.23885,141.3975));
	points.push(new GLatLng(43.23921,141.396));
	points.push(new GLatLng(43.23993,141.3941));
	points.push(new GLatLng(43.24026,141.3928));
	points.push(new GLatLng(43.24069,141.3916));
	points.push(new GLatLng(43.24113,141.3902));
	points.push(new GLatLng(43.24153,141.3889));
	points.push(new GLatLng(43.24199,141.3873));
	points.push(new GLatLng(43.24238,141.3861));
	points.push(new GLatLng(43.24276,141.3852));
	points.push(new GLatLng(43.24267,141.3827));
	points.push(new GLatLng(43.24256,141.3819));
	points.push(new GLatLng(43.24244,141.3806));
	points.push(new GLatLng(43.24237,141.3792));
	points.push(new GLatLng(43.24228,141.3779));
	points.push(new GLatLng(43.24226,141.3764));
	points.push(new GLatLng(43.2424,141.3751));
	points.push(new GLatLng(43.24265,141.3739));
	points.push(new GLatLng(43.24297,141.373));
	points.push(new GLatLng(43.24335,141.3717));
	points.push(new GLatLng(43.24342,141.3708));
	points.push(new GLatLng(43.24286,141.3697));
	points.push(new GLatLng(43.2423,141.3689));
	points.push(new GLatLng(43.2416,141.3679));
	points.push(new GLatLng(43.24078,141.367));
	points.push(new GLatLng(43.24019,141.3663));
	points.push(new GLatLng(43.23938,141.3653));
	points.push(new GLatLng(43.23876,141.3645));
	points.push(new GLatLng(43.23823,141.3639));
	points.push(new GLatLng(43.23755,141.3631));
	points.push(new GLatLng(43.23687,141.3624));
	points.push(new GLatLng(43.23621,141.3615));
	points.push(new GLatLng(43.2356,141.3607));
	points.push(new GLatLng(43.23438,141.3589));
	points.push(new GLatLng(43.2335,141.3579));
	points.push(new GLatLng(43.23276,141.3569));
	points.push(new GLatLng(43.23214,141.3562));
	points.push(new GLatLng(43.23154,141.3555));
	points.push(new GLatLng(43.23104,141.355));
	points.push(new GLatLng(43.23096,141.3549));
	points.push(new GLatLng(43.23092,141.3549));
	points.push(new GLatLng(43.2304,141.3543));
	points.push(new GLatLng(43.22912,141.3526));
	points.push(new GLatLng(43.22848,141.3516));
	points.push(new GLatLng(43.22657,141.3493));
	points.push(new GLatLng(43.22668,141.3483));
	points.push(new GLatLng(43.22759,141.3451));
	points.push(new GLatLng(43.22791,141.3437));
	points.push(new GLatLng(43.22811,141.3425));
	points.push(new GLatLng(43.22855,141.3414));
	points.push(new GLatLng(43.22943,141.3418));
	points.push(new GLatLng(43.23037,141.3423));
	points.push(new GLatLng(43.23121,141.3426));
	points.push(new GLatLng(43.23202,141.3428));
	points.push(new GLatLng(43.23359,141.3434));
	points.push(new GLatLng(43.23598,141.3444));
	points.push(new GLatLng(43.23682,141.3449));
	points.push(new GLatLng(43.23761,141.3451));
	points.push(new GLatLng(43.23845,141.3456));
	points.push(new GLatLng(43.23932,141.3459));
	points.push(new GLatLng(43.24025,141.3463));
	points.push(new GLatLng(43.24107,141.3466));
	points.push(new GLatLng(43.24173,141.3472));
	points.push(new GLatLng(43.24234,141.3483));
	points.push(new GLatLng(43.24301,141.3494));
	points.push(new GLatLng(43.2435,141.3504));
	points.push(new GLatLng(43.24405,141.3509));
	points.push(new GLatLng(43.24455,141.352));
	points.push(new GLatLng(43.24514,141.3526));
	points.push(new GLatLng(43.24574,141.3535));
	points.push(new GLatLng(43.24631,141.3542));
	points.push(new GLatLng(43.24686,141.3552));
	points.push(new GLatLng(43.24746,141.3561));
	points.push(new GLatLng(43.24811,141.3571));
	points.push(new GLatLng(43.24856,141.3574));
	points.push(new GLatLng(43.24917,141.358));
	points.push(new GLatLng(43.24989,141.3583));
	points.push(new GLatLng(43.25136,141.3591));
	points.push(new GLatLng(43.25288,141.3599));
	points.push(new GLatLng(43.25365,141.3602));
	points.push(new GLatLng(43.25448,141.3609));
	points.push(new GLatLng(43.25529,141.3612));
	points.push(new GLatLng(43.25595,141.3611));
	points.push(new GLatLng(43.25614,141.3603));
	points.push(new GLatLng(43.25682,141.3583));
	points.push(new GLatLng(43.25612,141.3574));
	points.push(new GLatLng(43.25545,141.3568));
	points.push(new GLatLng(43.25486,141.356));
	points.push(new GLatLng(43.25353,141.3546));
	points.push(new GLatLng(43.25296,141.3546));
	points.push(new GLatLng(43.25237,141.3542));
	points.push(new GLatLng(43.25163,141.3538));
	points.push(new GLatLng(43.25014,141.3524));
	points.push(new GLatLng(43.24878,141.3514));
	points.push(new GLatLng(43.24824,141.3509));
	points.push(new GLatLng(43.24763,141.3502));
	points.push(new GLatLng(43.2471,141.3496));
	points.push(new GLatLng(43.24639,141.3488));
	points.push(new GLatLng(43.24568,141.3481));
	points.push(new GLatLng(43.24485,141.3471));
	points.push(new GLatLng(43.24403,141.3465));
	points.push(new GLatLng(43.2433,141.3463));
	points.push(new GLatLng(43.24183,141.3446));
	points.push(new GLatLng(43.24112,141.3439));
	points.push(new GLatLng(43.23901,141.3415));
	points.push(new GLatLng(43.23827,141.3406));
	points.push(new GLatLng(43.23761,141.3399));
	points.push(new GLatLng(43.23615,141.3383));
	points.push(new GLatLng(43.23553,141.3376));
	points.push(new GLatLng(43.23482,141.3369));
	points.push(new GLatLng(43.23418,141.3363));
	points.push(new GLatLng(43.2337,141.3357));
	points.push(new GLatLng(43.233,141.3349));
	points.push(new GLatLng(43.23234,141.334));
	points.push(new GLatLng(43.23163,141.3333));
	points.push(new GLatLng(43.23093,141.3324));
	points.push(new GLatLng(43.2304,141.3318));
	points.push(new GLatLng(43.22821,141.3293));
	points.push(new GLatLng(43.22666,141.3278));
	points.push(new GLatLng(43.22596,141.327));
	points.push(new GLatLng(43.22525,141.3259));
	points.push(new GLatLng(43.22308,141.3232));
	points.push(new GLatLng(43.22248,141.3225));
	points.push(new GLatLng(43.22179,141.3218));
	points.push(new GLatLng(43.22053,141.3201));
	points.push(new GLatLng(43.21991,141.3193));
	points.push(new GLatLng(43.2194,141.3186));
	points.push(new GLatLng(43.21925,141.318));
	points.push(new GLatLng(43.21887,141.3173));
	points.push(new GLatLng(43.21837,141.3167));
	points.push(new GLatLng(43.21782,141.316));
	points.push(new GLatLng(43.21732,141.3154));
	points.push(new GLatLng(43.21675,141.3146));
	points.push(new GLatLng(43.21638,141.3136));
	points.push(new GLatLng(43.2159,141.3129));
	points.push(new GLatLng(43.2153,141.3121));
	points.push(new GLatLng(43.21477,141.3121));
	points.push(new GLatLng(43.2136,141.3106));
	points.push(new GLatLng(43.21313,141.31));
	points.push(new GLatLng(43.21281,141.3097));
	points.push(new GLatLng(43.21241,141.3089));
	points.push(new GLatLng(43.21177,141.308));
	points.push(new GLatLng(43.21111,141.307));
	points.push(new GLatLng(43.21051,141.3062));
	points.push(new GLatLng(43.20977,141.3051));
	points.push(new GLatLng(43.20908,141.3041));
	points.push(new GLatLng(43.20855,141.3033));
	points.push(new GLatLng(43.20792,141.3024));
	points.push(new GLatLng(43.20655,141.3004));
	points.push(new GLatLng(43.2058,141.2993));
	points.push(new GLatLng(43.20428,141.2971));
	points.push(new GLatLng(43.2038,141.2964));
	points.push(new GLatLng(43.20311,141.2955));
	points.push(new GLatLng(43.20243,141.2944));
	points.push(new GLatLng(43.20104,141.2924));
	points.push(new GLatLng(43.20029,141.2913));
	points.push(new GLatLng(43.1997,141.2907));
	points.push(new GLatLng(43.19872,141.2904));
	points.push(new GLatLng(43.19769,141.2906));
	points.push(new GLatLng(43.19683,141.2909));
	points.push(new GLatLng(43.19602,141.291));
	points.push(new GLatLng(43.19531,141.2915));
	points.push(new GLatLng(43.19487,141.2924));
	points.push(new GLatLng(43.19444,141.2934));
	points.push(new GLatLng(43.19389,141.2941));
	points.push(new GLatLng(43.19329,141.2944));
	points.push(new GLatLng(43.1925,141.2945));
	points.push(new GLatLng(43.19113,141.295));
	points.push(new GLatLng(43.19038,141.2953));
	points.push(new GLatLng(43.18974,141.2955));
	points.push(new GLatLng(43.1889,141.2955));
	points.push(new GLatLng(43.18744,141.2961));
	points.push(new GLatLng(43.18661,141.2963));
	points.push(new GLatLng(43.18521,141.2966));
	points.push(new GLatLng(43.18446,141.2971));
	points.push(new GLatLng(43.18288,141.2975));
	points.push(new GLatLng(43.18206,141.2978));
	points.push(new GLatLng(43.18146,141.2979));
	points.push(new GLatLng(43.18158,141.2979));
	points.push(new GLatLng(43.18119,141.2979));
	points.push(new GLatLng(43.18063,141.2981));
	points.push(new GLatLng(43.18031,141.2981));
	points.push(new GLatLng(43.18031,141.2983));
	points.push(new GLatLng(43.18032,141.2983));
	points.push(new GLatLng(43.18004,141.2986));
	points.push(new GLatLng(43.17953,141.2995));
	points.push(new GLatLng(43.17904,141.3005));
	points.push(new GLatLng(43.17858,141.3013));
	points.push(new GLatLng(43.17838,141.3018));
	points.push(new GLatLng(43.17835,141.3018));
	points.push(new GLatLng(43.17817,141.3021));
	points.push(new GLatLng(43.17789,141.303));
	points.push(new GLatLng(43.17722,141.3059));
	points.push(new GLatLng(43.17712,141.3066));
	points.push(new GLatLng(43.17681,141.3078));
	points.push(new GLatLng(43.17664,141.3086));
	points.push(new GLatLng(43.17584,141.3121));
	points.push(new GLatLng(43.17565,141.3129));
	points.push(new GLatLng(43.17497,141.3158));
	points.push(new GLatLng(43.17481,141.3165));
	points.push(new GLatLng(43.17468,141.3166));
	points.push(new GLatLng(43.17456,141.3169));
	points.push(new GLatLng(43.17391,141.3166));
	points.push(new GLatLng(43.17312,141.316));
	points.push(new GLatLng(43.17255,141.3156));
	points.push(new GLatLng(43.17216,141.3163));
	points.push(new GLatLng(43.17168,141.3172));
	points.push(new GLatLng(43.17054,141.3196));
	points.push(new GLatLng(43.16969,141.3212));
	points.push(new GLatLng(43.1688,141.323));
	points.push(new GLatLng(43.16845,141.3239));
	points.push(new GLatLng(43.16824,141.3249));
	points.push(new GLatLng(43.16788,141.327));
	points.push(new GLatLng(43.16772,141.3278));
	points.push(new GLatLng(43.16751,141.3298));
	points.push(new GLatLng(43.16765,141.331));
	points.push(new GLatLng(43.16776,141.3321));
	points.push(new GLatLng(43.16792,141.334));
	points.push(new GLatLng(43.16787,141.3348));
	points.push(new GLatLng(43.16801,141.3359));
	points.push(new GLatLng(43.16802,141.3368));
	points.push(new GLatLng(43.16789,141.3378));
	points.push(new GLatLng(43.16774,141.3386));
	points.push(new GLatLng(43.16753,141.3393));
	points.push(new GLatLng(43.1673,141.3399));
	points.push(new GLatLng(43.16696,141.3416));
	points.push(new GLatLng(43.16674,141.342));
	points.push(new GLatLng(43.16582,141.3422));
	points.push(new GLatLng(43.16549,141.3428));
	points.push(new GLatLng(43.16504,141.3426));
	points.push(new GLatLng(43.16492,141.3425));
	points.push(new GLatLng(43.16492,141.3425));


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

