maxUrl = 19;
minUrl = 03;
title = "photo contest";
mainTitle = "　紀 南　 地 域 写 真 コ ン テ ス ト　";
titleBanner = "./data/backBanner.gif";
bgClr  = "#fc0";
h4clr  = "#30c";
blankClr = "#3333cc";
upperClr = "#009933";
lowerBgClr = "#3300cc";
warningUpper = "<form onClick=msg() style='background-color:white;'><BR>";
warningLower = "<BR><HR SIZE=1 noshade width=500><font style='font-size:11px;color:#FFF'>全ての写真の著作権は 紀南地域活性化協議会 及び 御浜町にあります<BR>全ての画像の無断使用を禁じます</font><HR SIZE=1 noshade width=500>"; 	// 著作権に関する表示写真下部
warningIndex = "<BR><HR SIZE=3><font style='font-size:11px;color:#F60'>全ての写真の著作権は 紀南地域活性化協議会にあります<BR>全ての画像の無断使用を禁じます</font><HR SIZE=3>"; 	// 著作権に関する表示写真下部
warningDetail = "『くまどこ』がhttp://staff1.kumadoco.net/public/kumanophotos/のURL以下においてインターネット上に提供している全ての写真の著作権は、紀南地域活性化協議会が有します。\nこれらの著作物の一部または全部を、無断にて複製・二次的に使用することは著作権法で禁じられています。\n\nご利用に関するお問い合わせは、御浜町役場産業建設課まで御願い致します。";
userAgent = window.navigator.userAgent; // ブラウザ情報（スクリプトで取得）変更厳禁禁忌
if (window.location.search.match(/jpg/)) { fileType = "photos"; }
else { fileType = "any"; }
if ((userAgent.match(/OPERA/i)) || (userAgent.match(/Opera/i))) { browserType = "OPERA"; }
else if (userAgent.match(/MSIE/i)) { browserType = "MSIE"; }
else { browserType = "MSIE"; }
if (window.location.protocol.match(/http/i)) {
	protType = "http";
	stringUrl = window.location.protocol + "//" + window.location.hostname + window.location.pathname + window.location.search;
}
else {
	protType = "file";
	stringUrl = window.location.pathname + window.location.search;
}
function mdown(e) {
	if (navigator.appName == "Microsoft Internet Explorer") { if (event.button & 2) { return(false); } }
	else if (navigator.appName == "Netscape") { if (e.which == 3) { return(false); } }
}
if (document.all) { document.onmousedown = mdown; }
if (document.lowers) {
	window.onmousedown = mdown;
	window.captureEvents(Event.MOUSEDOWN);
}
document.write("<LINK rel='stylesheet' href='data/styleData.css' type='text/css'>");
document.write("</HEAD>");
headerinfo = "<HEAD><META http-equiv=Content-Type content=text/html; charset=Shift_JIS><META http-equiv=Content-Style-Type content=text/css><TITLE>" + title + "</TITLE><LINK rel=stylesheet href=data/styleData.css type=text/css></HEAD>";
function msg() { alert(warningDetail) }

if (window.location.pathname.match(/index.html/i)) {
	document.write("<FRAMESET rows='80,605,3,80' frameborder='NO' border='0'>");
	document.write("<FRAME src='upperMenu.html' noresize marginwidth='0' marginheight='0' scrolling='NO' name='upper'>");
	document.write("<FRAME src='body.html' noresize marginwidth='0' marginheight='0' name='body'>");
	document.write("<frame src='blank.html' noresize marginwidth='0' marginheight='0' scrolling='no' name='blank'>");
	document.write("<FRAME src='lowerMenu.html' noresize marginwidth='0' marginheight='0' scrolling='no' name='lower'>"); 
	document.write("<NOFRAMES>");
	document.write("</NOFRAMES>");
	document.write("</FRAMESET>");
}
else if (window.location.pathname.match(/blank/i)) {
	document.write(headerinfo);
	document.write("<body style=background-color:" + upperClr + ">");
	document.write("<small style=font-size:1px>&nbsp;</small></body>");
}
else if (window.location.pathname.match(/upperMenu/i)) {
//	document.write(headerinfo);
	document.write("<body style=background-color:" + bgClr + " oncontextmenu=\"return false;\">");
	document.write("<center>");
	document.write("<img src='" + titleBanner + "'>");
	document.write("<font style='font-size:4px'>&nbsp;<BR></font>");
	for (count = minUrl; count <= maxUrl; count++) {
		if (count < 10) { document.write("&nbsp;<a href='body.html?selYear=h0" + count + "' target=body style='color:navy;font-size:12px' onClick=\"window.open('lowerMenu.html?key=h0" + count + "', 'lower')\">[H0" + count + "]</a>&nbsp;"); }
		if (count == 18) { document.write("<br>"); }
		if (count >= 10) {
			document.write("&nbsp;<a href='body.html?selYear=h" + count + "' target=body style='color:navy;font-size:12px' onClick=\"window.open('lowerMenu.html?key=h" + count + "', 'lower')\">[H" + count + "]</a>&nbsp;"); 
		}
		if (count >= 18) { document.write("&nbsp;<a href='./h" + count + "/loc_map.html' target='_blank' style='color:navy;font-size:12px'>[H" + count + "：地図]</a>&nbsp;"); }
	}
	document.write("</center></body>");
}
else if (window.location.pathname.match(/lowerMenu/i)) {
//	document.write(headerinfo);
	document.write("<BODY style=background-color:" + lowerBgClr + " oncontextmenu=\"return false;\"><center>");
	if (window.location.search.slice(8,10) != "" ) {
		selYear = window.location.search.slice(5,8);
		document.write("<SCRIPT type='text/javascript' src='./" + selYear + "/photoList.js'></SCRIPT>");
	} else {
		if ((window.location.search) && (! window.location.search.match(/search/))) {
			document.write("<B class=mid style='color:white'> H" + window.location.search.slice(6,8) + "の一覧</font></b><BR>");
		}
		document.write("<small style=color:" + bgClr + ">他の年の作品もどうぞ！</small>");
		document.write("<br>");
	}
}
else if (window.location.pathname.match(/body/i)) {
//	document.write(headerinfo);
	if (window.location.search.match(/search/)) {
		document.write("");
	} else {	
	if (window.location.pathname.match(/body.html/i)) { qtyPhotos = 0; qtySnap = 0; fileType = "topIndex"; fileName = ""; selYear = ""; }
	if (window.location.search.match(/h03/i)) { qtyPhotos = 50; qtySnap = 0; fileType = "y"; selYear = "h03"; fileName = ""; }
	else if (window.location.search.match(/h04/i)) { qtyPhotos = 55; qtySnap = 0; fileType = "y"; selYear = "h04"; fileName = ""; }
	else if (window.location.search.match(/h05/i)) { qtyPhotos = 55; qtySnap = 0; fileType = "y"; selYear = "h05"; fileName = ""; }
	else if (window.location.search.match(/h06/i)) { qtyPhotos = 54; qtySnap = 0; fileType = "y"; selYear = "h06"; fileName = ""; }
	else if (window.location.search.match(/h07/i)) { qtyPhotos = 53; qtySnap = 0; fileType = "y"; selYear = "h07"; fileName = ""; }
	else if (window.location.search.match(/h08/i)) { qtyPhotos = 57; qtySnap = 0; fileType = "y"; selYear = "h08"; fileName = ""; }
	else if (window.location.search.match(/h09/i)) { qtyPhotos = 60; qtySnap = 0; fileType = "y"; selYear = "h09"; fileName = ""; }
	else if (window.location.search.match(/h10/i)) { qtyPhotos = 45; qtySnap = 0; fileType = "y"; selYear = "h10"; fileName = ""; }
	else if (window.location.search.match(/h11/i)) { qtyPhotos = 49; qtySnap = 0; fileType = "y"; selYear = "h11"; fileName = ""; }
	else if (window.location.search.match(/h12/i)) { qtyPhotos = 48; qtySnap = 0; fileType = "y"; selYear = "h12"; fileName = ""; }
	else if (window.location.search.match(/h13/i)) { qtyPhotos = 39; qtySnap = 5; fileType = "y"; selYear = "h13"; fileName = ""; }
	else if (window.location.search.match(/h14/i)) { qtyPhotos = 37; qtySnap = 0; fileType = "y"; selYear = "h14"; fileName = ""; }
	else if (window.location.search.match(/h15/i)) { qtyPhotos = 39; qtySnap = 0; fileType = "y"; selYear = "h15"; fileName = ""; }
	else if (window.location.search.match(/h16/i)) { qtyPhotos = 46; qtySnap = 0; fileType = "y"; selYear = "h16"; fileName = ""; }
	else if (window.location.search.match(/h17/i)) { qtyPhotos = 37; qtySnap = 0; fileType = "y"; selYear = "h17"; fileName = ""; }
	else if (window.location.search.match(/h18/i)) { qtyPhotos = 32; qtySnap = 0; fileType = "y"; selYear = "h18"; fileName = ""; }
	else if (window.location.search.match(/h19/i)) { qtyPhotos = 22; qtySnap = 0; fileType = "y"; selYear = "h19"; fileName = ""; }
	if (window.location.search.match(/jpg/)) {
		minUrl = 1;
		maxUrl = qtyPhotos;
		minSnap = 1;
		maxSnap = qtySnap;
		fileType = "photos";
		photoType = "img";
		if (window.location.search.match(/snap/)) {
			selYear = window.location.search.slice(5,8);
			photoType = "snap";
			maxUrl = qtySnap;
		}
		else if (window.location.pathname.match(/img/)) { selYear = window.location.search.slice(6,8); }
		if ((window.location.search.match(/img/i)) || (window.location.search.match(/snap/i))) { fileName = window.location.search.slice(8); }
		filePath = selYear + "\/resizedM\/" + fileName;
	}
	if (fileType == "photos") { document.write("<BODY bgcolor=black oncontextmenu=\"return false;\">"); }
	else { document.write("<body bgcolor=white oncontextmenu=\"return false;\">"); }
	if (fileType == "y") { thisUrl = window.location.search.slice(10); }
	else if (fileType == "photos") {
		if (photoType == "img")  { thisUrl = window.location.search.slice(11,14); }
		if (photoType == "snap") { thisUrl = window.location.search.slice(12,15); }
	}
	else { thisUrl = ""; }
	thisUrl = thisUrl - 0;
	nextUrl = thisUrl + 1;
	if (nextUrl < 10) {
		if (fileType == "photos") { nextUrl = "00" + nextUrl; }
		else { nextUrl = "0" + nextUrl ; }
	} else if ((nextUrl < 100) && (fileType == "photos")) { nextUrl = "0" + nextUrl; }
	befrUrl = thisUrl - 1;
	if (befrUrl < 10) {
		if (fileType == "photos") { befrUrl = "00" + befrUrl; }
		else { befrUrl = "0" + befrUrl ; }
	} else if ((befrUrl < 100) && (fileType == "photos")) { befrUrl = "0" + befrUrl; }
	document.write("<center><table width=100% cellspacing=0 cellpadding=3 border=0 height=20 style=background-color:black><TR>");
	if (fileType == "topIndex") {
		document.write("<td align=center style=background-color:" + upperClr + "><B class=mid style=color:orange>");
		document.write("上のメニューから見たい年をクリックしてください");
		document.write("</b></td></tr></table>");
		document.write("<div style='border : 3px inset #f0f0ff; background-color : #f0f0ff; padding : 5px; margin : 20px'><a href='./h19/loc_map.html' title='平成１９年度受賞作品' target='_parent'>地図から見る最新（平成19年度分）の受賞作品</a></div>");
		document.write("<center><img src=./data/coverIllust.gif style='border-top:20px solid white'></center><BR><BR>");
		document.write("<CENTER>" + warningUpper + "<font style='font-size:14px;border-bottom:2px solid navy;background-color:#def;'>必ずお読みください：著作権に関するご注意</font></form></CENTER>");
		
	} else if (fileType == "y") {
		if (befrUrl >= minUrl) {
			document.write("<td align=right width=33% style=background-color:" + upperClr + ">");
			document.write("<a href='body.html?selYear=h" + befrUrl + "' style=color:#cff onClick=\"window.open('lowerMenu.html?key=h" + befrUrl + "', 'lower')\">");
			document.write("&lt;&lt;&lt;前の年 (H" + befrUrl + ")</a>");
			document.write("&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;</td>");
		} else { document.write("<td align=right width=33% style='color:#cff;background-color:" + upperClr + "'> - &nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;</td>"); }
	
		document.write("<td align=center style=background-color:" + upperClr + ">");
		document.write("<a href='body.html' style=font-weight:normal;color:#cff onClick=\"window.open('lowerMenu.html', 'lower')\">最初へ</a></td>");	
		if (nextUrl <= maxUrl) {
			document.write("<td align=left width=33% style=background-color:" + upperClr + ">&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;");
			document.write("<a href='body.html?selYear=h" + nextUrl + "' style=color:#cff onClick=\"window.open('lowerMenu.html?key=h" + nextUrl + "', 'lower')\">");
			document.write("次の年(H" + nextUrl + ") &gt;&gt;&gt;</a></td></tr>");
		} else { document.write("<td align=left style=color:#cff;background-color:" + upperClr + " width=33%>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; - </td></tr>"); }
		document.write("</table>");
		if (qtyPhotos > 0) {
			for (count = 1; count <= qtyPhotos; count++) {
				if (count < 10) { count = "00" + count; }
				else if (count < 100) { count = "0" + count; }
				document.write(" <a href='body.html?key=" + selYear + "img" + count + ".jpg' target=body");
				document.write(" onClick=\"window.open('./lowerMenu.html?key=" + selYear + count + "' , 'lower')\">");
				document.write("<img src=./" + selYear + "/resizedSS/img" + count + ".jpg style='border:2px solid white' alt='img" + count + "'>");
				document.write("</a> ");
			}
		}
		if (qtySnap > 0) {
			document.write("<hr size=1 noshade>");
			document.write("[ ↓ スナップ写真の部 ↓ ]<BR>");
			for (count = 1; count <= qtySnap; count++) {
				if (count < 10) { count = "00" + count; }
				else if (count < 100) { count = "0" + count; }
				document.write(" <a href='body.html?key=" + selYear + "snap" + count + ".jpg' target=body");
				document.write(" onClick=\"window.open('./lowerMenu.html?key=" + selYear + "snap" + count + "' , 'lower')\">");
				document.write("<img src='./" + selYear + "/resizedSS/snap" + count + ".jpg' style='border:2px solid white' alt='snap" + count + "'>");
				document.write("</a>");
			}
		}
		document.write(warningIndex);
		document.write("</table>");

	}
	if (fileType == "photos") {
		document.write("<td align=right style='color:#cff;background-color:#093' width='33%'" + upperClr + ">");
		if (befrUrl >= minUrl) {
			if (photoType == "snap") { befrType = "snap"; }
			else { befrType = "img"; }
			befrHref = "<a href='body.html?key=" + selYear + befrType + befrUrl + ".jpg' style=color:#cff target=body onClick=\"window.open('./lowerMenu.html?key=" + selYear + befrType + befrUrl + "' , 'lower')\">";
			document.write(befrHref);
			document.write("&lt;&lt;&lt; ひとつ前へ</a>");
		} else {
			if (photoType == "snap") {
				befrUrl = "001";
				befrType = "img";
				befrHref = "<a href='body.html?key=" + selYear + befrType + befrUrl + ".jpg' style=color:#cff target=body onClick=\"window.open('./lowerMenu.html?key=" + selYear + befrType + befrUrl + "' , 'lower')\">";
				document.write(befrHref);
				document.write("&lt;&lt;&lt;一般写真</a>&nbsp;&nbsp;&nbsp;&nbsp;");
			}
			document.write(" - ");
		}
	
		document.write("&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;</td>");
		document.write("<td align=center style=background-color:#093>");
		document.write("<a href='body.html?selYear=" + selYear + "' target=body style=color:yellow onClick=\"window.open('lowerMenu.html?key=" + selYear + "', 'lower')\">");
		document.write("[ &gt;&gt;&gt; " + selYear.replace("h","平成") + " の一覧へ &lt;&lt;&lt; ]");
		document.write('</a></td>');
		if (nextUrl <= maxUrl) {
			nextCount = nextUrl;
			document.write("<td align=left width=33% style=background-color:#093>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;");
			if (photoType == "snap") { nextType = "snap"; }
			else { nextType = "img"; }
			nextHref = "<a href='body.html?key=" + selYear + nextType + nextUrl + ".jpg' style=color:#cff target=body onClick=\"window.open('./lowerMenu.html?key=" + selYear + nextType + nextUrl + "' , 'lower')\">";
			document.write(nextHref);
			document.write("ひとつ次へ &gt;&gt;&gt;</a>");
			document.write("</td></tr>");
		} else {
			document.write("<td align=left style='color:#cff;background-color:#093' width=33%>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; - ");
			document.write("&nbsp;&nbsp;&nbsp; ");
			nextUrl = "001";
			if ((photoType == "img") && (qtySnap > 0)) {
				nextType = "snap";
				nextHref = "<a href='body.html?key=" + selYear + nextType + nextUrl + ".jpg' style=color:#cff target=body onClick=\"window.open('./lowerMenu.html?key=" + selYear + nextType + nextUrl + "' , 'lower')\">";
				document.write(nextHref);
				document.write("スナップ &gt;&gt;&gt;</a>");
			} else if (photoType == "snap") {
				nextType = "img";
				nextHref = "<a href='body.html?key=" + selYear + nextType + nextUrl + ".jpg' style=color:#cff target=body onClick=\"window.open('./lowerMenu.html?key=" + selYear + nextType + nextUrl + "' , 'lower')\">";
				document.write(nextHref);
				document.write("一般写真 &gt;&gt;&gt;</a>");
			} else { nextHref = ""; }
			document.write("</td></tr>");
		}
		document.write("</table>");
		document.write("<table cellspacing=0 cellpadding=0 border=0 width=100%>");
		document.write("<tr>");
		document.write("<td align=center width=180 valign=top style='padding-top:150px;background-color:black'>");
		if (befrUrl >= 1) {
			document.write(befrHref);
			document.write("<B style=color:white>&lt;&lt;&lt;<BR>");
			document.write("<img src='./" + selYear + "/resizedM/" + befrType +befrUrl + ".jpg' width=160 style='border:2px solid white'><BR>");
			document.write("&lt;&lt;&lt;</b></a>");
		} else { document.write("&nbsp;");}
		document.write("</td>");
		filePathL = filePath.replace("resizedM", "resizedL");
		document.write("<TD ALIGN=CENTER clign=center style='border-right:1px solid #ccc;border-left:1px solid #ccc;background-color:black'>");
		document.write(warningUpper);
		document.write("<a href='" + filePathL + "' target=largeSize><img src=" + filePath + " BORDER=0></a></form><BR>");
		document.write(warningLower);
		document.write("</td>");
		document.write("<td align=center width=180 valign=top style='padding-top:150px;background-color:black'>");
		if (nextHref != "") {
			document.write(nextHref);
			document.write("<B style=color:white>&gt;&gt;&gt;<BR>");
			document.write("<img src='./" + selYear + "/resizedM/" + nextType + nextUrl + ".jpg' width=160 style='border:2px solid white'><BR>");
			document.write("&gt;&gt;&gt;</b></a>");
		} else { document.write("&nbsp;"); }
		document.write("</td>");
		document.write("</tr></table>");

		document.write("<table width=100% cellspacing=0 cellpadding=3 border=0 height=20 style=background-color:#093><TR>");
		document.write("<td align=right style='color:#cff;background-color:#093' width='33%'" + upperClr + ">");
		if (befrUrl >= minUrl) {
			if (photoType == "snap") { befrType = "snap"; }
			else { befrType = "img"; }
			befrHref = "<a href='body.html?key=" + selYear + befrType + befrUrl + ".jpg' style=color:#cff target=body onClick=\"window.open('./lowerMenu.html?key=" + selYear + befrType + befrUrl + "' , 'lower')\">";
			document.write(befrHref);
			document.write("&lt;&lt;&lt; ひとつ前へ</a>");
		} else {
			if (photoType == "snap") {
				befrUrl = "001";
				befrType = "img";
				befrHref = "<a href='body.html?key=" + selYear + befrType + befrUrl + ".jpg' style=color:#cff target=body onClick=\"window.open('./lowerMenu.html?key=" + selYear + befrType + befrUrl + "' , 'lower')\">";
				document.write(befrHref);
				document.write("&lt;&lt;&lt;一般写真</a>&nbsp;&nbsp;&nbsp;&nbsp;");
			}
			document.write(" - ");
		}
	
		document.write("&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;</td>");
		document.write("<td align=center style=background-color:#093>");
		document.write("<a href='body.html?selYear=" + selYear + "' target=body style=color:yellow onClick=\"window.open('lowerMenu.html?key=" + selYear + "', 'lower')\">");
		document.write("[ &gt;&gt;&gt; " + selYear.replace("h","平成") + " の一覧へ &lt;&lt;&lt; ]");
		document.write('</a></td>');
		if (nextUrl <= maxUrl) {
			nextCount = nextUrl;
			document.write("<td align=left width=33% style=background-color:#093>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;");
			if (photoType == "snap") { nextType = "snap"; }
			else { nextType = "img"; }
			nextHref = "<a href='body.html?key=" + selYear + nextType + nextUrl + ".jpg' style=color:#cff target=body onClick=\"window.open('./lowerMenu.html?key=" + selYear + nextType + nextUrl + "' , 'lower')\">";
			document.write(nextHref);
			document.write("ひとつ次へ &gt;&gt;&gt;</a>");
			document.write("</td></tr>");
		} else {
			document.write("<td align=left style='color:#cff;background-color:#093' width=33%>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; - ");
			document.write("&nbsp;&nbsp;&nbsp; ");
			nextUrl = "001";
			if ((photoType == "img") && (qtySnap > 0)) {
				nextType = "snap";
				nextHref = "<a href='body.html?key=" + selYear + nextType + nextUrl + ".jpg' style=color:#cff target=body onClick=\"window.open('./lowerMenu.html?key=" + selYear + nextType + nextUrl + "' , 'lower')\">";
				document.write(nextHref);
				document.write("スナップ &gt;&gt;&gt;</a>");
			} else if (photoType == "snap") {
				nextType = "img";
				nextHref = "<a href='body.html?key=" + selYear + nextType + nextUrl + ".jpg' style=color:#cff target=body onClick=\"window.open('./lowerMenu.html?key=" + selYear + nextType + nextUrl + "' , 'lower')\">";
				document.write(nextHref);
				document.write("一般写真 &gt;&gt;&gt;</a>");
			} else { nextHref = ""; }
			document.write("</td></tr>");
		}
		document.write("</table");

	}
}
document.write("</center></body>");
}
