// Generated by trk2googlemaps and kml ( http://etoh.minidns.net/gps/ )
// 本コードはtrk2googlemaps and kmlによって自動生成されました。
numofwaypoints=0;
posofwaypoints=0;
numofphotos=0;
posofphotos=0;
waypoint_markers = [];
waypoint_infos   = [];
photo_markers    = [];
photo_infos      = [];
var points = [];
var map;
var currentzoom;
var key = "ABQIAAAApjTnNUDc7hNvPmVadg0PJRTFDTCggXZEde_JxrccJHfwe6yd2BS_Du6zact3nB0de97t6SCnwbUY9w";
var movemarkerIcon;
   
// グラフマウスオーバ用のJavaScript
if (document.images)
{
	// 時刻－高度
	var alt = new Image();
	alt.src = "fugu.files/time-alt.png";

	// 時刻－距離
	var dist = new Image();
	dist.src = "fugu.files/time-dst.png";

	// 時刻－速度
	var speed = new Image();
	speed.src = "fugu.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(35.2935815,139.5786248));
	points.push(new GLatLng(35.3287891,139.6253251));
	points.push(new GLatLng(35.3288943,139.6255065));
	points.push(new GLatLng(35.3291918,139.6259008));
	points.push(new GLatLng(35.329317,139.6256336));
	points.push(new GLatLng(35.3295786,139.6257484));
	points.push(new GLatLng(35.3300676,139.6270016));
	points.push(new GLatLng(35.3298719,139.627558));
	points.push(new GLatLng(35.3292387,139.6288871));
	points.push(new GLatLng(35.3292363,139.6295274));
	points.push(new GLatLng(35.3292607,139.6295647));
	points.push(new GLatLng(35.3294516,139.6298286));
	points.push(new GLatLng(35.3299977,139.6308915));
	points.push(new GLatLng(35.3302498,139.6313271));
	points.push(new GLatLng(35.3305108,139.6318893));
	points.push(new GLatLng(35.3306802,139.632259));
	points.push(new GLatLng(35.3329299,139.6381718));
	points.push(new GLatLng(35.3331903,139.6386392));
	points.push(new GLatLng(35.3331055,139.6388953));
	points.push(new GLatLng(35.3329941,139.6393223));
	points.push(new GLatLng(35.332788,139.6406547));
	points.push(new GLatLng(35.3325064,139.6433638));
	points.push(new GLatLng(35.332483,139.6438084));
	points.push(new GLatLng(35.332375,139.6473319));
	points.push(new GLatLng(35.3323364,139.6498766));
	points.push(new GLatLng(35.3323114,139.6502293));
	points.push(new GLatLng(35.3322852,139.6508508));
	points.push(new GLatLng(35.3324372,139.6549891));
	points.push(new GLatLng(35.3324344,139.655757));
	points.push(new GLatLng(35.3322646,139.6570535));
	points.push(new GLatLng(35.3321888,139.6581075));
	points.push(new GLatLng(35.3319969,139.6592987));
	points.push(new GLatLng(35.3303153,139.6619667));
	points.push(new GLatLng(35.3295695,139.6624024));
	points.push(new GLatLng(35.3275634,139.6628765));
	points.push(new GLatLng(35.3253868,139.662923));
	points.push(new GLatLng(35.3241203,139.6632193));
	points.push(new GLatLng(35.3230952,139.6639347));
	points.push(new GLatLng(35.3221588,139.6648465));
	points.push(new GLatLng(35.3213077,139.6659663));
	points.push(new GLatLng(35.3196976,139.6687371));
	points.push(new GLatLng(35.319166,139.6698654));
	points.push(new GLatLng(35.3177098,139.6754604));
	points.push(new GLatLng(35.3174065,139.6766315));
	points.push(new GLatLng(35.3170404,139.6779899));
	points.push(new GLatLng(35.3167734,139.679159));
	points.push(new GLatLng(35.316333,139.68063));
	points.push(new GLatLng(35.3163025,139.6807225));
	points.push(new GLatLng(35.3153975,139.6856117));
	points.push(new GLatLng(35.3145444,139.6910013));
	points.push(new GLatLng(35.3143165,139.6925944));
	points.push(new GLatLng(35.3143168,139.6927947));
	points.push(new GLatLng(35.313952,139.6955304));
	points.push(new GLatLng(35.3139089,139.6957268));
	points.push(new GLatLng(35.3135751,139.6984894));
	points.push(new GLatLng(35.3134979,139.6991931));
	points.push(new GLatLng(35.3133845,139.7008306));
	points.push(new GLatLng(35.313022,139.7023899));
	points.push(new GLatLng(35.3128941,139.7028709));
	points.push(new GLatLng(35.3127157,139.7045752));
	points.push(new GLatLng(35.312432,139.7070971));
	points.push(new GLatLng(35.3122889,139.7079493));
	points.push(new GLatLng(35.3121314,139.7092323));
	points.push(new GLatLng(35.3120999,139.7095749));
	points.push(new GLatLng(35.3117842,139.7119318));
	points.push(new GLatLng(35.3113361,139.7158159));
	points.push(new GLatLng(35.3111195,139.7178408));
	points.push(new GLatLng(35.3108017,139.7200905));
	points.push(new GLatLng(35.3107613,139.7205202));
	points.push(new GLatLng(35.3106327,139.7212954));
	points.push(new GLatLng(35.3103721,139.7224117));
	points.push(new GLatLng(35.3102318,139.7229989));
	points.push(new GLatLng(35.3101162,139.7234193));
	points.push(new GLatLng(35.3094909,139.7259045));
	points.push(new GLatLng(35.3093,139.7266293));
	points.push(new GLatLng(35.3092592,139.726883));
	points.push(new GLatLng(35.3090378,139.7277793));
	points.push(new GLatLng(35.3089796,139.7282085));
	points.push(new GLatLng(35.3082624,139.7310384));
	points.push(new GLatLng(35.3081143,139.7315277));
	points.push(new GLatLng(35.3074555,139.7336769));
	points.push(new GLatLng(35.3072845,139.7342431));
	points.push(new GLatLng(35.3069294,139.7352707));
	points.push(new GLatLng(35.3068354,139.7356233));
	points.push(new GLatLng(35.3063147,139.7379357));
	points.push(new GLatLng(35.3052502,139.7430352));
	points.push(new GLatLng(35.3051591,139.7434388));
	points.push(new GLatLng(35.3049016,139.744949));
	points.push(new GLatLng(35.3037527,139.7503328));
	points.push(new GLatLng(35.3035011,139.7513535));
	points.push(new GLatLng(35.3032626,139.7528278));
	points.push(new GLatLng(35.3030478,139.7539787));
	points.push(new GLatLng(35.3030306,139.7540837));
	points.push(new GLatLng(35.3026006,139.7564672));
	points.push(new GLatLng(35.302309,139.7577856));
	points.push(new GLatLng(35.3020568,139.7586708));
	points.push(new GLatLng(35.3012481,139.7614734));
	points.push(new GLatLng(35.3001018,139.7652169));
	points.push(new GLatLng(35.2998378,139.7663717));
	points.push(new GLatLng(35.2994397,139.7681519));
	points.push(new GLatLng(35.2990339,139.7697368));
	points.push(new GLatLng(35.298936,139.7701439));
	points.push(new GLatLng(35.2987127,139.7718499));
	points.push(new GLatLng(35.2984379,139.773342));
	points.push(new GLatLng(35.2984167,139.7735436));
	points.push(new GLatLng(35.298453,139.7747575));
	points.push(new GLatLng(35.2984505,139.7749147));
	points.push(new GLatLng(35.2982483,139.7757493));
	points.push(new GLatLng(35.2982068,139.7768213));
	points.push(new GLatLng(35.2983704,139.7776646));
	points.push(new GLatLng(35.2978328,139.7777258));
	points.push(new GLatLng(35.2980598,139.7774968));
	points.push(new GLatLng(35.298232,139.7773958));
	points.push(new GLatLng(35.2979653,139.7772105));
	points.push(new GLatLng(35.297936,139.7775433));
	points.push(new GLatLng(35.297771,139.7775368));
	points.push(new GLatLng(35.2982021,139.7775098));
	points.push(new GLatLng(35.2983053,139.7775394));
	points.push(new GLatLng(35.2980315,139.7776418));
	points.push(new GLatLng(35.298341,139.7776732));
	points.push(new GLatLng(35.2983557,139.7777829));
	points.push(new GLatLng(35.2981962,139.7780537));
	points.push(new GLatLng(35.2960561,139.7782383));
	points.push(new GLatLng(35.2955379,139.778305));
	points.push(new GLatLng(35.2944222,139.7784355));
	points.push(new GLatLng(35.2941116,139.7781758));
	points.push(new GLatLng(35.2938502,139.778215));
	points.push(new GLatLng(35.2937924,139.7785222));
	points.push(new GLatLng(35.2940048,139.7787604));
	points.push(new GLatLng(35.2944287,139.7789042));
	points.push(new GLatLng(35.2947296,139.7798626));
	points.push(new GLatLng(35.2951476,139.7804039));
	points.push(new GLatLng(35.295202,139.7809466));
	points.push(new GLatLng(35.2950056,139.7815898));
	points.push(new GLatLng(35.2946245,139.7823405));
	points.push(new GLatLng(35.2944812,139.7830738));
	points.push(new GLatLng(35.2947527,139.7847573));
	points.push(new GLatLng(35.2961046,139.7870502));
	points.push(new GLatLng(35.2968844,139.788281));
	points.push(new GLatLng(35.297152,139.7883974));
	points.push(new GLatLng(35.2971368,139.7883756));
	points.push(new GLatLng(35.2972538,139.7884947));
	points.push(new GLatLng(35.2979017,139.7900146));
	points.push(new GLatLng(35.2981038,139.7901666));
	points.push(new GLatLng(35.2976971,139.7894278));
	points.push(new GLatLng(35.2976666,139.789375));
	points.push(new GLatLng(35.2974227,139.7888834));
	points.push(new GLatLng(35.296972,139.7882709));
	points.push(new GLatLng(35.295752,139.7864783));
	points.push(new GLatLng(35.2948346,139.7854733));
	points.push(new GLatLng(35.2947058,139.7852832));
	points.push(new GLatLng(35.2942644,139.7841646));
	points.push(new GLatLng(35.293813,139.783383));
	points.push(new GLatLng(35.2936907,139.7831565));
	points.push(new GLatLng(35.293638,139.7830658));
	points.push(new GLatLng(35.293519,139.7816726));
	points.push(new GLatLng(35.2938397,139.780719));
	points.push(new GLatLng(35.2938955,139.7802516));
	points.push(new GLatLng(35.294015,139.7798109));
	points.push(new GLatLng(35.2940982,139.7795803));
	points.push(new GLatLng(35.2941159,139.7795472));
	points.push(new GLatLng(35.294321,139.7791262));
	points.push(new GLatLng(35.2943455,139.7790618));
	points.push(new GLatLng(35.2952604,139.7764692));
	points.push(new GLatLng(35.2955524,139.7756623));
	points.push(new GLatLng(35.2958336,139.7751151));
	points.push(new GLatLng(35.2960682,139.774654));
	points.push(new GLatLng(35.2963228,139.7741431));
	points.push(new GLatLng(35.2964119,139.7739799));
	points.push(new GLatLng(35.2966287,139.7735147));
	points.push(new GLatLng(35.296651,139.7734635));
	points.push(new GLatLng(35.2969616,139.772724));
	points.push(new GLatLng(35.2979399,139.7706786));
	points.push(new GLatLng(35.3019989,139.7609388));
	points.push(new GLatLng(35.3021396,139.7605548));
	points.push(new GLatLng(35.3023566,139.7599747));
	points.push(new GLatLng(35.3028138,139.7586797));
	points.push(new GLatLng(35.302892,139.7584733));
	points.push(new GLatLng(35.3030197,139.758074));
	points.push(new GLatLng(35.3034842,139.7565642));
	points.push(new GLatLng(35.303677,139.7559571));
	points.push(new GLatLng(35.304072,139.7546343));
	points.push(new GLatLng(35.3043073,139.7539164));
	points.push(new GLatLng(35.3043558,139.7537291));
	points.push(new GLatLng(35.3063916,139.7463758));
	points.push(new GLatLng(35.3064844,139.7460811));
	points.push(new GLatLng(35.3065607,139.7458898));
	points.push(new GLatLng(35.3067161,139.7455066));
	points.push(new GLatLng(35.3071144,139.7444039));
	points.push(new GLatLng(35.3074315,139.7434873));
	points.push(new GLatLng(35.3079672,139.7420713));
	points.push(new GLatLng(35.308426,139.740978));
	points.push(new GLatLng(35.3090945,139.7394134));
	points.push(new GLatLng(35.3102594,139.7366109));
	points.push(new GLatLng(35.3105819,139.7356698));
	points.push(new GLatLng(35.3106795,139.7353469));
	points.push(new GLatLng(35.310997,139.734367));
	points.push(new GLatLng(35.3110602,139.7341566));
	points.push(new GLatLng(35.3114441,139.7326593));
	points.push(new GLatLng(35.3115725,139.7322347));
	points.push(new GLatLng(35.3127532,139.7284762));
	points.push(new GLatLng(35.3129966,139.7276602));
	points.push(new GLatLng(35.3131282,139.7272526));
	points.push(new GLatLng(35.313454,139.7259316));
	points.push(new GLatLng(35.3137085,139.7249909));
	points.push(new GLatLng(35.3138342,139.7244667));
	points.push(new GLatLng(35.3139933,139.7237391));
	points.push(new GLatLng(35.3140429,139.7235287));
	points.push(new GLatLng(35.3141774,139.7229206));
	points.push(new GLatLng(35.3144683,139.7215745));
	points.push(new GLatLng(35.3145879,139.7208282));
	points.push(new GLatLng(35.3146321,139.7206169));
	points.push(new GLatLng(35.3149407,139.7193871));
	points.push(new GLatLng(35.3150272,139.7190944));
	points.push(new GLatLng(35.3156811,139.7165288));
	points.push(new GLatLng(35.3159566,139.7155124));
	points.push(new GLatLng(35.3164092,139.7135905));
	points.push(new GLatLng(35.3165583,139.7130006));
	points.push(new GLatLng(35.3166269,139.7125022));
	points.push(new GLatLng(35.3167599,139.7118956));
	points.push(new GLatLng(35.3168335,139.7115999));
	points.push(new GLatLng(35.3175752,139.7090061));
	points.push(new GLatLng(35.3178565,139.7079364));
	points.push(new GLatLng(35.3181204,139.7063711));
	points.push(new GLatLng(35.3181394,139.7062697));
	points.push(new GLatLng(35.3183285,139.7054459));
	points.push(new GLatLng(35.3184812,139.7048173));
	points.push(new GLatLng(35.3184951,139.7047118));
	points.push(new GLatLng(35.3185304,139.7044139));
	points.push(new GLatLng(35.3187666,139.7030388));
	points.push(new GLatLng(35.3190829,139.7006698));
	points.push(new GLatLng(35.3192068,139.7001538));
	points.push(new GLatLng(35.3193054,139.6998648));
	points.push(new GLatLng(35.3197425,139.6983494));
	points.push(new GLatLng(35.3203852,139.6959266));
	points.push(new GLatLng(35.320617,139.6951067));
	points.push(new GLatLng(35.3208169,139.6945224));
	points.push(new GLatLng(35.3209541,139.6941403));
	points.push(new GLatLng(35.3213518,139.6929314));
	points.push(new GLatLng(35.3215132,139.6924352));
	points.push(new GLatLng(35.3217161,139.6917181));
	points.push(new GLatLng(35.3221107,139.6904438));
	points.push(new GLatLng(35.3222037,139.6901572));
	points.push(new GLatLng(35.3231554,139.6862583));
	points.push(new GLatLng(35.3235946,139.6846817));
	points.push(new GLatLng(35.3237909,139.6839801));
	points.push(new GLatLng(35.3238452,139.6837793));
	points.push(new GLatLng(35.3242088,139.6824706));
	points.push(new GLatLng(35.324478,139.681717));
	points.push(new GLatLng(35.3246459,139.6812246));
	points.push(new GLatLng(35.3254975,139.6787876));
	points.push(new GLatLng(35.3257066,139.6782288));
	points.push(new GLatLng(35.3261247,139.6774229));
	points.push(new GLatLng(35.326684,139.6763485));
	points.push(new GLatLng(35.3279104,139.6740542));
	points.push(new GLatLng(35.3280614,139.6736899));
	points.push(new GLatLng(35.3284436,139.6724228));
	points.push(new GLatLng(35.3286183,139.6719449));
	points.push(new GLatLng(35.3288725,139.670946));
	points.push(new GLatLng(35.3290717,139.6702684));
	points.push(new GLatLng(35.3295465,139.6690362));
	points.push(new GLatLng(35.3296717,139.6687594));
	points.push(new GLatLng(35.3300428,139.6673799));
	points.push(new GLatLng(35.3301104,139.6669746));
	points.push(new GLatLng(35.3302589,139.6662588));
	points.push(new GLatLng(35.3302745,139.6661543));
	points.push(new GLatLng(35.3305082,139.6646244));
	points.push(new GLatLng(35.3305726,139.6643135));
	points.push(new GLatLng(35.3308936,139.6621762));
	points.push(new GLatLng(35.3309489,139.6618719));
	points.push(new GLatLng(35.3310798,139.6610474));
	points.push(new GLatLng(35.3311003,139.6609482));
	points.push(new GLatLng(35.3311359,139.6606341));
	points.push(new GLatLng(35.331179,139.6599855));
	points.push(new GLatLng(35.3311858,139.659882));
	points.push(new GLatLng(35.3312004,139.6595735));
	points.push(new GLatLng(35.3313383,139.6586071));
	points.push(new GLatLng(35.3314068,139.6583107));
	points.push(new GLatLng(35.3318063,139.6560801));
	points.push(new GLatLng(35.3318472,139.6553378));
	points.push(new GLatLng(35.3320505,139.6524069));
	points.push(new GLatLng(35.3320801,139.6521948));
	points.push(new GLatLng(35.3321557,139.6513517));
	points.push(new GLatLng(35.3321431,139.6510558));
	points.push(new GLatLng(35.3322185,139.6501297));
	points.push(new GLatLng(35.332232,139.648848));
	points.push(new GLatLng(35.3322954,139.6480878));
	points.push(new GLatLng(35.3323345,139.6465259));
	points.push(new GLatLng(35.3324422,139.6447872));
	points.push(new GLatLng(35.3327588,139.6416938));
	points.push(new GLatLng(35.3329654,139.6405831));
	points.push(new GLatLng(35.3330267,139.6398219));
	points.push(new GLatLng(35.3330133,139.6396769));
	points.push(new GLatLng(35.3329915,139.6390243));
	points.push(new GLatLng(35.3328089,139.638554));
	points.push(new GLatLng(35.3325924,139.6380875));
	points.push(new GLatLng(35.3304206,139.6315259));
	points.push(new GLatLng(35.3302037,139.6312177));
	points.push(new GLatLng(35.3299614,139.6307194));
	points.push(new GLatLng(35.3295986,139.6300713));
	points.push(new GLatLng(35.3293456,139.6295703));
	points.push(new GLatLng(35.3292382,139.6293288));
	points.push(new GLatLng(35.3292544,139.628692));
	points.push(new GLatLng(35.3298517,139.6270754));
	points.push(new GLatLng(35.3296868,139.6266369));
	points.push(new GLatLng(35.3291796,139.6259557));
	points.push(new GLatLng(35.3289219,139.6255793));
	points.push(new GLatLng(35.3286855,139.6250943));
	points.push(new GLatLng(35.3286067,139.6248749));
	points.push(new GLatLng(35.3286223,139.6248401));
	points.push(new GLatLng(35.3282771,139.6243383));
	points.push(new GLatLng(35.3274716,139.623229));
	points.push(new GLatLng(35.327695,139.6235045));
	points.push(new GLatLng(35.3283462,139.6244745));
	points.push(new GLatLng(35.3286911,139.6250014));
	points.push(new GLatLng(35.3287342,139.6250456));
	points.push(new GLatLng(35.329145,139.6245594));
	points.push(new GLatLng(35.3296114,139.6238988));
	points.push(new GLatLng(35.3297811,139.6236491));
	points.push(new GLatLng(35.3301865,139.62288));
	points.push(new GLatLng(35.3310772,139.6220247));
	points.push(new GLatLng(35.3313944,139.6217182));
	points.push(new GLatLng(35.3315138,139.621772));
	points.push(new GLatLng(35.3318087,139.6218045));
	points.push(new GLatLng(35.3319003,139.6219013));
	points.push(new GLatLng(35.3323836,139.6224592));
	points.push(new GLatLng(35.3327443,139.6228248));
	points.push(new GLatLng(35.3338035,139.6236017));
	points.push(new GLatLng(35.3343424,139.6237667));
	points.push(new GLatLng(35.3349156,139.6238671));
	points.push(new GLatLng(35.3359685,139.6238873));
	points.push(new GLatLng(35.3366244,139.6238381));
	points.push(new GLatLng(35.3377,139.6238386));
	points.push(new GLatLng(35.3383428,139.623877));
	points.push(new GLatLng(35.3396739,139.6238629));
	points.push(new GLatLng(35.340143,139.6238112));
	points.push(new GLatLng(35.3402915,139.6238165));
	points.push(new GLatLng(35.3419679,139.6232635));
	points.push(new GLatLng(35.3424323,139.6231129));
	points.push(new GLatLng(35.3427662,139.6230316));
	points.push(new GLatLng(35.3435856,139.6226622));
	points.push(new GLatLng(35.3436725,139.6225977));
	points.push(new GLatLng(35.3441126,139.6224902));
	points.push(new GLatLng(35.3444291,139.622421));
	points.push(new GLatLng(35.3450194,139.6225084));
	points.push(new GLatLng(35.3454493,139.6227384));
	points.push(new GLatLng(35.3460696,139.6230923));
	points.push(new GLatLng(35.3464009,139.6233252));
	points.push(new GLatLng(35.348172,139.624323));
	points.push(new GLatLng(35.3489987,139.624845));
	points.push(new GLatLng(35.3498845,139.625468));
	points.push(new GLatLng(35.350354,139.6260035));
	points.push(new GLatLng(35.3511674,139.6269895));
	points.push(new GLatLng(35.3520601,139.627541));
	points.push(new GLatLng(35.3531915,139.6279683));
	points.push(new GLatLng(35.3537734,139.6281294));
	points.push(new GLatLng(35.3540248,139.6281493));
	points.push(new GLatLng(35.3543266,139.6281785));
	points.push(new GLatLng(35.355449,139.6280392));
	points.push(new GLatLng(35.3559349,139.6280334));
	points.push(new GLatLng(35.3566151,139.6282222));
	points.push(new GLatLng(35.3567694,139.6281376));
	points.push(new GLatLng(35.3573969,139.6281661));
	points.push(new GLatLng(35.3583899,139.6284248));
	points.push(new GLatLng(35.3590361,139.6287898));
	points.push(new GLatLng(35.3591493,139.6287976));
	points.push(new GLatLng(35.3594216,139.6290104));
	points.push(new GLatLng(35.3601667,139.6294478));
	points.push(new GLatLng(35.3612398,139.6296902));
	points.push(new GLatLng(35.3614727,139.6297119));
	points.push(new GLatLng(35.3628375,139.6299866));
	points.push(new GLatLng(35.3629572,139.6300351));
	points.push(new GLatLng(35.3646896,139.6310131));
	points.push(new GLatLng(35.3659707,139.6312394));
	points.push(new GLatLng(35.367011,139.6314401));
	points.push(new GLatLng(35.3672493,139.6315555));
	points.push(new GLatLng(35.3677118,139.6319558));
	points.push(new GLatLng(35.3679446,139.6322822));
	points.push(new GLatLng(35.3688009,139.6333829));
	points.push(new GLatLng(35.369365,139.633936));
	points.push(new GLatLng(35.369674,139.6340339));
	points.push(new GLatLng(35.369738,139.6339978));
	points.push(new GLatLng(35.3707819,139.6336414));
	points.push(new GLatLng(35.3711422,139.6332061));
	points.push(new GLatLng(35.3712405,139.6331538));
	points.push(new GLatLng(35.3714969,139.6327744));
	points.push(new GLatLng(35.3719051,139.6318408));
	points.push(new GLatLng(35.3720741,139.6313746));
	points.push(new GLatLng(35.3721336,139.6308552));
	points.push(new GLatLng(35.3721332,139.6306841));
	points.push(new GLatLng(35.3724093,139.6291767));
	points.push(new GLatLng(35.3729235,139.6277867));
	points.push(new GLatLng(35.3729598,139.627683));
	points.push(new GLatLng(35.3732977,139.6271062));
	points.push(new GLatLng(35.3737451,139.6265141));
	points.push(new GLatLng(35.3739148,139.6259977));
	points.push(new GLatLng(35.3741443,139.6251564));
	points.push(new GLatLng(35.3743897,139.6244426));
	points.push(new GLatLng(35.3743971,139.624384));
	points.push(new GLatLng(35.3745196,139.6240526));


	// 表示の中心位置・サイズを算出します。
	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;
	}


	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;
}
