// Generated by trk2googlemaps and kml ( http://etgps.net/gps/ )
// 本コードはtrk2googlemaps and kmlによって自動生成されました。
var numofwaypoints=0;
var posofwaypoints=0;
var numofphotos=9;
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 = "WG20090502234540.files/time-alt.png";

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

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

	// 距離－高度
	var d_alt = new Image();
	d_alt.src = "WG20090502234540.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()
{
	addWayPoints(map, 1,141.268750555556,43.1440427777778,"<b><a href=\""+relativepathtomainhtml+"#photoID1\">手稲山</a></b><br /><a href=\""+relativepathtosubfolder+"DSCN2459.jpg\"  target=\"_blank\"><img src=\""+relativepathtosubfolder+"DSCN2459-thumb.jpg\" border=\"0\" width=\"128\" height=\"96\" /></a><br /><small>2009:05:03 09:08:25<br />E141°16′7.50″<br />N43°8′38.55″<br />北海道石狩市樽川<hr /></small>");
	addWayPoints(map, 1,141.252307222222,43.1447505555556,"<b><a href=\""+relativepathtomainhtml+"#photoID2\">前田森林公園　「噴水」</a></b><br /><a href=\""+relativepathtosubfolder+"DSCN2460.jpg\"  target=\"_blank\"><img src=\""+relativepathtosubfolder+"DSCN2460-thumb.jpg\" border=\"0\" width=\"128\" height=\"96\" /></a><br /><small>2009:05:03 09:14:25<br />E141°15′8.31″<br />N43°8′41.10″<br />北海道札幌市手稲区前田十条十七丁目<hr /></small>");
	addWayPoints(map, 1,141.252794722222,43.1462977777778,"<b><a href=\""+relativepathtomainhtml+"#photoID3\">前田森林公園　さくら１</a></b><br /><a href=\""+relativepathtosubfolder+"DSCN2461.jpg\"  target=\"_blank\"><img src=\""+relativepathtosubfolder+"DSCN2461-thumb.jpg\" border=\"0\" width=\"128\" height=\"96\" /></a><br /><small>2009:05:03 09:17:02<br />E141°15′10.06″<br />N43°8′46.67″<br />北海道札幌市手稲区手稲前田<hr /></small>");
	addWayPoints(map, 1,141.253599722222,43.1468338888889,"<b><a href=\""+relativepathtomainhtml+"#photoID4\">前田森林公園　さくら２</a></b><br /><a href=\""+relativepathtosubfolder+"DSCN2462.jpg\"  target=\"_blank\"><img src=\""+relativepathtosubfolder+"DSCN2462-thumb.jpg\" border=\"0\" width=\"128\" height=\"96\" /></a><br /><small>2009:05:03 09:17:28<br />E141°15′12.96″<br />N43°8′48.60″<br />北海道札幌市手稲区手稲前田<hr /></small>");
	addWayPoints(map, 1,141.254040833333,43.1473444444444,"<b><a href=\""+relativepathtomainhtml+"#photoID5\">前田森林公園　さくら３</a></b><br /><a href=\""+relativepathtosubfolder+"DSCN2463.jpg\"  target=\"_blank\"><img src=\""+relativepathtosubfolder+"DSCN2463-thumb.jpg\" border=\"0\" width=\"128\" height=\"96\" /></a><br /><small>2009:05:03 09:17:43<br />E141°15′14.55″<br />N43°8′50.44″<br />北海道札幌市手稲区手稲前田<hr /></small>");
	addWayPoints(map, 1,141.252492222222,43.1443041666667,"<b><a href=\""+relativepathtomainhtml+"#photoID6\">前田森林公園　</a></b><br /><a href=\""+relativepathtosubfolder+"DSCN2464.jpg\"  target=\"_blank\"><img src=\""+relativepathtosubfolder+"DSCN2464-thumb.jpg\" border=\"0\" width=\"128\" height=\"96\" /></a><br /><small>2009:05:03 09:24:07<br />E141°15′8.97″<br />N43°8′39.50″<br />北海道札幌市手稲区前田十条十七丁目<hr /></small>");
	addWayPoints(map, 1,141.252516666667,43.1456233333333,"<b><a href=\""+relativepathtomainhtml+"#photoID7\">前田森林公園　さくら４</a></b><br /><a href=\""+relativepathtosubfolder+"DSCN2466.jpg\"  target=\"_blank\"><img src=\""+relativepathtosubfolder+"DSCN2466-thumb.jpg\" border=\"0\" width=\"128\" height=\"96\" /></a><br /><small>2009:05:03 09:25:30<br />E141°15′9.06″<br />N43°8′44.24″<br />-10m<br />北海道札幌市手稲区手稲前田<hr /></small>");
	addWayPoints(map, 1,141.252948611111,43.1462072222222,"<b><a href=\""+relativepathtomainhtml+"#photoID8\">前田森林公園　さくら５</a></b><br /><a href=\""+relativepathtosubfolder+"DSCN2467.jpg\"  target=\"_blank\"><img src=\""+relativepathtosubfolder+"DSCN2467-thumb.jpg\" border=\"0\" width=\"128\" height=\"96\" /></a><br /><small>2009:05:03 09:25:42<br />E141°15′10.61″<br />N43°8′46.35″<br />北海道札幌市手稲区手稲前田<hr /></small>");
	addWayPoints(map, 1,141.254423888889,43.1419330555556,"<b><a href=\""+relativepathtomainhtml+"#photoID9\">前田森林公園　しらかば</a></b><br /><a href=\""+relativepathtosubfolder+"DSCN2468.jpg\"  target=\"_blank\"><img src=\""+relativepathtosubfolder+"DSCN2468-thumb.jpg\" border=\"0\" width=\"128\" height=\"96\" /></a><br /><small>2009:05:03 09:31:54<br />E141°15′15.93″<br />N43°8′30.96″<br />北海道札幌市手稲区前田十条十五丁目<hr /></small>");

	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.16793,141.3374));
	points.push(new GLatLng(43.168,141.3362));
	points.push(new GLatLng(43.16795,141.3349));
	points.push(new GLatLng(43.16776,141.3337));
	points.push(new GLatLng(43.16764,141.3311));
	points.push(new GLatLng(43.16747,141.3299));
	points.push(new GLatLng(43.16756,141.3288));
	points.push(new GLatLng(43.16776,141.3275));
	points.push(new GLatLng(43.16786,141.3265));
	points.push(new GLatLng(43.16885,141.323));
	points.push(new GLatLng(43.16987,141.321));
	points.push(new GLatLng(43.17122,141.3179));
	points.push(new GLatLng(43.17194,141.3167));
	points.push(new GLatLng(43.17233,141.3158));
	points.push(new GLatLng(43.17112,141.3138));
	points.push(new GLatLng(43.16984,141.3121));
	points.push(new GLatLng(43.16844,141.3101));
	points.push(new GLatLng(43.1673,141.3087));
	points.push(new GLatLng(43.16668,141.3078));
	points.push(new GLatLng(43.16623,141.3072));
	points.push(new GLatLng(43.16556,141.3064));
	points.push(new GLatLng(43.16506,141.3055));
	points.push(new GLatLng(43.16379,141.304));
	points.push(new GLatLng(43.16303,141.3031));
	points.push(new GLatLng(43.16209,141.3018));
	points.push(new GLatLng(43.1615,141.301));
	points.push(new GLatLng(43.1608,141.3001));
	points.push(new GLatLng(43.15973,141.2989));
	points.push(new GLatLng(43.15924,141.2979));
	points.push(new GLatLng(43.15847,141.2969));
	points.push(new GLatLng(43.15776,141.296));
	points.push(new GLatLng(43.15686,141.2948));
	points.push(new GLatLng(43.15631,141.2938));
	points.push(new GLatLng(43.15556,141.2931));
	points.push(new GLatLng(43.15539,141.2928));
	points.push(new GLatLng(43.15549,141.2929));
	points.push(new GLatLng(43.15525,141.2924));
	points.push(new GLatLng(43.15438,141.2914));
	points.push(new GLatLng(43.15216,141.2884));
	points.push(new GLatLng(43.15183,141.288));
	points.push(new GLatLng(43.15185,141.288));
	points.push(new GLatLng(43.15186,141.288));
	points.push(new GLatLng(43.15146,141.2875));
	points.push(new GLatLng(43.1506,141.2865));
	points.push(new GLatLng(43.14985,141.2854));
	points.push(new GLatLng(43.14846,141.2835));
	points.push(new GLatLng(43.14768,141.2825));
	points.push(new GLatLng(43.14699,141.2816));
	points.push(new GLatLng(43.14631,141.2805));
	points.push(new GLatLng(43.14417,141.2778));
	points.push(new GLatLng(43.14346,141.2767));
	points.push(new GLatLng(43.14141,141.274));
	points.push(new GLatLng(43.14097,141.2734));
	points.push(new GLatLng(43.14086,141.2734));
	points.push(new GLatLng(43.14088,141.2733));
	points.push(new GLatLng(43.14137,141.2724));
	points.push(new GLatLng(43.14184,141.2718));
	points.push(new GLatLng(43.1424,141.271));
	points.push(new GLatLng(43.14285,141.2703));
	points.push(new GLatLng(43.14285,141.2704));
	points.push(new GLatLng(43.14288,141.2704));
	points.push(new GLatLng(43.14312,141.27));
	points.push(new GLatLng(43.14371,141.2693));
	points.push(new GLatLng(43.14478,141.2676));
	points.push(new GLatLng(43.14714,141.2642));
	points.push(new GLatLng(43.14774,141.2636));
	points.push(new GLatLng(43.14739,141.2627));
	points.push(new GLatLng(43.14605,141.2609));
	points.push(new GLatLng(43.14549,141.2602));
	points.push(new GLatLng(43.1455,141.2599));
	points.push(new GLatLng(43.14521,141.2595));
	points.push(new GLatLng(43.14494,141.2584));
	points.push(new GLatLng(43.14418,141.2579));
	points.push(new GLatLng(43.14358,141.2571));
	points.push(new GLatLng(43.14295,141.2556));
	points.push(new GLatLng(43.14351,141.2547));
	points.push(new GLatLng(43.14376,141.2536));
	points.push(new GLatLng(43.14401,141.2529));
	points.push(new GLatLng(43.14405,141.2531));
	points.push(new GLatLng(43.14458,141.2522));
	points.push(new GLatLng(43.1451,141.2524));
	points.push(new GLatLng(43.14517,141.2526));
	points.push(new GLatLng(43.14532,141.2525));
	points.push(new GLatLng(43.14575,141.2525));
	points.push(new GLatLng(43.1462,141.2527));
	points.push(new GLatLng(43.14631,141.2527));
	points.push(new GLatLng(43.14629,141.2528));
	points.push(new GLatLng(43.1463,141.2528));
	points.push(new GLatLng(43.14653,141.2533));
	points.push(new GLatLng(43.1471,141.2538));
	points.push(new GLatLng(43.14756,141.2542));
	points.push(new GLatLng(43.1481,141.2548));
	points.push(new GLatLng(43.14853,141.2556));
	points.push(new GLatLng(43.1492,141.2561));
	points.push(new GLatLng(43.14974,141.2569));
	points.push(new GLatLng(43.15033,141.2575));
	points.push(new GLatLng(43.14951,141.2583));
	points.push(new GLatLng(43.14913,141.259));
	points.push(new GLatLng(43.14732,141.2598));
	points.push(new GLatLng(43.14688,141.2596));
	points.push(new GLatLng(43.14645,141.2589));
	points.push(new GLatLng(43.1459,141.2579));
	points.push(new GLatLng(43.14589,141.2571));
	points.push(new GLatLng(43.14539,141.2564));
	points.push(new GLatLng(43.14498,141.2554));
	points.push(new GLatLng(43.14421,141.2548));
	points.push(new GLatLng(43.14363,141.2549));
	points.push(new GLatLng(43.14388,141.254));
	points.push(new GLatLng(43.144,141.2532));
	points.push(new GLatLng(43.14399,141.2531));
	points.push(new GLatLng(43.14383,141.2531));
	points.push(new GLatLng(43.14378,141.253));
	points.push(new GLatLng(43.14406,141.2527));
	points.push(new GLatLng(43.14458,141.2523));
	points.push(new GLatLng(43.14472,141.2523));
	points.push(new GLatLng(43.14456,141.2524));
	points.push(new GLatLng(43.14488,141.2525));
	points.push(new GLatLng(43.14562,141.2525));
	points.push(new GLatLng(43.14635,141.2531));
	points.push(new GLatLng(43.14696,141.2538));
	points.push(new GLatLng(43.1474,141.2543));
	points.push(new GLatLng(43.14806,141.2552));
	points.push(new GLatLng(43.14872,141.2556));
	points.push(new GLatLng(43.14914,141.2564));
	points.push(new GLatLng(43.14986,141.257));
	points.push(new GLatLng(43.1501,141.2577));
	points.push(new GLatLng(43.14969,141.2583));
	points.push(new GLatLng(43.14907,141.259));
	points.push(new GLatLng(43.14769,141.259));
	points.push(new GLatLng(43.14716,141.26));
	points.push(new GLatLng(43.14697,141.2612));
	points.push(new GLatLng(43.14558,141.26));
	points.push(new GLatLng(43.14476,141.2587));
	points.push(new GLatLng(43.14314,141.2559));
	points.push(new GLatLng(43.14278,141.2554));
	points.push(new GLatLng(43.14262,141.2554));
	points.push(new GLatLng(43.14226,141.2548));
	points.push(new GLatLng(43.14153,141.254));
	points.push(new GLatLng(43.14113,141.2538));
	points.push(new GLatLng(43.14157,141.253));
	points.push(new GLatLng(43.14235,141.2518));
	points.push(new GLatLng(43.14305,141.2509));
	points.push(new GLatLng(43.14373,141.25));
	points.push(new GLatLng(43.14521,141.2478));
	points.push(new GLatLng(43.14662,141.2459));
	points.push(new GLatLng(43.14917,141.2424));
	points.push(new GLatLng(43.15128,141.2396));
	points.push(new GLatLng(43.15194,141.2389));
	points.push(new GLatLng(43.15218,141.2386));
	points.push(new GLatLng(43.15205,141.2385));
	points.push(new GLatLng(43.15263,141.2388));
	points.push(new GLatLng(43.15599,141.2431));
	points.push(new GLatLng(43.15911,141.2473));
	points.push(new GLatLng(43.1598,141.2482));
	points.push(new GLatLng(43.16029,141.2493));
	points.push(new GLatLng(43.16109,141.2499));
	points.push(new GLatLng(43.16176,141.2506));
	points.push(new GLatLng(43.16242,141.2515));
	points.push(new GLatLng(43.16374,141.2533));
	points.push(new GLatLng(43.16524,141.2553));
	points.push(new GLatLng(43.16655,141.2573));
	points.push(new GLatLng(43.16699,141.2585));
	points.push(new GLatLng(43.16802,141.259));
	points.push(new GLatLng(43.16869,141.26));
	points.push(new GLatLng(43.17029,141.2622));
	points.push(new GLatLng(43.17096,141.2632));
	points.push(new GLatLng(43.17318,141.2661));
	points.push(new GLatLng(43.17443,141.2679));
	points.push(new GLatLng(43.17772,141.2723));
	points.push(new GLatLng(43.18028,141.2758));
	points.push(new GLatLng(43.18352,141.2801));
	points.push(new GLatLng(43.18519,141.2824));
	points.push(new GLatLng(43.18583,141.2831));
	points.push(new GLatLng(43.18711,141.2848));
	points.push(new GLatLng(43.18754,141.2858));
	points.push(new GLatLng(43.18732,141.2864));
	points.push(new GLatLng(43.18633,141.2867));
	points.push(new GLatLng(43.18535,141.2868));
	points.push(new GLatLng(43.18442,141.2872));
	points.push(new GLatLng(43.18392,141.2881));
	points.push(new GLatLng(43.18397,141.2894));
	points.push(new GLatLng(43.18451,141.2931));
	points.push(new GLatLng(43.1849,141.2952));
	points.push(new GLatLng(43.18505,141.2959));
	points.push(new GLatLng(43.18542,141.2966));
	points.push(new GLatLng(43.1871,141.2961));
	points.push(new GLatLng(43.18857,141.2958));
	points.push(new GLatLng(43.19103,141.295));
	points.push(new GLatLng(43.19397,141.2942));
	points.push(new GLatLng(43.19459,141.2935));
	points.push(new GLatLng(43.19516,141.2923));
	points.push(new GLatLng(43.19568,141.2916));
	points.push(new GLatLng(43.19648,141.2911));
	points.push(new GLatLng(43.19725,141.2908));
	points.push(new GLatLng(43.19882,141.2904));
	points.push(new GLatLng(43.19962,141.2906));
	points.push(new GLatLng(43.2003,141.2914));
	points.push(new GLatLng(43.20326,141.2955));
	points.push(new GLatLng(43.20401,141.2964));
	points.push(new GLatLng(43.20542,141.2987));
	points.push(new GLatLng(43.20605,141.2995));
	points.push(new GLatLng(43.2065,141.3));
	points.push(new GLatLng(43.20695,141.3009));
	points.push(new GLatLng(43.2073,141.3017));
	points.push(new GLatLng(43.20788,141.3024));
	points.push(new GLatLng(43.20847,141.3031));
	points.push(new GLatLng(43.20914,141.304));
	points.push(new GLatLng(43.20954,141.3047));
	points.push(new GLatLng(43.21017,141.3056));
	points.push(new GLatLng(43.21069,141.3066));
	points.push(new GLatLng(43.21139,141.3073));
	points.push(new GLatLng(43.21333,141.3103));
	points.push(new GLatLng(43.21402,141.3113));
	points.push(new GLatLng(43.21469,141.3121));
	points.push(new GLatLng(43.2154,141.3122));
	points.push(new GLatLng(43.21614,141.3132));
	points.push(new GLatLng(43.21673,141.3141));
	points.push(new GLatLng(43.2174,141.3156));
	points.push(new GLatLng(43.21928,141.318));
	points.push(new GLatLng(43.21934,141.3187));
	points.push(new GLatLng(43.21987,141.3194));
	points.push(new GLatLng(43.22209,141.322));
	points.push(new GLatLng(43.22499,141.3257));
	points.push(new GLatLng(43.22628,141.3275));
	points.push(new GLatLng(43.22851,141.33));
	points.push(new GLatLng(43.22937,141.3308));
	points.push(new GLatLng(43.2316,141.3332));
	points.push(new GLatLng(43.23244,141.3341));
	points.push(new GLatLng(43.23433,141.3365));
	points.push(new GLatLng(43.23497,141.337));
	points.push(new GLatLng(43.23548,141.3375));
	points.push(new GLatLng(43.23623,141.3383));
	points.push(new GLatLng(43.23685,141.3392));
	points.push(new GLatLng(43.23765,141.3399));
	points.push(new GLatLng(43.24023,141.3432));
	points.push(new GLatLng(43.24094,141.3438));
	points.push(new GLatLng(43.2417,141.3444));
	points.push(new GLatLng(43.24306,141.3458));
	points.push(new GLatLng(43.24382,141.3463));
	points.push(new GLatLng(43.24461,141.3468));
	points.push(new GLatLng(43.24743,141.3498));
	points.push(new GLatLng(43.24866,141.3513));
	points.push(new GLatLng(43.24932,141.3518));
	points.push(new GLatLng(43.25001,141.3521));
	points.push(new GLatLng(43.25152,141.3536));
	points.push(new GLatLng(43.2531,141.3548));
	points.push(new GLatLng(43.25395,141.3549));
	points.push(new GLatLng(43.25682,141.3579));
	points.push(new GLatLng(43.25664,141.3592));
	points.push(new GLatLng(43.25608,141.3604));
	points.push(new GLatLng(43.25541,141.3608));
	points.push(new GLatLng(43.25474,141.3607));
	points.push(new GLatLng(43.254,141.3604));
	points.push(new GLatLng(43.25052,141.3583));
	points.push(new GLatLng(43.24824,141.357));
	points.push(new GLatLng(43.24694,141.3553));
	points.push(new GLatLng(43.24577,141.3535));
	points.push(new GLatLng(43.24477,141.3521));
	points.push(new GLatLng(43.24416,141.3513));
	points.push(new GLatLng(43.24375,141.3506));
	points.push(new GLatLng(43.24188,141.3478));
	points.push(new GLatLng(43.24124,141.3469));
	points.push(new GLatLng(43.24042,141.3463));
	points.push(new GLatLng(43.23919,141.3458));
	points.push(new GLatLng(43.2384,141.3454));
	points.push(new GLatLng(43.2375,141.3451));
	points.push(new GLatLng(43.23394,141.3436));
	points.push(new GLatLng(43.22936,141.3418));
	points.push(new GLatLng(43.22846,141.3414));
	points.push(new GLatLng(43.22814,141.3425));
	points.push(new GLatLng(43.22776,141.3441));
	points.push(new GLatLng(43.22732,141.3459));
	points.push(new GLatLng(43.22706,141.3472));
	points.push(new GLatLng(43.22676,141.3483));
	points.push(new GLatLng(43.22643,141.349));
	points.push(new GLatLng(43.22626,141.3493));
	points.push(new GLatLng(43.22589,141.3499));
	points.push(new GLatLng(43.22517,141.3509));
	points.push(new GLatLng(43.22462,141.3519));
	points.push(new GLatLng(43.22446,141.3532));
	points.push(new GLatLng(43.22441,141.3543));
	points.push(new GLatLng(43.22438,141.3554));
	points.push(new GLatLng(43.2241,141.3564));
	points.push(new GLatLng(43.22369,141.3575));
	points.push(new GLatLng(43.22292,141.3592));
	points.push(new GLatLng(43.22253,141.36));
	points.push(new GLatLng(43.22211,141.3611));
	points.push(new GLatLng(43.22158,141.3621));
	points.push(new GLatLng(43.22128,141.3628));
	points.push(new GLatLng(43.21983,141.3656));
	points.push(new GLatLng(43.21862,141.3678));
	points.push(new GLatLng(43.21801,141.3689));
	points.push(new GLatLng(43.21633,141.3719));
	points.push(new GLatLng(43.21582,141.3729));
	points.push(new GLatLng(43.21506,141.3737));
	points.push(new GLatLng(43.21316,141.3761));
	points.push(new GLatLng(43.21244,141.3769));
	points.push(new GLatLng(43.21081,141.3788));
	points.push(new GLatLng(43.20994,141.3799));
	points.push(new GLatLng(43.20832,141.3817));
	points.push(new GLatLng(43.20686,141.383));
	points.push(new GLatLng(43.20666,141.3832));
	points.push(new GLatLng(43.20564,141.384));
	points.push(new GLatLng(43.20322,141.3863));
	points.push(new GLatLng(43.19981,141.3893));
	points.push(new GLatLng(43.19884,141.3902));
	points.push(new GLatLng(43.19791,141.3911));
	points.push(new GLatLng(43.19545,141.3934));
	points.push(new GLatLng(43.1947,141.394));
	points.push(new GLatLng(43.19397,141.3947));
	points.push(new GLatLng(43.19273,141.3958));
	points.push(new GLatLng(43.19193,141.3965));
	points.push(new GLatLng(43.18961,141.3986));
	points.push(new GLatLng(43.18869,141.3992));
	points.push(new GLatLng(43.18828,141.3999));
	points.push(new GLatLng(43.18708,141.4008));
	points.push(new GLatLng(43.18567,141.4021));
	points.push(new GLatLng(43.18493,141.4029));
	points.push(new GLatLng(43.1842,141.4035));
	points.push(new GLatLng(43.18338,141.4043));
	points.push(new GLatLng(43.18182,141.4055));
	points.push(new GLatLng(43.18127,141.406));
	points.push(new GLatLng(43.17902,141.4081));
	points.push(new GLatLng(43.17494,141.4116));
	points.push(new GLatLng(43.17416,141.4123));
	points.push(new GLatLng(43.1735,141.4129));
	points.push(new GLatLng(43.17309,141.4133));
	points.push(new GLatLng(43.17309,141.4133));
	points.push(new GLatLng(43.173,141.4133));
	points.push(new GLatLng(43.17303,141.4134));
	points.push(new GLatLng(43.17329,141.4141));
	points.push(new GLatLng(43.1731,141.4148));
	points.push(new GLatLng(43.17279,141.4154));
	points.push(new GLatLng(43.17232,141.4158));
	points.push(new GLatLng(43.17181,141.4156));
	points.push(new GLatLng(43.17144,141.415));
	points.push(new GLatLng(43.17097,141.4151));
	points.push(new GLatLng(43.1708,141.4152));
	points.push(new GLatLng(43.17081,141.4152));
	points.push(new GLatLng(43.17081,141.4151));
	points.push(new GLatLng(43.17082,141.4152));
	points.push(new GLatLng(43.17039,141.4145));
	points.push(new GLatLng(43.16886,141.4111));
	points.push(new GLatLng(43.16836,141.4097));
	points.push(new GLatLng(43.16802,141.4081));
	points.push(new GLatLng(43.16779,141.4066));
	points.push(new GLatLng(43.16776,141.4052));
	points.push(new GLatLng(43.16808,141.4027));
	points.push(new GLatLng(43.16823,141.4019));
	points.push(new GLatLng(43.16912,141.3994));
	points.push(new GLatLng(43.17113,141.3959));
	points.push(new GLatLng(43.17244,141.3935));
	points.push(new GLatLng(43.17367,141.3915));
	points.push(new GLatLng(43.1741,141.3907));
	points.push(new GLatLng(43.175,141.3892));
	points.push(new GLatLng(43.17556,141.3882));
	points.push(new GLatLng(43.17621,141.3871));
	points.push(new GLatLng(43.17894,141.3823));
	points.push(new GLatLng(43.18034,141.3799));
	points.push(new GLatLng(43.1808,141.3789));
	points.push(new GLatLng(43.18123,141.3778));
	points.push(new GLatLng(43.18177,141.3757));
	points.push(new GLatLng(43.18201,141.3737));
	points.push(new GLatLng(43.18178,141.369));
	points.push(new GLatLng(43.18172,141.3677));
	points.push(new GLatLng(43.18157,141.3663));
	points.push(new GLatLng(43.18118,141.3617));
	points.push(new GLatLng(43.18081,141.3568));
	points.push(new GLatLng(43.18036,141.352));
	points.push(new GLatLng(43.17968,141.3517));
	points.push(new GLatLng(43.17864,141.3517));
	points.push(new GLatLng(43.17678,141.352));
	points.push(new GLatLng(43.17595,141.3522));
	points.push(new GLatLng(43.17513,141.3522));
	points.push(new GLatLng(43.17446,141.3526));
	points.push(new GLatLng(43.17451,141.3533));
	points.push(new GLatLng(43.17399,141.3534));
	points.push(new GLatLng(43.17327,141.353));
	points.push(new GLatLng(43.17257,141.3526));
	points.push(new GLatLng(43.17179,141.3521));
	points.push(new GLatLng(43.17093,141.3515));
	points.push(new GLatLng(43.17015,141.3511));
	points.push(new GLatLng(43.16943,141.3508));
	points.push(new GLatLng(43.16863,141.3507));
	points.push(new GLatLng(43.16604,141.3519));
	points.push(new GLatLng(43.16561,141.3515));
	points.push(new GLatLng(43.16549,141.3507));
	points.push(new GLatLng(43.1654,141.3497));
	points.push(new GLatLng(43.16539,141.3494));
	points.push(new GLatLng(43.16529,141.3487));
	points.push(new GLatLng(43.16563,141.3475));
	points.push(new GLatLng(43.16533,141.3466));
	points.push(new GLatLng(43.1657,141.3458));
	points.push(new GLatLng(43.1659,141.3447));
	points.push(new GLatLng(43.16561,141.343));
	points.push(new GLatLng(43.16512,141.3426));
	points.push(new GLatLng(43.16503,141.3423));
	points.push(new GLatLng(43.16505,141.3423));
	points.push(new GLatLng(43.16479,141.3428));
	points.push(new GLatLng(43.16484,141.3427));
	wpt_points.push(new GLatLng(43.1440427777778,141.268750555556));
	wpt_points.push(new GLatLng(43.1447505555556,141.252307222222));
	wpt_points.push(new GLatLng(43.1462977777778,141.252794722222));
	wpt_points.push(new GLatLng(43.1468338888889,141.253599722222));
	wpt_points.push(new GLatLng(43.1473444444444,141.254040833333));
	wpt_points.push(new GLatLng(43.1443041666667,141.252492222222));
	wpt_points.push(new GLatLng(43.1456233333333,141.252516666667));
	wpt_points.push(new GLatLng(43.1462072222222,141.252948611111));
	wpt_points.push(new GLatLng(43.1419330555556,141.254423888889));


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

