// Generated by trk2googlemaps and kml ( http://etoh.minidns.net/gps/ )
// 本コードはtrk2googlemaps and kmlによって自動生成されました。
numofwaypoints=0;
posofwaypoints=0;
numofphotos=15;
posofphotos=0;
waypoint_markers = [];
waypoint_infos   = [];
photo_markers    = [];
photo_infos      = [];
var points = [];
var map;
var currentzoom;
var key = "ABQIAAAANH23qKVVYp-Ce4L2A2JIehR8a0MCIjlbwdS61MB5LIeWccDibRQ1pSwj0273r6fxq1iLeFTOSZzmgg";
   

// ウェイポイント表示用関数
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 = [];

	// トラックデータ列です。
		wpt_points.push(new GLatLng(34.9536833333333,137.167683333333));
	wpt_points.push(new GLatLng(34.9543,137.168133333333));
	wpt_points.push(new GLatLng(34.9585833333333,137.158116666667));
	wpt_points.push(new GLatLng(34.9587833333333,137.15795));
	wpt_points.push(new GLatLng(34.96215,137.158416666667));
	wpt_points.push(new GLatLng(34.9645333333333,137.1589));
	wpt_points.push(new GLatLng(34.9652,137.159183333333));
	wpt_points.push(new GLatLng(34.9657,137.159416666667));
	wpt_points.push(new GLatLng(34.965,137.15925));
	wpt_points.push(new GLatLng(34.9664833333333,137.158383333333));
	wpt_points.push(new GLatLng(34.9660333333333,137.1596));
	wpt_points.push(new GLatLng(34.9690333333333,137.162216666667));
	wpt_points.push(new GLatLng(34.9689666666667,137.162666666667));
	wpt_points.push(new GLatLng(34.9685,137.162983333333));
	wpt_points.push(new GLatLng(34.9694666666667,137.16285));


	// 表示の中心位置・サイズを算出します。
	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,137.167683333333,34.9536833333333,"<b><a href=\""+relativepathtomainhtml+"#photoID1\">P1010865</a></b><br /><a href=\""+relativepathtosubfolder+"P1010865.jpg\"  target=\"_blank\"><img src=\""+relativepathtosubfolder+"P1010865-thumb.jpg\" border=\"0\" width=\"128\" height=\"96\" /></a><br /><small>2008:09:01 12:44:29<br />E137°10′3.66″<br />N34°57′13.26″<br />13m<br />愛知県岡崎市明大寺町字川端<hr />岡崎市街地，明代橋から乙川の上流川を見る．この付近では市街地全体が台地上にある地形になっており，堤防は事実上存在しない．橋の路面から現在の水面までの比高は8～10m程度．</small>");
	addWayPoints(map, 1,137.168133333333,34.9543,"<b><a href=\""+relativepathtomainhtml+"#photoID2\">P1010867</a></b><br /><a href=\""+relativepathtosubfolder+"P1010867.jpg\"  target=\"_blank\"><img src=\""+relativepathtosubfolder+"P1010867-thumb.jpg\" border=\"0\" width=\"128\" height=\"96\" /></a><br /><small>2008:09:01 12:48:47<br />E137°10′5.28″<br />N34°57′15.48″<br />14m<br />愛知県岡崎市唐沢町<hr />明代橋の橋脚．この付近では，洪水痕跡から，今回の出水による洪水の到達位置はほぼ高水敷(手前の草地面)の表面くらい．橋脚に付着したゴミは洪水痕跡よりやや低い．すなわち，乙川からの越水(はんらん)があったわけではない．</small>");
	addWayPoints(map, 1,137.158116666667,34.9585833333333,"<b><a href=\""+relativepathtomainhtml+"#photoID3\">P1010886</a></b><br /><a href=\""+relativepathtosubfolder+"P1010886.jpg\"  target=\"_blank\"><img src=\""+relativepathtosubfolder+"P1010886-thumb.jpg\" border=\"0\" width=\"128\" height=\"96\" /></a><br /><small>2008:09:01 13:34:33<br />E137°9′29.22″<br />N34°57′30.90″<br />16m<br />愛知県岡崎市康生通西四丁目<hr />岡崎市康生通西四丁目，龍城橋から伊賀川上流側を見る．この付近では河道内が親水公園風に整備されている．この付近で，橋上の路面高さで，市街地側(岡崎公園前付近)から比高5mほど低くなっている．右側が市街地(台地側)，左側が低地側．</small>");
	addWayPoints(map, 1,137.15795,34.9587833333333,"<b><a href=\""+relativepathtomainhtml+"#photoID4\">P1010887</a></b><br /><a href=\""+relativepathtosubfolder+"P1010887.jpg\"  target=\"_blank\"><img src=\""+relativepathtosubfolder+"P1010887-thumb.jpg\" border=\"0\" width=\"128\" height=\"96\" /></a><br /><small>2008:09:01 13:39:48<br />E137°9′28.62″<br />N34°57′31.62″<br />16m<br />愛知県岡崎市康生町<hr />龍城橋の下．この付近で伊賀川の洪水痕跡は，現水面+2.0m，高水敷+0.5mくらい．</small>");
	addWayPoints(map, 1,137.158416666667,34.96215,"<b><a href=\""+relativepathtomainhtml+"#photoID5\">P1010895</a></b><br /><a href=\""+relativepathtosubfolder+"P1010895.jpg\"  target=\"_blank\"><img src=\""+relativepathtosubfolder+"P1010895-thumb.jpg\" border=\"0\" width=\"128\" height=\"96\" /></a><br /><small>2008:09:01 13:51:49<br />E137°9′30.30″<br />N34°57′43.74″<br />18m<br />愛知県岡崎市西魚町<hr />岡崎市西魚町，柿田橋より上流側では，河道内が居住地として利用されている形態が見られる．</small>");
	addWayPoints(map, 1,137.1589,34.9645333333333,"<b><a href=\""+relativepathtomainhtml+"#photoID6\">P1010902</a></b><br /><a href=\""+relativepathtosubfolder+"P1010902.jpg\"  target=\"_blank\"><img src=\""+relativepathtosubfolder+"P1010902-thumb.jpg\" border=\"0\" width=\"128\" height=\"96\" /></a><br /><small>2008:09:01 14:00:51<br />E137°9′32.04″<br />N34°57′52.32″<br />18m<br />愛知県岡崎市元能見町<hr />岡崎市城北町．この付近では，河道内の両岸に住家が立地している形態が見られる．これらの民家は，2階が堤防上面(ただし写真右側はそにまま台地面に続く)，1階が河道内という形態．</small>");
	addWayPoints(map, 1,137.159183333333,34.9652,"<b><a href=\""+relativepathtomainhtml+"#photoID7\">P1010905</a></b><br /><a href=\""+relativepathtosubfolder+"P1010905.jpg\"  target=\"_blank\"><img src=\""+relativepathtosubfolder+"P1010905-thumb.jpg\" border=\"0\" width=\"128\" height=\"96\" /></a><br /><small>2008:09:01 14:03:18<br />E137°9′33.06″<br />N34°57′54.72″<br />18m<br />愛知県岡崎市城北町<hr />1階部分が損壊した民家．この民家の両側のように，所々，民家が移転したあとと思われる空き地が見られる．</small>");
	addWayPoints(map, 1,137.159416666667,34.9657,"<b><a href=\""+relativepathtomainhtml+"#photoID8\">P1010908</a></b><br /><a href=\""+relativepathtosubfolder+"P1010908.jpg\"  target=\"_blank\"><img src=\""+relativepathtosubfolder+"P1010908-thumb.jpg\" border=\"0\" width=\"128\" height=\"96\" /></a><br /><small>2008:09:01 14:04:47<br />E137°9′33.90″<br />N34°57′56.52″<br />17m<br />愛知県岡崎市元能見町<hr /></small>");
	addWayPoints(map, 1,137.15925,34.965,"<b><a href=\""+relativepathtomainhtml+"#photoID9\">P1010917</a></b><br /><a href=\""+relativepathtosubfolder+"P1010917.jpg\"  target=\"_blank\"><img src=\""+relativepathtosubfolder+"P1010917-thumb.jpg\" border=\"0\" width=\"128\" height=\"96\" /></a><br /><small>2008:09:01 14:10:57<br />E137°9′33.30″<br />N34°57′54.00″<br />19m<br />愛知県岡崎市城北町<hr />岡崎市城北町．自宅にいた80歳の女性が流された死亡したと見られる現場付近．付近の民家と同様に，この家も1階が河道内で，2階が堤防上面の道路に面した形態．</small>");
	addWayPoints(map, 1,137.158383333333,34.9664833333333,"<b><a href=\""+relativepathtomainhtml+"#photoID10\">P1010921</a></b><br /><a href=\""+relativepathtosubfolder+"P1010921.jpg\"  target=\"_blank\"><img src=\""+relativepathtosubfolder+"P1010921-thumb.jpg\" border=\"0\" width=\"128\" height=\"96\" /></a><br /><small>2008:09:01 14:32:23<br />E137°9′30.18″<br />N34°57′59.34″<br />16m<br />愛知県岡崎市城北町<hr />岡崎市城北町．この付近で伊賀川は手前側低地に比べかなり高い位置にある．この付近から，中央の信号(中橋)付近まで比高4-5m．ただし，この付近の宅地に浸水の痕跡はない．</small>");
	addWayPoints(map, 1,137.1596,34.9660333333333,"<b><a href=\""+relativepathtomainhtml+"#photoID11\">P1010925</a></b><br /><a href=\""+relativepathtosubfolder+"P1010925.jpg\"  target=\"_blank\"><img src=\""+relativepathtosubfolder+"P1010925-thumb.jpg\" border=\"0\" width=\"128\" height=\"96\" /></a><br /><small>2008:09:01 14:46:52<br />E137°9′34.56″<br />N34°57′57.72″<br />18m<br />愛知県岡崎市元能見町<hr />岡崎市城北町．伊賀川の中橋．橋の路面から水面までの高さは約4m，橋の幅13m．この付近では橋の直下まで水位が上がった模様．</small>");
	addWayPoints(map, 1,137.162216666667,34.9690333333333,"<b><a href=\""+relativepathtomainhtml+"#photoID12\">P1010947</a></b><br /><a href=\""+relativepathtosubfolder+"P1010947.jpg\"  target=\"_blank\"><img src=\""+relativepathtosubfolder+"P1010947-thumb.jpg\" border=\"0\" width=\"128\" height=\"96\" /></a><br /><small>2008:09:01 15:27:34<br />E137°9′43.98″<br />N34°58′8.52″<br />17m<br />愛知県岡崎市伊賀町<hr />岡崎市伊賀町．伊賀川(左側)の堤防と台地面に囲まれた凹地状の地形(右側)がみられる．左側の赤色コーン付近に越水の痕跡があり，ここからの越水などで右側の宅地が浸水したように思われる．</small>");
	addWayPoints(map, 1,137.162666666667,34.9689666666667,"<b><a href=\""+relativepathtomainhtml+"#photoID13\">P1010950</a></b><br /><a href=\""+relativepathtosubfolder+"P1010950.jpg\"  target=\"_blank\"><img src=\""+relativepathtosubfolder+"P1010950-thumb.jpg\" border=\"0\" width=\"128\" height=\"96\" /></a><br /><small>2008:09:01 15:36:09<br />E137°9′45.60″<br />N34°58′8.28″<br />18m<br />愛知県岡崎市伊賀町<hr />岡崎市伊賀町．この付近では浸水深が深く，道路面+2.8mくらい．左右の生け垣を越えている．</small>");
	addWayPoints(map, 1,137.162983333333,34.9685,"<b><a href=\""+relativepathtomainhtml+"#photoID14\">P1010956</a></b><br /><a href=\""+relativepathtosubfolder+"P1010956.jpg\"  target=\"_blank\"><img src=\""+relativepathtosubfolder+"P1010956-thumb.jpg\" border=\"0\" width=\"128\" height=\"96\" /></a><br /><small>2008:09:01 15:55:46<br />E137°9′46.74″<br />N34°58′6.60″<br />20m<br />愛知県岡崎市伊賀町<hr />岡崎市伊賀町．自宅にいた76歳女性が浸水により死亡したと見られる現場付近．2階近くまで浸水した痕跡が残る家もある．この写真は，高位側の段丘面(を延長して盛り土したと思われる駐車場)から見下ろす形で撮影しており，この面は浸水していない．</small>");
	addWayPoints(map, 1,137.16285,34.9694666666667,"<b><a href=\""+relativepathtomainhtml+"#photoID15\">P1010964</a></b><br /><a href=\""+relativepathtosubfolder+"P1010964.jpg\"  target=\"_blank\"><img src=\""+relativepathtosubfolder+"P1010964-thumb.jpg\" border=\"0\" width=\"128\" height=\"96\" /></a><br /><small>2008:09:01 16:05:48<br />E137°9′46.26″<br />N34°58′10.08″<br />16m<br />愛知県岡崎市伊賀町<hr />岡崎市伊賀町．伊賀川から越水したと思われる箇所．追堀が形成されている．家屋の壁の損壊などは見られない．</small>");


	if (numofwaypoints == 0)
	{
		hiddenLAYER('waypointcombo');
	}
	if (numofphotos==0)
	{
		hiddenLAYER('photocombo');
	}
	if (callHiddenLayers==1)
	{
		hiddenLayers();
	}
	
} // end of load() function.



// 指定された写真へジャンプ
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()
{
}

// 指定したレイヤーを非表示にする
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;
}
