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

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

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

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

// ウェイポイント表示用関数
function addWayPoints(map, nType, lat, lon, title)
{
	var point=new GLatLng(lon, lat);
	var Icon = new GIcon();
	var nn;
	if (nType==1){ // 小さな赤いマーカ
		nn=posofphotos+1;
		Icon.image = "http://labs.google.com/ridefinder/images/mm_20_red.png";
		Icon.shadow = "http://labs.google.com/ridefinder/images/mm_20_shadow.png";
		Icon.iconSize = new GSize(12, 20);
		Icon.shadowSize = new GSize(22, 20);
		Icon.iconAnchor = new GPoint(6, 20);
		Icon.infoWindowAnchor = new GPoint(5, 1);

		photo_markers.push(new GMarker(point, Icon));
		photo_infos.push('<div style="width: 12em; style: font-size: small">'+title+'</div>');
		GEvent.addListener(photo_markers[posofphotos], "click", function(){jumpphotomarker(nn);});
		map.addOverlay(photo_markers[posofphotos]);
		posofphotos = posofphotos+1;

	}
	else
	{ // |>の形状のマーカ
		nn=posofwaypoints+1;
		Icon.image = "http://www.google.com/mapfiles/dd-start.png";
		Icon.shadow = "http://www.google.com/mapfiles/shadow50.png";
		Icon.iconSize = new GSize(20, 34);
		Icon.shadowSize = new GSize(37, 34);
		Icon.iconAnchor = new GPoint(9, 34);
		Icon.infoWindowAnchor = new GPoint(9, 2);

		waypoint_markers.push(new GMarker(point, Icon));
		waypoint_infos.push('<div style="width: 12em; style: font-size: small">'+title+'</div>');
		GEvent.addListener(waypoint_markers[posofwaypoints], "click",function(){jumpwaypointmarker(nn);});
		map.addOverlay(waypoint_markers[posofwaypoints]);
		posofwaypoints=posofwaypoints+1;
	}
}
	

// HTMLロード時
function load()
{
	// 初期化パラメータ
	var mapwidth=640;  // 地図の幅を設定します。
	var mapheight=480; // 地図の高さを設定します。
	var zoom=-1;    // この値を変更すると初期ズーム値が変わります。-1の場合は自動となります。
	var linecolor="#FF0000"; // この値を変更すると、線の色が変わります。
	var linewidth=2; // この値を変更すると、線の太さが変わります。 
	var lineopacity=1.00;   // この値を変更すると、線の透明度が変わります。
	var defaultmaptype=0; // この値を変更すると初期のマップタイプが変更されます。
	var wpt_points = [];

	// トラックデータ列です。
		points.push(new GLatLng(43.16489,141.3423));
	points.push(new GLatLng(43.16494,141.3424));
	points.push(new GLatLng(43.16493,141.3424));
	points.push(new GLatLng(43.16494,141.3424));
	points.push(new GLatLng(43.16534,141.3427));
	points.push(new GLatLng(43.1657,141.3429));
	points.push(new GLatLng(43.16586,141.3422));
	points.push(new GLatLng(43.16611,141.342));
	points.push(new GLatLng(43.16653,141.3417));
	points.push(new GLatLng(43.16698,141.3419));
	points.push(new GLatLng(43.16718,141.3411));
	points.push(new GLatLng(43.16746,141.3397));
	points.push(new GLatLng(43.16785,141.3383));
	points.push(new GLatLng(43.16806,141.3369));
	points.push(new GLatLng(43.1681,141.3355));
	points.push(new GLatLng(43.16794,141.3342));
	points.push(new GLatLng(43.16786,141.3329));
	points.push(new GLatLng(43.16771,141.3316));
	points.push(new GLatLng(43.16772,141.3304));
	points.push(new GLatLng(43.16771,141.3291));
	points.push(new GLatLng(43.16761,141.3286));
	points.push(new GLatLng(43.16758,141.3286));
	points.push(new GLatLng(43.16772,141.328));
	points.push(new GLatLng(43.16796,141.3268));
	points.push(new GLatLng(43.16831,141.3255));
	points.push(new GLatLng(43.16858,141.3242));
	points.push(new GLatLng(43.1691,141.3229));
	points.push(new GLatLng(43.1695,141.3219));
	points.push(new GLatLng(43.16956,141.3215));
	points.push(new GLatLng(43.16963,141.3214));
	points.push(new GLatLng(43.17005,141.3207));
	points.push(new GLatLng(43.17059,141.3195));
	points.push(new GLatLng(43.17127,141.3183));
	points.push(new GLatLng(43.17178,141.3172));
	points.push(new GLatLng(43.17211,141.3163));
	points.push(new GLatLng(43.17241,141.3157));
	points.push(new GLatLng(43.17225,141.3156));
	points.push(new GLatLng(43.17273,141.3158));
	points.push(new GLatLng(43.17353,141.3163));
	points.push(new GLatLng(43.17436,141.3169));
	points.push(new GLatLng(43.17521,141.3175));
	points.push(new GLatLng(43.17609,141.3181));
	points.push(new GLatLng(43.17688,141.3187));
	points.push(new GLatLng(43.1776,141.3193));
	points.push(new GLatLng(43.17849,141.3198));
	points.push(new GLatLng(43.17928,141.3204));
	points.push(new GLatLng(43.18008,141.321));
	points.push(new GLatLng(43.1809,141.3215));
	points.push(new GLatLng(43.1817,141.3221));
	points.push(new GLatLng(43.1823,141.3225));
	points.push(new GLatLng(43.1825,141.3228));
	points.push(new GLatLng(43.18263,141.3228));
	points.push(new GLatLng(43.18401,141.323));
	points.push(new GLatLng(43.18518,141.3235));
	points.push(new GLatLng(43.186,141.324));
	points.push(new GLatLng(43.18688,141.3245));
	points.push(new GLatLng(43.18778,141.3248));
	points.push(new GLatLng(43.18869,141.3252));
	points.push(new GLatLng(43.18958,141.3256));
	points.push(new GLatLng(43.19059,141.3259));
	points.push(new GLatLng(43.19159,141.3263));
	points.push(new GLatLng(43.19246,141.3267));
	points.push(new GLatLng(43.19335,141.3271));
	points.push(new GLatLng(43.19432,141.3275));
	points.push(new GLatLng(43.19529,141.3279));
	points.push(new GLatLng(43.19638,141.3281));
	points.push(new GLatLng(43.19719,141.3286));
	points.push(new GLatLng(43.19799,141.329));
	points.push(new GLatLng(43.19894,141.3293));
	points.push(new GLatLng(43.19991,141.3297));
	points.push(new GLatLng(43.20086,141.3301));
	points.push(new GLatLng(43.20174,141.3305));
	points.push(new GLatLng(43.20232,141.3304));
	points.push(new GLatLng(43.20254,141.3295));
	points.push(new GLatLng(43.20253,141.3295));
	points.push(new GLatLng(43.2025,141.3295));
	points.push(new GLatLng(43.20249,141.3295));
	points.push(new GLatLng(43.20264,141.3292));
	points.push(new GLatLng(43.20277,141.3282));
	points.push(new GLatLng(43.20303,141.3271));
	points.push(new GLatLng(43.20325,141.3258));
	points.push(new GLatLng(43.20346,141.3246));
	points.push(new GLatLng(43.20385,141.3229));
	points.push(new GLatLng(43.20399,141.3219));
	points.push(new GLatLng(43.20425,141.3207));
	points.push(new GLatLng(43.20446,141.3195));
	points.push(new GLatLng(43.20476,141.3183));
	points.push(new GLatLng(43.20504,141.3173));
	points.push(new GLatLng(43.20507,141.3168));
	points.push(new GLatLng(43.20516,141.3167));
	points.push(new GLatLng(43.20535,141.3166));
	points.push(new GLatLng(43.20566,141.3167));
	points.push(new GLatLng(43.20584,141.3167));
	points.push(new GLatLng(43.20607,141.3169));
	points.push(new GLatLng(43.20649,141.317));
	points.push(new GLatLng(43.20649,141.3161));
	points.push(new GLatLng(43.2067,141.3148));
	points.push(new GLatLng(43.2069,141.3133));
	points.push(new GLatLng(43.20708,141.3119));
	points.push(new GLatLng(43.20736,141.3105));
	points.push(new GLatLng(43.20764,141.3093));
	points.push(new GLatLng(43.20798,141.3079));
	points.push(new GLatLng(43.20831,141.3067));
	points.push(new GLatLng(43.20876,141.3056));
	points.push(new GLatLng(43.20914,141.3048));
	points.push(new GLatLng(43.20939,141.3047));
	points.push(new GLatLng(43.20963,141.3046));
	points.push(new GLatLng(43.20952,141.3047));
	points.push(new GLatLng(43.20946,141.3048));
	points.push(new GLatLng(43.20924,141.3048));
	points.push(new GLatLng(43.20883,141.3039));
	points.push(new GLatLng(43.20821,141.3029));
	points.push(new GLatLng(43.20751,141.3019));
	points.push(new GLatLng(43.20678,141.3009));
	points.push(new GLatLng(43.20607,141.2998));
	points.push(new GLatLng(43.20538,141.2987));
	points.push(new GLatLng(43.20457,141.2977));
	points.push(new GLatLng(43.20392,141.2969));
	points.push(new GLatLng(43.20333,141.2959));
	points.push(new GLatLng(43.20256,141.2949));
	points.push(new GLatLng(43.20181,141.2939));
	points.push(new GLatLng(43.201,141.2929));
	points.push(new GLatLng(43.20041,141.2919));
	points.push(new GLatLng(43.19971,141.291));
	points.push(new GLatLng(43.19886,141.2906));
	points.push(new GLatLng(43.19793,141.2908));
	points.push(new GLatLng(43.19699,141.2911));
	points.push(new GLatLng(43.19606,141.2914));
	points.push(new GLatLng(43.19538,141.2916));
	points.push(new GLatLng(43.19513,141.2917));
	points.push(new GLatLng(43.19504,141.2917));
	points.push(new GLatLng(43.19494,141.2923));
	points.push(new GLatLng(43.19476,141.2929));
	points.push(new GLatLng(43.19447,141.2937));
	points.push(new GLatLng(43.19395,141.2943));
	points.push(new GLatLng(43.19327,141.2946));
	points.push(new GLatLng(43.19241,141.2948));
	points.push(new GLatLng(43.19159,141.295));
	points.push(new GLatLng(43.19076,141.2952));
	points.push(new GLatLng(43.18995,141.2955));
	points.push(new GLatLng(43.1891,141.2957));
	points.push(new GLatLng(43.1883,141.296));
	points.push(new GLatLng(43.18737,141.2963));
	points.push(new GLatLng(43.18663,141.2965));
	points.push(new GLatLng(43.18592,141.2967));
	points.push(new GLatLng(43.18505,141.297));
	points.push(new GLatLng(43.18427,141.2972));
	points.push(new GLatLng(43.1834,141.2975));
	points.push(new GLatLng(43.1825,141.2977));
	points.push(new GLatLng(43.18164,141.298));
	points.push(new GLatLng(43.18085,141.2982));
	points.push(new GLatLng(43.18006,141.2986));
	points.push(new GLatLng(43.17948,141.2993));
	points.push(new GLatLng(43.1791,141.3001));
	points.push(new GLatLng(43.17863,141.301));
	points.push(new GLatLng(43.17843,141.3017));
	points.push(new GLatLng(43.17822,141.3021));
	points.push(new GLatLng(43.17817,141.3022));
	points.push(new GLatLng(43.1781,141.3024));
	points.push(new GLatLng(43.17802,141.3025));
	points.push(new GLatLng(43.17774,141.3033));
	points.push(new GLatLng(43.1775,141.3044));
	points.push(new GLatLng(43.17722,141.3055));
	points.push(new GLatLng(43.17695,141.3066));
	points.push(new GLatLng(43.17675,141.3076));
	points.push(new GLatLng(43.17657,141.3085));
	points.push(new GLatLng(43.17636,141.3095));
	points.push(new GLatLng(43.1761,141.3104));
	points.push(new GLatLng(43.17588,141.3113));
	points.push(new GLatLng(43.17563,141.3122));
	points.push(new GLatLng(43.17542,141.3132));
	points.push(new GLatLng(43.17517,141.3143));
	points.push(new GLatLng(43.17489,141.3155));
	points.push(new GLatLng(43.17461,141.3164));
	points.push(new GLatLng(43.17442,141.3171));
	points.push(new GLatLng(43.17441,141.3171));
	points.push(new GLatLng(43.17419,141.3171));
	points.push(new GLatLng(43.17356,141.3165));
	points.push(new GLatLng(43.17269,141.3159));
	points.push(new GLatLng(43.17221,141.3161));
	points.push(new GLatLng(43.17157,141.3174));
	points.push(new GLatLng(43.17101,141.3185));
	points.push(new GLatLng(43.17046,141.3197));
	points.push(new GLatLng(43.16994,141.3207));
	points.push(new GLatLng(43.16963,141.3214));
	points.push(new GLatLng(43.16933,141.3219));
	points.push(new GLatLng(43.16884,141.3229));
	points.push(new GLatLng(43.16842,141.3241));
	points.push(new GLatLng(43.16814,141.3253));
	points.push(new GLatLng(43.16795,141.3265));
	points.push(new GLatLng(43.16773,141.3277));
	points.push(new GLatLng(43.16753,141.3288));
	points.push(new GLatLng(43.16747,141.3298));
	points.push(new GLatLng(43.16751,141.3307));
	points.push(new GLatLng(43.16762,141.3317));
	points.push(new GLatLng(43.16774,141.3329));
	points.push(new GLatLng(43.16785,141.3341));
	points.push(new GLatLng(43.16794,141.3352));
	points.push(new GLatLng(43.168,141.3363));
	points.push(new GLatLng(43.16792,141.3373));
	points.push(new GLatLng(43.16772,141.3384));
	points.push(new GLatLng(43.16749,141.3395));
	points.push(new GLatLng(43.16714,141.3403));
	points.push(new GLatLng(43.16699,141.3413));
	points.push(new GLatLng(43.16668,141.3419));
	points.push(new GLatLng(43.16627,141.3418));
	points.push(new GLatLng(43.16597,141.3421));
	points.push(new GLatLng(43.16569,141.3426));
	points.push(new GLatLng(43.16533,141.3428));
	points.push(new GLatLng(43.16487,141.3424));
	points.push(new GLatLng(43.16487,141.3422));
	points.push(new GLatLng(43.16488,141.3423));
	points.push(new GLatLng(43.16489,141.3422));
	points.push(new GLatLng(43.1649,141.3423));
	points.push(new GLatLng(43.16491,141.3424));
	points.push(new GLatLng(43.16494,141.3423));
	points.push(new GLatLng(43.16496,141.3425));
	points.push(new GLatLng(43.16494,141.3425));
	points.push(new GLatLng(43.16494,141.3424));
	points.push(new GLatLng(43.1649,141.3426));
	points.push(new GLatLng(43.16483,141.3425));
	points.push(new GLatLng(43.16481,141.3425));
	points.push(new GLatLng(43.16469,141.3428));
	points.push(new GLatLng(43.16469,141.3428));
	points.push(new GLatLng(43.16467,141.3428));
	points.push(new GLatLng(43.16475,141.3427));
	points.push(new GLatLng(43.16475,141.3428));
	points.push(new GLatLng(43.16482,141.3428));
	points.push(new GLatLng(43.16469,141.343));
	points.push(new GLatLng(43.16489,141.3426));
	points.push(new GLatLng(43.16494,141.3425));
	points.push(new GLatLng(43.16492,141.3425));
	points.push(new GLatLng(43.1649,141.3425));
	points.push(new GLatLng(43.16492,141.3425));
	points.push(new GLatLng(43.16491,141.3425));
	points.push(new GLatLng(43.16487,141.3425));
	points.push(new GLatLng(43.16487,141.3425));
	points.push(new GLatLng(43.16484,141.3426));
	points.push(new GLatLng(43.16478,141.3427));
	points.push(new GLatLng(43.16475,141.3428));
	points.push(new GLatLng(43.16475,141.3428));
	points.push(new GLatLng(43.16474,141.3429));
	points.push(new GLatLng(43.16473,141.3429));
	points.push(new GLatLng(43.16472,141.3429));
	points.push(new GLatLng(43.16472,141.3429));
	points.push(new GLatLng(43.16472,141.3429));
	points.push(new GLatLng(43.16471,141.3429));
	points.push(new GLatLng(43.16471,141.343));
	points.push(new GLatLng(43.16471,141.343));
	points.push(new GLatLng(43.1647,141.343));
	points.push(new GLatLng(43.1647,141.343));
	points.push(new GLatLng(43.1647,141.343));
	points.push(new GLatLng(43.16469,141.343));
	points.push(new GLatLng(43.1647,141.343));
	points.push(new GLatLng(43.1647,141.343));
	points.push(new GLatLng(43.16484,141.3428));
	points.push(new GLatLng(43.16465,141.3429));
	points.push(new GLatLng(43.16463,141.343));
	points.push(new GLatLng(43.16483,141.3428));
	points.push(new GLatLng(43.16489,141.3426));
	points.push(new GLatLng(43.1647,141.3438));
	points.push(new GLatLng(43.16464,141.3433));
	wpt_points.push(new GLatLng(43.2018173333333,141.330486666667));
	wpt_points.push(new GLatLng(43.205082,141.316786666667));
	wpt_points.push(new GLatLng(43.2090386666667,141.305013333333));
	wpt_points.push(new GLatLng(43.19699,141.2911));


	// 表示の中心位置・サイズを算出します。
	var xavg=0;
	var yavg=0;
	var xmin=181;
	var xmax=-181;
	var ymin=91;
	var ymax=-91;
	for (var i=0; i<points.length; i++)
	{
		if (xmin>points[i].x) xmin=points[i].x;
		if (xmax<points[i].x) xmax=points[i].x;
		if (ymin>points[i].y) ymin=points[i].y;
		if (ymax<points[i].y) ymax=points[i].y;
	}
	for (var i=0; i<wpt_points.length; i++)
	{
		if (xmin>wpt_points[i].x) xmin=wpt_points[i].x;
		if (xmax<wpt_points[i].x) xmax=wpt_points[i].x;
		if (ymin>wpt_points[i].y) ymin=wpt_points[i].y;
		if (ymax<wpt_points[i].y) ymax=wpt_points[i].y;
	}
		
	xavg=(xmax+xmin)/2;
	yavg=(ymax+ymin)/2;
	var centerpos=new GLatLng( yavg, xavg);
	var region=new GLatLngBounds(new GLatLng(ymin,xmin), new GLatLng(ymax, xmax));
	
	// マップ初期化	
	map = new GMap2(document.getElementById("map"));
	map.addControl(new GLargeMapControl());
	map.addMapType(G_PHYSICAL_MAP);
	map.addControl(new GHierarchicalMapTypeControl());
	map.enableContinuousZoom();
	map.enableDoubleClickZoom();
	map.addControl(new GOverviewMapControl());
	
	if (zoom>0)
	{
		map.setCenter(centerpos, 17-zoom);
	}
	else
	{
		map.setCenter(centerpos, map.getBoundsZoomLevel(region));
	}
	
	// 軌跡再生アイコン
	movemarkerIcon = new GIcon();
	movemarkerIcon.iconSize = new GSize(32, 32);
	movemarkerIcon.shadowSize = new GSize(59, 32);
	movemarkerIcon.iconAnchor = new GPoint(16, 16);
	movemarkerIcon.infoWindowAnchor = new GPoint(1, 1);
	movemarkerIcon.image = "http://maps.google.co.jp/mapfiles/ms/icons/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;
	}
	addWayPoints(map, 1,141.330486666667,43.2018173333333,"<b><a href=\""+relativepathtomainhtml+"#photoID1\">風車</a></b><br /><a href=\""+relativepathtosubfolder+"IMGP2155.jpg\"  target=\"_blank\"><img src=\""+relativepathtosubfolder+"IMGP2155-thumb.jpg\" border=\"0\" width=\"128\" height=\"96\" /></a><br /><small>2008:05:02 06:12:53<br />E141°19′49.75″<br />N43°12′6.54″<br />-4.9m<br />北海道石狩市新港南一丁目<hr /></small>");
	addWayPoints(map, 1,141.316786666667,43.205082,"<b><a href=\""+relativepathtomainhtml+"#photoID2\">IMGP2156</a></b><br /><a href=\""+relativepathtosubfolder+"IMGP2156.jpg\"  target=\"_blank\"><img src=\""+relativepathtosubfolder+"IMGP2156-thumb.jpg\" border=\"0\" width=\"128\" height=\"96\" /></a><br /><small>2008:05:02 06:17:13<br />E141°19′0.43″<br />N43°12′18.30″<br />2.9m<br />北海道石狩市新港南三丁目<hr />石狩放水路</small>");
	addWayPoints(map, 1,141.305013333333,43.2090386666667,"<b><a href=\""+relativepathtomainhtml+"#photoID3\">IMGP2157</a></b><br /><a href=\""+relativepathtosubfolder+"IMGP2157.jpg\"  target=\"_blank\"><img src=\""+relativepathtosubfolder+"IMGP2157-thumb.jpg\" border=\"0\" width=\"128\" height=\"96\" /></a><br /><small>2008:05:02 06:21:12<br />E141°18′18.05″<br />N43°12′32.54″<br />12.5m<br />北海道石狩市新港中央三丁目<hr />石狩湾新港</small>");
	addWayPoints(map, 1,141.2911,43.19699,"<b><a href=\""+relativepathtomainhtml+"#photoID4\">IMGP2158</a></b><br /><a href=\""+relativepathtosubfolder+"IMGP2158.jpg\"  target=\"_blank\"><img src=\""+relativepathtosubfolder+"IMGP2158-thumb.jpg\" border=\"0\" width=\"128\" height=\"96\" /></a><br /><small>2008:05:02 06:26:46<br />E141°17′27.96″<br />N43°11′49.16″<br />36m<br />北海道石狩市新港中央四丁目<hr />石狩湾新港　中央水路</small>");


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


var moveMarker;
var obj2;
var strStart ="開始";
var strStop = "始点へ";
var strPause ="一時停止";
function operateTracking(obj) 
{
	if(obj.value == strStart)
	{
		obj.value = strPause;
		panTo(strStart, obj);
		obj2 = obj;
	}
	else if (obj.value == strPause)
	{
		panTo(strPause, obj);
		obj2 = obj;
	}
	else if (obj.value == strStop)
	{
		panTo(strStop, obj);
		if (obj2) obj2.value=strStart;
	}
	else
	{
		obj.value="";
	}
}
    

var iCurrent=0;
var timerID;
function panTo(state, obj)
{
	if (state==strStart)
	{
		map.panTo(points[iCurrent]);
		if (moveMarker == null)
		{
			moveMarker = new GMarker(points[iCurrent], movemarkerIcon);
			map.addOverlay(moveMarker);
		}
		else
		{
			moveMarker.setLatLng(points[iCurrent]);
		}
		iCurrent++;
		if (timerID != null) window.clearTimeout(timerID);
		timerID = window.setTimeout(function(){ panTo(strStart, obj); }, 60000/points.length);
		if (iCurrent==points.length)
		{
			obj.value=strStart;
			panTo(strStop, obj);
		}
	}
	else if (state==strStop)
	{
		iCurrent=0;
		if (moveMarker == null)
		{
			moveMarker = new GMarker(points[iCurrent], movemarkerIcon);
			map.addOverlay(moveMarker);
		}
		else
		{
			moveMarker.setLatLng(points[iCurrent]);
		}
		map.panTo(points[iCurrent]);
		if (timerID != null) window.clearTimeout(timerID);
	}
	else
	{
		obj.value = strStart;
		if (timerID != null) window.clearTimeout(timerID);
	}
}	

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

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

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

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

// 地図を表示する
function showMapPop( idName, lat, lon )
{ 
	var svalue;
	var zoomlevel;
	if (map == null)
	{
		if (currentzoom == null)
		{
			zoomlevel=12; // 指定がない場合	
		}
		else
		{
			zoomlevel=currentzoom; // htmlファイルに?xxでズームレベルが渡されたとき
		}
	}
	else
	{
		zoomlevel=map.getZoom();
	}
	svalue = ".<img src=\"http://maps.google.com/staticmap?center="+lat+","+lon+"&markers="+lat+","+lon+",blue&zoom="+zoomlevel+"&size=240x240&key="+key+"\" width=\"240\" height=\"240\"  />.";

	if ( document.getElementById )
	{
		document.getElementById( idName ).style.display="block";
		document.getElementById( idName ).innerHTML = svalue;
	}
	else if ( document.all )
	{
		 document.all( idName ).style.display="block";
		 document.all( idName ).innerHTML=svalue;
	}
	else if ( document.layers )
	{ 
		document.layers[ idName ].display = "block";
		document.layers[ idName ].innerHTML  = svalue;
	}
}

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

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

