﻿function getImgUrl(Index){
	Data = new String(PointData[Index]);
	data = Data.split(",");

	with(ImgWin){

	window.document.open();
	window.document.write("<B>", data[1] , "</B>");
	if (data[3] == "" && data[4] == ""){
		window.document.write("<BR>");
		}
	else{
		window.document.write("<SPAN style='font-size:1em;'>---麦草ヒュッテから");
		}

	if (data[3] == ""){
		//経由表示なし
		void(0);
		}
	else{
		//経由表示
		window.document.write("<font color='blue'><b>" , data[3] , "経由</B></font>で");
		}

	if (data[4] == ""){
		//所要時間表示なし
		void(0);
		}
	else{
		//所要時間表示
		if (data[4] >= 60){
			window.document.write("<font color='red'><b>" , Math.floor(data[4]/60) , "時間");

			if (data[4]%60 != 0){
				window.document.write(data[4]%60 , "分</B></font></SPAN><BR>");
				}
			else{
				window.document.write("</B></font></SPAN><BR>");
				}
			}

		else{
			window.document.write("<font color='red'><b>" , data[4] , "分</B></font></SPAN><BR>");
			}

		}

	if (data[0] != "" && data[0] !="000"){

		if (data[0].indexOf("/") == -1){
			window.document.write("<a href='javascript:void(0)' onclick='window.close()' title='クリックするとこのウィンドウを閉じます'>");
			window.document.write("<img src='./image/image" + data[0] + ".jpg' width='320' height='240'></a><BR>");

			window.document.write("<div align='right'>撮影日：", data[2] ,"</div>");
			}
		else{
			imgdata = data[0].split("/");
//			for(i=0; i<imgdata.length; i++){
				window.document.write("<a href='javascript:void(0)' onclick='window.close()' title='クリックするとこのウィンドウを閉じます'>");
//				window.document.write("<img src='./image/image" + imgdata[i] + ".jpg' width='320' height='240'></a><BR>");
				window.document.write("<img src='./image/image" + imgdata[0] + ".jpg' width='320' height='240'></a><BR>");

				window.document.write("<div align='right'>撮影日：", data[2] ,"</div><BR>");
//				}

			}

		}
	else{}

	//解説
	window.document.write("<P style='line-height:140%;font-size:1em;'>", data[5], "</P><BR>");

/*
	//この場所のほかの画像を見る
	if (data[0].indexOf("/") != -1){
		imgdata = data[0].split("/");
		document.write("<a href='javascript:void(0)' onclick='showMoreImg()'>");
		document.write("<center>この場所のほかの画像(", imgdata.length - 1 ,"件)</center><br></a>");
		}
	else{}
*/

	window.document.write("<a href='javascript:void(0)' onclick='window.close()' title='クリックするとこのウィンドウを閉じます'>");
	window.document.write("<center>閉じる</center><br></a>");
	window.document.close();


	}

}

function showMoreImg(){
	window.document.open();
	imgdata = data[0].split("/");
	for(i=1; i<imgdata.length; i++){
		window.document.write("<a href='javascript:void(0)' onclick='window.close()' title='クリックするとこのウィンドウを閉じます'>");
		window.document.write("<img src='./image/image" + imgdata[i] + ".jpg' width='320' height='240'></a><BR>");
		window.document.write("<div align='right'>撮影日：", data[2] ,"</div><BR>");
		window.document.write("<a href='javascript:void(0)' onclick='window.close()' title='クリックするとこのウィンドウを閉じます'>");
		window.document.write("<center>閉じる</center><br></a>");
		}
	window.document.close();

}

function CloseWindow(){

	with(ImgWin){
	window.document.open();
	window.document.write("<a href='javascript:void(0)' onclick='window.close()' title='クリックするとこのウィンドウを閉じます'>");
	window.document.write("<center>閉じる</center><br></a>");
	window.document.close();


	}

}


