#!/usr/bin/perl

require '../../../cgi-lib.pl';
&ReadParse(*in);

$thisfile= './';

$pic_dir  = "pics";	# 「/」は付けない！
$spic_dir = "sum";	# 「/」は付けない！

$picture_status = 12;	# 写真の総数
$picture_horizon = 4;	# サムネイルを横方向に並べる数
$picture_loop = $picture_status + ($picrure_horizon - ($picture_status % $picture_horizon));	# テーブル表示補正用（いぢらない）

@picture_urlad=("","001.jpg","002.jpg","003.jpg","004.jpg","005.jpg","006.jpg","007.jpg","008.jpg","009.jpg","010.jpg","011.jpg","012.jpg");
@picture_title=("","ほっと一息。","大島くんも…","主役の古川さん","マットレス贈呈","結\構\い\いものもらった〜！","やっぱり…","無事に終えて…","先生も","おおぉっ…","どれどれ","なんやい","渡辺先生からの");
@picture_comment=("","アイス食べてます。","アイス食べてます。","無事に引継ぎです","ちょっと照れくさそうですが…","彼は学校に住み付くようです","気になるようです。","ほっと一息です。","ほっと一息です。","怖いっす…","撃ってみるか？","おもちゃでした。","最後のレクチャーです。");

#---ルーチン分岐---------

&header;
if($in{'picture_number'} ne ""){
	$number=$in{'picture_number'};
	&download;
}else{
	&firstvisit;
}


#------------------------------------------
sub header{
print "Content-type:text/html\n\n";
print <<"_HTML_";
<html>
<head>
<title>アルバム - 博士課程公聴会</title>
</head>

<body background="./background.jpg" topmargin=0 leftmargin=0 link=#CC0000 vlink=#CC0000 alink=#CC0000 text=#000080>
<center>
_HTML_
}	# End of sub

#------------------------------------------
sub firstvisit{

print <<"_HTML_";

<table width=720 cellspacing=4 cellpadding=0 border=0>
<tr><td colspan=4 align=left><font size=5>&nbsp;</font></td></tr>
<tr><td colspan=4 align=left><font color=#CC0000>&nbsp;&nbsp;■</font>&nbsp;<font color=#CC0000><b>古川裕之氏&nbsp;博士課程公聴会</b></font>&nbsp;<font size=2 color=#C0000>[2002.5.13]</font></td></tr>
<tr><td colspan=4 align=center>
	<table width=90% cellspacing=5 cellpadding=0 border=0>
	<tr><td align=left><font size=2>&nbsp;<br>
		博士後期課程の古川さんが、学位公聴会を行ないました。<br>
		無事\に\発\表\会\を\終\え、ほっと一息の打ち上げ会です。緊張が解けた、いつもと変わらぬ様子をご覧ください。<br>
		&nbsp;<br>
		<img src="./pics/all.jpg"><br>
		&nbsp;<br>
		&nbsp;<br>
		&nbsp;<br></font></td></tr>
</table>
</td></tr>

_HTML_

for($number=1; $number<=$picture_loop; $number++){
	if($number % $picture_horizon == 1){
		print "<tr>\n";
	}
	if($picture_urlad[$number] ne ""){
		print "<td width=180 align=center><a href=\"$thisfile?picture_number=$number\"><img src=\"./$pic_dir/$spic_dir/$picture_urlad[$number]\" border=0></a><br><font color=#CC0000 size=2><b>$picture_title[$number]</b></font><br><font size=2>$picture_comment[$number]</font><br>&nbsp;</td>\n";
	}else{
		print "<td width=180 align=center>&nbsp;</td>\n";
	}
	if($number % $picture_horizon == 0 || $number == $picture_loop){
		print "</tr>\n";
	}
}

print <<"_HTML_";
</table>

<br>
<br>

</center>
</body>
</html>

_HTML_

}	# End of sub

#-------------
sub download{

$next_number=$number+1;
$before_number=$number-1;

print <<"_HTML_";

<table width=720 cellspacing=4 cellpadding=0 border=0>
_HTML_


print "<tr><td colspan=3 align=left><font size=5>&nbsp;</font></td></tr>\n";
print "<tr><td colspan=3 align=left><font color=#CC0000>&nbsp;&nbsp;■&nbsp;<b>古川裕之氏&nbsp;博士課程公聴会</b>&nbsp;<font size=2>[2002.5.13]</font></font></td></tr>\n";
print "<tr><td colspan=3 align=left><font size=5>&nbsp;</font></td></tr>\n";
print "<tr><td colspan=2 align=left><font size=5>&nbsp;</font></td><td align=right><font size=2><font color=#000080><b>$number/$picture_status</b></font>&nbsp;<a href=\"$thisfile\">[一覧へ戻る]</a></font></td></tr>\n";

if($number!=1){
	print "<tr><td width=20% align=left valign=top nowrap><a href=\"$thisfile?picture_number=$before_number\"><font size=2>&lt;&lt;&nbsp;Prev</font></a></td>";
}else{
	print "<tr><td width=20% align=left>&nbsp;</td>";
}

print "<td width=60% height=30 align=center><font color=#CC0000><b>$picture_title[$number]</b></font><br><font size=2 color=#000080>$picture_comment[$number]</font></td>";

if($number!=$picture_status){
	print "<td width=20% align=right valign=top nowrap><a href=\"$thisfile?picture_number=$next_number\"><font size=2>Next&nbsp;&gt;&gt;</font></a></td></tr>\n";
}else{
	print "<td width=20% align=right>&nbsp;</td></tr>\n";
}

print <<"_HTML_";
<tr><td align=center colspan=3><img src="./pics/$picture_urlad[$number]"></td></tr>
</table>

<br>
<br>

</center>
</body>

</html>

_HTML_
}	# End of sub



