﻿imgpath = 0;
linkflag = 0;

komatsubarawork = "<p id=\"coment\">写真提供：小松原昌男さん（東久留米・ホタルを呼び戻す会）</p>"
omatawork = "<p id=\"coment\">写真提供：小俣直樹さん（中央大学 環境白門会）</p>"
shingashiwork = "<p id=\"coment\">写真提供：新河岸川水系水環境連絡会</p>"

do{
	r=Math.random();
	if(r<0.01){
		imgpath="2005/nanohanaochiai0418.jpg"; imgwidth="425"; imgheight="283";
		coment="<p id=\"coment\">菜の花と落合川</p><p id=\"coment\">写真提供：小松原昌男さん（東久留米・ホタルを呼び戻す会）</p>";
	}
	else if(r<0.02){
		imgpath="2004/1119minamisawayusui.jpg"; imgwidth=409; imgheight=307;
		coment="<p id=\"coment\">南沢湧水の水が湧いているアップです。</p>";
	}
	else if(r<0.03){
		imgpath="2004/1128_01.jpg"; imgwidth=794; imgheight=553;
		coment = komatsubarawork;
		linkflag = 1;
		linkpath = "activity/2004/1128.html"
	}
	else if(r<0.04){
		imgpath="2004/1128_02.jpg"; imgwidth=794; imgheight=553;
		coment = komatsubarawork;
		linkflag = 1;
		linkpath = "activity/2004/1128.html"
	}
	else if(r<0.05){
		imgpath="2004/1128_03.jpg"; imgwidth=794; imgheight=553;
		coment = komatsubarawork;
		linkflag = 1;
		linkpath = "activity/2004/1128.html"
	}
	else if(r<0.06){
		imgpath="2004/1128_04.jpg"; imgwidth=794; imgheight=553;
		coment = komatsubarawork;
		linkflag = 1;
		linkpath = "activity/2004/1128.html"
	}
	else if(r<0.07){
		imgpath="2004/1128_05.jpg"; imgwidth=794; imgheight=553;
		coment = komatsubarawork;
		linkflag = 1;
		linkpath = "activity/2004/1128.html"
	}
	else if(r<0.08){
		imgpath="2004/1128_06.jpg"; imgwidth=794; imgheight=553;
		coment = komatsubarawork;
		linkflag = 1;
		linkpath = "activity/2004/1128.html"
	}
	else if(r<0.09){
		imgpath="2004/1128_07.jpg"; imgwidth=794; imgheight=553;
		coment = komatsubarawork;
		linkflag = 1;
		linkpath = "activity/2004/1128.html"
	}
	else if(r<0.10){
		imgpath="2004/1128_08.jpg"; imgwidth=794; imgheight=553;
		coment = komatsubarawork;
		linkflag = 1;
		linkpath = "activity/2004/1128.html"
	}
	else if(r<0.11){
		imgpath="2004/1128_08.jpg"; imgwidth=794; imgheight=553;
		coment = komatsubarawork;
		linkflag = 1;
		linkpath = "activity/2004/1128.html"
	}
	else if(r<0.12){
		imgpath="2005/0221_01.jpg"; imgwidth=1122; imgheight=787;
		coment = komatsubarawork;
		linkflag = 1;
		linkpath = "activity/2005/0221.html"
	}
	else if(r<0.13){
		imgpath="2005/0221_02.jpg"; imgwidth=1122; imgheight=787;
		coment = komatsubarawork;
		linkflag = 1;
		linkpath = "activity/2005/0221.html"
	}
	else if(r<0.14){
		imgpath="2005/0221_03.jpg"; imgwidth=1122; imgheight=787;
		coment = komatsubarawork;
		linkflag = 1;
		linkpath = "activity/2005/0221.html"
	}
	else if(r<0.15){
		imgpath="2005/0327_01.jpg"; imgwidth=808; imgheight=567;
		coment = komatsubarawork;
		linkflag = 1;
		linkpath = "activity/2005/0327.html"
	}
	else if(r<0.16){
		imgpath="2005/0327_02.jpg"; imgwidth=808; imgheight=567;
		coment = komatsubarawork;
		linkflag = 1;
		linkpath = "activity/2005/0327.html"
	}
	else if(r<0.17){
		imgpath="2005/0327_03.jpg"; imgwidth=808; imgheight=567;
		coment = komatsubarawork;
		linkflag = 1;
		linkpath = "activity/2005/0327.html"
	}
	else if(r<0.18){
		imgpath="2005/0605_01.jpg"; imgwidth=600; imgheight=450;
		coment   = "<p id=\"coment\">2005年度身近な川の一斉調査</p>" + omatawork;
		linkflag = 1;
		linkpath = "activity/2005/0605.html"
	}
	else if(r<0.19){
		imgpath="2005/0605_02.jpg"; imgwidth=600; imgheight=450;
		coment   = "<p id=\"coment\">2005年度身近な川の一斉調査</p>" + omatawork;
		linkflag = 1;
		linkpath = "activity/2005/0605.html"
	}
	else if(r<0.20){
		imgpath="2005/0605_03.jpg"; imgwidth=600; imgheight=450;
		coment   = "<p id=\"coment\">2005年度身近な川の一斉調査</p>" + omatawork;
		linkflag = 1;
		linkpath = "activity/2005/0605.html"
	}
	else if(r<0.21){
		imgpath="2005/0605_04.jpg"; imgwidth=600; imgheight=450;
		coment   = "<p id=\"coment\">2005年度身近な川の一斉調査</p>" + omatawork;
		linkflag = 1;
		linkpath = "activity/2005/0605.html"
	}
	else if(r<0.22){
		imgpath="2005/0605_05.jpg"; imgwidth=600; imgheight=450;
		coment   = "<p id=\"coment\">2005年度身近な川の一斉調査</p>" + omatawork;
		linkflag = 1;
		linkpath = "activity/2005/0605.html"
	}
	else if(r<0.23){
		imgpath="2005/0605_06.jpg"; imgwidth=600; imgheight=450;
		coment   = "<p id=\"coment\">2005年度身近な川の一斉調査</p>" + omatawork;
		linkflag = 1;
		linkpath = "activity/2005/0605.html"
	}
	else if(r<0.24){
		imgpath="2005/0605_07.jpg"; imgwidth=600; imgheight=450;
		coment   = "<p id=\"coment\">2005年度身近な川の一斉調査</p>" + omatawork;
		linkflag = 1;
		linkpath = "activity/2005/0605.html"
	}
	else if(r<0.25){
		imgpath="2005/0605_08.jpg"; imgwidth=600; imgheight=450;
		coment   = "<p id=\"coment\">2005年度身近な川の一斉調査</p>" + omatawork;
		linkflag = 1;
		linkpath = "activity/2005/0605.html"
	}
	else if(r<0.26){
		imgpath="2005/0707_arahata.jpg"; imgwidth=826; imgheight=1169;
		coment   = "<p id=\"coment\">平成17年度 荒幡小学校4年生総合学習</p><p id=\"coment\">写真提供：江村高寿さん</p>";
		linkflag = 1;
		linkpath = "activity/2005/0605.html"
	}
	else if(r<0.27){
		imgpath="2006/1104_01start.jpg"; imgwidth=711; imgheight=533;
		coment   = shingashiwork;
		linkflag = 1;
		linkpath = "activity/2006/1104.html"
	}
	else if(r<0.28){
		imgpath="2006/1104_02_5Ebort.jpg"; imgwidth=711; imgheight=533;
		coment   = shingashiwork;
		linkflag = 1;
		linkpath = "activity/2006/1104.html"
	}
	else if(r<0.29){
		imgpath="2006/1104_03nearstart.jpg"; imgwidth=711; imgheight=533;
		coment   = shingashiwork;
		linkflag = 1;
		linkpath = "activity/2006/1104.html"
	}
	else if(r<0.30){
		imgpath="2006/1104_04koohone.jpg"; imgwidth=711; imgheight=533;
		coment   = shingashiwork;
		linkflag = 1;
		linkpath = "activity/2006/1104.html"
	}
	else if(r<0.31){
		imgpath="2006/1104_05himon.jpg"; imgwidth=711; imgheight=533;
		coment   = shingashiwork;
		linkflag = 1;
		linkpath = "activity/2006/1104.html"
	}
	else if(r<0.32){
		imgpath="2008/0706_01.jpg"; imgwidth=640; imgheight=480;
		coment   = shingashiwork;
		linkflag = 1;
		linkpath = "<p id=\"coment\">2008年度 データ入力・検討会</p>" + "activity/2008/0622-0706.html"
	}
	else if(r<0.33){
		imgpath="2008/0525_01.jpg"; imgwidth=640; imgheight=480;
		coment   = "<p id=\"coment\">2008年度 一斉調査リハーサル</p>" + shingashiwork;
		linkflag = 1;
		linkpath = "activity/2008/0525.html"
	}
	else if(r<0.34){
		imgpath="2008/0525_02.jpg"; imgwidth=640; imgheight=480;
		coment   = "<p id=\"coment\">2008年度 一斉調査リハーサル</p>" + shingashiwork;
		linkflag = 1;
		linkpath = "activity/2008/0525.html"
	}
	else if(r<0.35){
		imgpath="2008/0525_03.jpg"; imgwidth=640; imgheight=480;
		coment   = "<p id=\"coment\">2008年度 一斉調査リハーサル</p>" + shingashiwork;
		linkflag = 1;
		linkpath = "activity/2008/0525.html"
	}
	else if(r<0.36){
		imgpath="2008/0525_04.jpg"; imgwidth=640; imgheight=480;
		coment   = "<p id=\"coment\">2008年度 一斉調査リハーサル</p>" + shingashiwork;
		linkflag = 1;
		linkpath = "activity/2008/0525.html"
	}
	else if(r<0.37){
		imgpath="2008/0525_05.jpg"; imgwidth=640; imgheight=480;
		coment   = "<p id=\"coment\">2008年度 一斉調査リハーサル</p>" + shingashiwork;
		linkflag = 1;
		linkpath = "activity/2008/0525.html"
	}
	else if(r<0.38){
		imgpath="2008/0525_06.jpg"; imgwidth=640; imgheight=480;
		coment   = "<p id=\"coment\">2008年度 一斉調査リハーサル</p>" + shingashiwork;
		linkflag = 1;
		linkpath = "activity/2008/0525.html"
	}
	else {}
} while(imgpath==0)

if(imgwidth > 528) {
	imgwidthtxt = 528;
	imgheighttxt = imgheight * 528 / imgwidth;
}
else {
	imgwidthtxt = imgwidth;
	imgheighttxt = imgheight;
}

if (linkflag == 1) {
	document.write("<div id=\"topimg\"><a href=\"" + linkpath + "\"><img src=\"images/" + imgpath + "\" width=\"" + imgwidthtxt + "\" height=\"" + imgheighttxt + "\" alt=\"トップ画像\"/></a></div>" + coment + "<p>画像をクリックすると当日のページへ移動します。</p>");
}
else {
	document.write("<div id=\"topimg\"><img src=\"images/" + imgpath + "\" width=\"" + imgwidthtxt + "\" height=\"" + imgheighttxt + "\" alt=\"トップ画像\"/></div>" + coment);
	
}
