// TroutLureFishing − トップメニュー
// タイトル部の画像点数
bn=15;	// バックグランド画像（風景）
mn=5;	// 魚の画像

// サブディレクトリ内にいるかどうかの判別（サブ内→ ../ 、サブサブ内→ ../../ 付加）
directry="";
fn=filename;
if((len=fn.search(/\//))>0){fn=fn.substr(len+1,fn.length-len);directry="../";}
if((len=fn.search(/\//))>0){fn=fn.substr(len+1,fn.length-len);directry="../../";}

// ファイル番号を求める
no=0;
for(y=0;y<y0;y++){
	if(filename.charAt(0)==mdata[y*x0])		{	no=y;	}
}

// 画像の番号を変える（２桁の文字列番号）
b_no=	"0"+(Math.floor(Math.random()*(bn-0.01))+1);
b_no=	b_no.substring(b_no.length-2,b_no.length);
m_no=	"0"+(Math.floor(Math.random()*(mn-0.01))+1);
m_no=	m_no.substring(m_no.length-2,m_no.length);

// ページ色に見合ったスタイル設定
document.write(
"<style type='text/css'><!--"+
	"td.tdh	{background-color: "+col[no]+";color:"+col1[no]+";font:bold;padding:0 2 0 2;}\n"+
	"td.td1	{border-bottom:1px "+col[no]+" solid;padding:0 2 0 2;height:22;}\n"+
	"td.td2	{border-bottom:2px "+col[no]+" solid;padding:0 2 0 2;height:22;}\n"+
	".inp	{background-color: "+col[no]+";color:"+col1[no]+";width:50;height:18;}\n"+
	"body	{scrollbar-base-color:"+col2[no]+";}\n"+
	"hr		{color:"+col[no]+";height:2px;}\n"+
"--></style>\n"
);

// タイトル部表示
document.write(
"<table border=0 cellspacing=0 cellpadding=0 width=100% bgcolor=#003f3f><tr><td align=center>"+

	"<table border=0 width=760 height=70 cellspacing=0 cellpadding=0"+
	" background="+directry+"clip/menu/b_"+b_no+".jpg><tr>"+

	"<td width=320 align=left valign=bottom>"+
	"<a href='#' onClick='parent.window.resizeTo(800,600);parent.window.moveTo(0,0)'>"+
	"<img src="+directry+"clip/menu/m_title.gif border=0"+
	" alt='ようこそトラウトルアーフィッシングへ\n (Resize to 800x600 & move to 0,0)'></a></td>"+

	"<td width=230>"+
	"<a href='#' onClick='parent.window.resizeTo(800,768);parent.window.moveTo(0,0)'>"+
	"<img src="+directry+"clip/dummy.gif border=0 width=230 height=70"+
	" alt='(Resize to 800x768 & move to 0,0)'></a></td>\n"+

	"<td width=210 align=right valign=bottom>"+
	"<a href='#' onClick=parent.window.resizeTo(1024,768);parent.window.moveTo(0,0);>"+
	"<img src="+directry+"clip/menu/m_"+m_no+".gif border=0"+
	" alt='(Resize to 1024x768 & move to 0,0)'></a></td>"+

	"</tr></table>"+

"</td></tr><tr><td align=center bgcolor=gray>"+
	"<table border=0 cellspacing=0 cellpadding=0 width=760><tr><td align=left>"+
		"<table border=0 cellspacing=0 cellpadding=0 width=760><tr>"
);

for(y=0;y<y0;y++){
	document.write("<td align=center style='background-color:"+col[y]+";font:10pt'>");
	if(y != no){
		document.write(
		"<a href="+(mdata[y*x0]=="-" ? "" : directry)+mdata[y*x0+3]+
		" class=tlfmenu target=main>"+mdata[y*x0+2]+"</a>");
	}
	else{
		document.write("<font color=yellow>"+mdata[y*x0+2]+"</font>");
	}
	document.write("</td>");
}

document.write(
		"<td width=60>"+
"<img src="+directry+"clip/dummy.gif border=0 width=50 height=14></td></tr></table>"+
	"</td></tr></table>"+
"</td></tr></table>"
	);
