#!/usr/local/bin/perl --
;#------------------------------------------------------------------------------
$root_path = "";
$server_path = $ENV{'DOCUMENT_ROOT'};
;#------------------------------------------------------------------------------
use Fcntl qw(:flock);
push(@INC,$server_path.$root_path.'/common/lib/pl/');
require 'jcode.pl';
require 'fold.pl-1.6.pl';
require 'str.pl';
require 'text.pl';
require 'imgsize.pl';
require 'jtime.pl';
require 'iodata.pl';
require 'backup.pl';
require 'cookie.pl';
;#------------------------------------------------------------------------------
$data_path = '../../dat/main/info/';
if(!-e $data_path){umask(0);mkdir($data_path,0777)};
if(!-e $data_path."backup/"){umask(0);mkdir($data_path."backup/",0777)};
if(!-e $data_path."data/"){umask(0);mkdir($data_path."data/",0777)};


$h1title1="インフォメーション検索";
$index_name = 'index.dat';
$index_path = $data_path.$index_name;
$backup_path = $data_path."backup/".$index_name;

$category_name = 'category.dat';
$category_path = $data_path.$category_name;
$category_ancestor = 'Top';

$kind_name = 'kind.dat';
$kind_path = $data_path.$kind_name;

$count_name = 'count.dat';
$count_path = $data_path.$count_name;

$strange = 0;# 機種依存文字置換(0:なし,1:あり)
$code_key = "彩";# デフォルト文字コードキー
;#------------------------------------------------------------------------------
if($ENV{'REQUEST_METHOD'} eq 'POST'){
read(STDIN,$key,$ENV{'CONTENT_LENGTH'});
}else{$key = $ENV{'QUERY_STRING'};}
;#------------------------------------------------------------------------------
# 文字コードキー取得
if($strange == 1){&text'strange_table_init();}
@pairs = split(/&/, $key,-1);
foreach $pair (@pairs){
	($field, $value) = split(/=/, $pair,-1);
	$field =~ s/%([a-fA-F0-9][a-fA-F0-9])/pack("C", hex($1))/ge;
	$value =~ s/%([a-fA-F0-9][a-fA-F0-9])/pack("C", hex($1))/ge;
	if($field eq "code_key"){$code_key = $value;}
}
$code = &jcode'getcode(*code_key);

@pairs = split(/&/, $key,-1);
foreach $pair (@pairs){
	($field, $value) = split(/=/, $pair,-1);
	$field =~ s/%([a-fA-F0-9][a-fA-F0-9])/pack("C", hex($1))/ge;
	$value =~ s/%([a-fA-F0-9][a-fA-F0-9])/pack("C", hex($1))/ge;
	if($code eq "sjis"){&jcode'sjis2euc(*field);&jcode'sjis2euc(*value);}
	if($code eq "jis"){&jcode'jis2euc(*field);&jcode'jis2euc(*value);}
	if($strange == 1){&text'strange_replace($value);}
	$value =~ s/\</&lt;/g;
	$value =~ s/\>/&gt;/g;
	$value =~ s/(\x0D\x0A|\x0D|\x0A)/\n/g;
	$value =~ s/\n+$//g;
	$value =~ s/\n/\<br\>/g;
	$value =~ s/\t/　/g;

	$FORM{$field} = $value;
	$mode = $FORM{'mode'};
	$res = $FORM{'res'};
	$number = $FORM{'number'};
	$exto = $FORM{'exto'};

	$cflg = $FORM{'cflg'};
	$kflg = $FORM{'kflg'};
	$gflg = $FORM{'gflg'};
	$sflg = $FORM{'sflg'};
	$mflg = $FORM{'mflg'};
	$word = $FORM{'word'};
}

;#------------------------------------------------------------------------------
$getstr = "";
if($code_key ne ""){$getstr .= "&code_key=".&text'urlEncode($code_key)};
if($cflg ne ""){$getstr .= "&cflg=".$cflg};
if($kflg ne ""){$getstr .= "&kflg=".$kflg};
if($gflg ne ""){$getstr .= "&gflg=".$gflg};
if($sflg ne ""){$getstr .= "&sflg=".$sflg};
if($mflg ne ""){$getstr .= "&mflg=".$mflg};
if($word ne ""){$getstr .= "&word=".&text'urlEncode($word)};
;#------------------------------------------------------------------------------
#$tmp_krow=0;
#open(IN, "< $kind_path");
#flock IN,LOCK_SH;
#while(<IN>){
#	chomp $_;
#	($tmpkstatus,$tmpksort,$tmpkregdate,$tmpkupdate,$tmpkhost,$tmpkaddr,$tmpktotal,$tmpkshowtotal,$tmpkmarktotal,$tmpkshowmarktotal,$tmpktitle) = split("	",$_,-1);
#	$tmp_kindex[$tmpksort][0]=$tmpkstatus;
#	$tmp_kindex[$tmpksort][1]=$tmp_krow;
#	$tmp_kindex[$tmpksort][2]=$tmpkregdate;
#	$tmp_kindex[$tmpksort][3]=$tmpkupdate;
#	$tmp_kindex[$tmpksort][4]=$tmpkhost;
#	$tmp_kindex[$tmpksort][5]=$tmpkaddr;
#	$tmp_kindex[$tmpksort][6]=$tmpktotal;
#	$tmp_kindex[$tmpksort][7]=$tmpkshowtotal;
#	$tmp_kindex[$tmpksort][8]=$tmpkmarktotal;
#	$tmp_kindex[$tmpksort][9]=$tmpkshowmarktotal;
#	$tmp_kindex[$tmpksort][10]=$tmpktitle;
#	$tmp_krow=$tmp_krow + 1;
#}
#close(IN);

#$krow=0;
#for($i=0;$i<$tmp_krow;$i++){
#	if($tmp_kindex[$i][0]>0){
#		$kindex[$krow][0] = $tmp_kindex[$i][0];
#		$kindex[$krow][1] = $tmp_kindex[$i][1];
#		$kindex[$krow][2] = $tmp_kindex[$i][2];
#		$kindex[$krow][3] = $tmp_kindex[$i][3];
#		$kindex[$krow][4] = $tmp_kindex[$i][4];
#		$kindex[$krow][5] = $tmp_kindex[$i][5];
#		$kindex[$krow][6] = $tmp_kindex[$i][6];
#		$kindex[$krow][7] = $tmp_kindex[$i][7];
#		$kindex[$krow][8] = $tmp_kindex[$i][8];
#		$kindex[$krow][9] = $tmp_kindex[$i][9];
#		$kindex[$krow][10] = $tmp_kindex[$i][10];
#
#		$krow++;
#	};
#};


;#------------------------------------------------------------------------------
$tmp_crow=0;
open(IN, "< $category_path");
flock IN,LOCK_SH;
while(<IN>){
	chomp $_;
	($tmpcstatus,$tmpcsort,$tmpctree,$tmpcparent,$tmpclength,$tmpcregdate,$tmpcupdate,$tmpchost,$tmpcaddr,$tmpctotal,$tmpcshowtotal,$tmpcmarktotal,$tmpcshowmarktotal,$tmpctitle,$tmpccomment) = split("	",$_,-1);

	$tmp_tree_cindex[$tmpctree][0]=$tmpcstatus;
	$tmp_tree_cindex[$tmpctree][1]=$tmpcsort;
	$tmp_tree_cindex[$tmpctree][2]=$tmp_crow;
	$tmp_tree_cindex[$tmpctree][3]=$tmpcparent;
	$tmp_tree_cindex[$tmpctree][4]=$tmpclength;
	$tmp_tree_cindex[$tmpctree][5]=$tmpcregdate;
	$tmp_tree_cindex[$tmpctree][6]=$tmpcupdate;
	$tmp_tree_cindex[$tmpctree][7]=$tmpchost;
	$tmp_tree_cindex[$tmpctree][8]=$tmpcaddr;
	$tmp_tree_cindex[$tmpctree][9]=$tmpctotal;
	$tmp_tree_cindex[$tmpctree][10]=$tmpcshowtotal;
	$tmp_tree_cindex[$tmpctree][11]=$tmpcmarktotal;
	$tmp_tree_cindex[$tmpctree][12]=$tmpcshowmarktotal;
	$tmp_tree_cindex[$tmpctree][13]=$tmpctitle;
	$tmp_tree_cindex[$tmpctree][14]=$tmpccomment;

	$tmp_cindex[$tmp_crow][0]=$tmpcstatus;
	$tmp_cindex[$tmp_crow][1]=$tmp_crow;
	$tmp_cindex[$tmp_crow][2]=$tmpctree;
	$tmp_cindex[$tmp_crow][3]=$tmpcparent;
	$tmp_cindex[$tmp_crow][4]=$tmpclength;
	$tmp_cindex[$tmp_crow][5]=$tmpcregdate;
	$tmp_cindex[$tmp_crow][6]=$tmpcupdate;
	$tmp_cindex[$tmp_crow][7]=$tmpchost;
	$tmp_cindex[$tmp_crow][8]=$tmpcaddr;
	$tmp_cindex[$tmp_crow][9]=$tmpctotal;
	$tmp_cindex[$tmp_crow][10]=$tmpcshowtotal;
	$tmp_cindex[$tmp_crow][11]=$tmpcmarktotal;
	$tmp_cindex[$tmp_crow][12]=$tmpcshowmarktotal;
	$tmp_cindex[$tmp_crow][13]=$tmpctitle;
	$tmp_cindex[$tmp_crow][14]=$tmpccomment;

#	if($tmp_crow eq $cflg){
#		$parent_title = $tmpctitle;
#		$parent_comment = $tmpccomment;
#		$parent_show_total += $tmpcshowtotal;
#		$parent_show_mark_total += $tmpcshowmarktotal;
#	}

	$tmp_crow=$tmp_crow + 1;
}
close(IN);

$crow=0;
for($i=0;$i<$tmp_crow;$i++){


	if($tmp_cindex[$i][0]>1){
#		if($tmp_cindex[$i][3] eq "3"){
			$cindex[$crow][0] = $tmp_cindex[$i][0];
			$cindex[$crow][1] = $tmp_cindex[$i][1];
			$cindex[$crow][2] = $tmp_cindex[$i][2];
			$cindex[$crow][3] = $tmp_cindex[$i][3];
			$cindex[$crow][4] = $tmp_cindex[$i][4];
			$cindex[$crow][5] = $tmp_cindex[$i][5];
			$cindex[$crow][6] = $tmp_cindex[$i][6];
			$cindex[$crow][7] = $tmp_cindex[$i][7];
			$cindex[$crow][8] = $tmp_cindex[$i][8];
			$cindex[$crow][9] = $tmp_cindex[$i][9];
			$cindex[$crow][10] = $tmp_cindex[$i][10];
			$cindex[$crow][11] = $tmp_cindex[$i][11];
			$cindex[$crow][12] = $tmp_cindex[$i][12];
			$cindex[$crow][13] = $tmp_cindex[$i][13];
			$cindex[$crow][14] = $tmp_cindex[$i][14];
			$crow++;
		};
#	};
};

;#------------------------------------------------------------------------------
&iodata'existFile($index_path,0666);
;#------------------------------------------------------------------------------
;# 読み込み

$tmp_row = 0;
open(IN, "< $index_path");
flock IN,LOCK_SH;
while(<IN>){
	chomp $_;
	$detail[$tmp_row] = $_;

	($tmpstatus,$tmpsort,$tmpregdate,$tmpupdate,$tmphost,$tmpaddr,$tmpcount,$tmpmark,$tmpcategory,$tmpkind,$tmpgroup,$tmpdate,$tmptitle,$tmpurltitle,$tmpurl,$tmplinktype,$tmpname,$tmppost,$tmpoffice) = split("	",$_,-1);

	$tmp_index[$tmpsort][0]=$tmpstatus;
	$tmp_index[$tmpsort][1]=$tmp_row;
	$tmp_index[$tmpsort][2]=$tmpregdate;
	$tmp_index[$tmpsort][3]=$tmpupdate;
	$tmp_index[$tmpsort][4]=$tmphost;
	$tmp_index[$tmpsort][5]=$tmpaddr;
	$tmp_index[$tmpsort][6]=$tmpcount;
	$tmp_index[$tmpsort][7]=$tmpmark;
	$tmp_index[$tmpsort][8]=$tmpcategory;
	$tmp_index[$tmpsort][9]=$tmpkind;
	$tmp_index[$tmpsort][10]=$tmpgroup;
	$tmp_index[$tmpsort][11]=$tmpdate;
	$tmp_index[$tmpsort][12]=$tmptitle;
	$tmp_index[$tmpsort][13]=$tmpurltitle;
	$tmp_index[$tmpsort][14]=$tmpurl;
	$tmp_index[$tmpsort][15]=$tmplinktype;
	$tmp_index[$tmpsort][16]=$tmpname;
	$tmp_index[$tmpsort][17]=$tmppost;
	$tmp_index[$tmpsort][18]=$tmpoffice;

	$tmp_row=$tmp_row + 1;

}
close(IN);
;#------------------------------------------------------------------------------
($status,$sort,$regdate,$update,$host,$addr,$count,$mark,$category,$kind,$group,$date,$title,$urltitle,$url,$linktype,$name,$post,$office) = split("	",$detail[$number],-1);

*data = &cookie'getCookie($ENV{'HTTP_COOKIE'});
$check = $data{"info$number"};
if($check != 1){
	open(REG, ">> $count_path");
	flock REG,LOCK_EX;
	print REG $number."\n";
	close(REG);
	chmod (0666, "$count_path");
}
if($status < 2||$status eq ""){&str'errorOut("ページを表示できません。",$root_path);exit;}
;#------------------------------------------------------------------------------




$row=0;
for($i=0;$i<$tmp_row;$i++){
	if($tmp_index[$i][0]>1){
		if($tmp_index[$i][1] ne $number && $kind ne "" && $tmp_index[$i][8] eq $kind){
			$index[$row][0] = $tmp_index[$i][0];
			$index[$row][1] = $tmp_index[$i][1];
			$index[$row][2] = $tmp_index[$i][2];
			$index[$row][3] = $tmp_index[$i][3];
			$index[$row][4] = $tmp_index[$i][4];
			$index[$row][5] = $tmp_index[$i][5];
			$index[$row][6] = $tmp_index[$i][6];
			$index[$row][7] = $tmp_index[$i][7];
			$index[$row][8] = $tmp_index[$i][8];
			$index[$row][9] = $tmp_index[$i][9];
			$index[$row][10] = $tmp_index[$i][10];
			$index[$row][11] = $tmp_index[$i][11];
			$index[$row][12] = $tmp_index[$i][12];
			$index[$row][13] = $tmp_index[$i][13];
			$index[$row][14] = $tmp_index[$i][14];
			$index[$row][15] = $tmp_index[$i][15];
			$index[$row][16] = $tmp_index[$i][16];
			$index[$row][17] = $tmp_index[$i][17];
			$index[$row][18] = $tmp_index[$i][18];
			$row++;
		};
	};
}

@index_rev=reverse @index;

$filename = $regdate.".dat";
$file_path = $data_path."data/".$filename;

open(IN, "< $file_path");
flock IN,LOCK_SH;
$data = <IN>;
chomp $data;
close(IN);
@data_array = split("	",$data,-1);
$newmark = $data_array[4];
$workcategory = $data_array[5];
$comment = $data_array[16];
$datatitle = $data_array[17];
$datafilename = $data_array[18];
$datalocalfilename = $data_array[19];
$img1title = $data_array[20];
$img1filename = $data_array[21];
$thum1filename = $data_array[22];
$img2title = $data_array[23];
$img2filename = $data_array[24];
$thum2filename = $data_array[25];
$img3title = $data_array[26];
$img3filename = $data_array[27];
$thum3filename = $data_array[28];
$img4title = $data_array[29];
$img4filename = $data_array[30];
$thum4filename = $data_array[31];
$img5title = $data_array[32];
$img5filename = $data_array[33];
$thum5filename = $data_array[34];
$img6title = $data_array[35];
$img6filename = $data_array[36];
$thum6filename = $data_array[37];
$img7title = $data_array[38];
$img7filename = $data_array[39];
$thum7filename = $data_array[40];
$img8title = $data_array[41];
$img8filename = $data_array[42];
$thum8filename = $data_array[43];
$img9title = $data_array[44];
$img9filename = $data_array[45];
$thum9filename = $data_array[46];
$img10title = $data_array[47];
$img10filename = $data_array[48];
$thum10filename = $data_array[49];

;#------------------------------------------------------------------------------
($sec,$min,$hour,$mday,$mon,$year,$wday,$yday,$isdst) = localtime($date);
$yyyy = $year + 1900;
$mm = $mon + 1;
$dd = $mday;

@wday_array = ('日','月','火','水','木','金','土');
$tmp_wday = "(".$wday_array[&jtime'getWday($year +1900,$mon +1,$mday)].")";

$h1title2 = $yyyy."/".$mm."/".$dd.$tmp_wday;

;#------------------------------------------------------------------------------

print <<"END_OF_HTML";
Content-type: text/html; charset=EUC-JP

<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN" "http://www.w3.org/TR/html4/loose.dtd">
<html lang="ja">
<!-- InstanceBegin template="/Templates/restaurant.dwt" codeOutsideHTMLIsLocked="false" -->
<head>
<!--彩-->
<meta http-equiv="Content-Type" content="text/html; charset=EUC-JP">
<meta http-equiv="Content-Language" content="ja">
<meta name="robots" content="index,follow,archive">
<link rel="alternate" type="application/rss+xml" title="RSS 1.0" href="/rss/index.rdf">
<!-- ■タイトル開始■ -->
<link rel="alternate" type="application/rss+xml" title="RSS 1.0" href="/support/sitemap/rss/index.rdf" />
<!-- InstanceParam name="pageid" type="text" value="index" -->
<meta name="Description" content="太陽グループが展開するこだわりのレストラン最新情報。グランポルト、カフェポルト、とかち晴れ、函館、室蘭、帯広、外食、グルメ、食事、料理、洋食、和食、カフェ">
<meta name="Keywords" content="レストラン,北海道函館・帯広・室蘭">
<title>太陽グループレストラン最新情報</title>
<!-- ■タイトル終了■ -->
<link rel="stylesheet" type="text/css" href="/common/css/main.css">
<link rel="stylesheet" type="text/css" href="/common/css/import.css" media="all">
<link rel="stylesheet" href="/common/css/size-default.css" type="text/css" title="default">
<link rel="alternate stylesheet" href="/common/css/size-big.css" type="text/css" title="big">
<link rel="alternate stylesheet" href="/common/css/size-small.css" type="text/css" title="small">
<script type="text/javascript" src="/common/lib/js/csschange.js"></script>
<!-- InstanceBeginEditable name="header" -->
<script type="text/javascript" src="/common/lib/js/body.js"></script>
<script type="text/javascript" src="/common/lib/js/rollover.js"></script>
<script type="text/JavaScript">
<!--
window.onload = function(e){
 importOnLoad();
}
//-->
</script>
<link href="/common/css/restaurant.css" rel="stylesheet" type="text/css">
<!-- InstanceEndEditable -->
<!--#config errmsg=""-->
</head>
<!-- ■コンテンツ開始■ -->
<body bgcolor="#E4E4E4" leftmargin="0" topmargin="0" marginwidth="0" marginheight="0">
<a name="top"></a>
<table width="780" border="0" align="center" cellpadding="0" cellspacing="0">
<tr>
<td width="10" background="/common/img/kage_left.jpg"><img src="/common/img/spacer.gif" width="1" height="1"><img src="/common/img/spacer.gif" width="10" height="30"></td>
<td valign="top"><table width="760" border="0" cellspacing="0" cellpadding="0">
<tr>
<td>

END_OF_HTML
#<!--#include virtual="/common/ssi/static/header.html" -->
open(IN,"$server_path/common/ssi/static/header.html" );
flock IN,LOCK_SH;
#while(<IN>){if($_ eq "\n"){last;}}
while(<IN>){print $_;}
close(IN);
print <<"END_OF_HTML";

</td>
</tr>
</table>
<table width="760" border="0" cellspacing="0" cellpadding="0">
<tr>
<td align="center" bgcolor="#FFFFFF"><table width="760" height="20" border="0" cellpadding="0" cellspacing="0" class="navi">
<tr>
<td width="10"><img src="/common/img/spacer.gif" width="10" height="8"></td>
<td align="left"><!-- InstanceBeginEditable name="navi" --><a href="/index.shtml">トップページ</a>&nbsp;＞&nbsp;<a href="/restaurant/index.shtml">レストラン</a>&nbsp;＞&nbsp;<a href="/restaurant/info/index.shtml">最新情報一覧</a>&nbsp;＞&nbsp;最新情報詳細<!-- InstanceEndEditable --></td>
</tr>
</table>
<table width="760" border="0" cellspacing="0" cellpadding="0">
<tr>
<td width="158" align="center" valign="top" background="/restaurant/img/left_haikei.gif" class="leftmenuline"><table width="158" border="0" cellspacing="0" cellpadding="0">
<tr>
<td>

END_OF_HTML
##<!--#include virtual="/common/ssi/dynamic/menu_restaurant.cgi" -->
open(IN,"perl $server_path/common/ssi/dynamic/menu_restaurant.cgi|" );
#open(IN,"/usr/bin/perl $server_path/common/ssi/dynamic/menu_restaurant.cgi|" );
flock IN,LOCK_SH;
while(<IN>){if($_ eq "\n"){last;}}
while(<IN>){print $_;}
close(IN);
print <<"END_OF_HTML";

</td>
</tr>
</table>
<table width="30" border="0" cellspacing="0" cellpadding="0">
<tr>
<td><img src="/common/img/spacer.gif" width="30" height="10"></td>
</tr>
</table>
<table border="0" cellspacing="0" cellpadding="0">
<tr>
<td><a href="/restaurant/blog/"><img src="/restaurant/img/bannar_blog.jpg" width="151" height="59" border="0"></a></td>
</tr>
</table></td>
<td width="10"><img src="/common/img/spacer.gif" width="10" height="30"></td>
<td align="center" valign="top"><!-- InstanceBeginEditable name="restaurnt" -->
<table border="0" cellpadding="0" cellspacing="0" class="mb25">
<tr>
<td><img src="/restaurant/info/img/title_syousai.gif" alt="最新情報詳細" width="591" height="34"></td>
</tr>
</table>
<table width="560" border="0" cellpadding="0" cellspacing="0" class="l150 mb45">
<tr>
<td align="left" valign="top">
<p class="f14">

<!-- NEWマーク -->
END_OF_HTML
	if($newmark==1){print '<img src="/restaurant/img/icon_new.gif" width="27" height="13" style="margin-right:5px;">';};
print <<END_OF_HTML;

<!-- 日付 -->
<font color="#FF0000">$h1title2</font>
<br>

<!-- タイトル -->
<strong class="f14"><font color="#F76931">$title</font></strong>

<!-- レストラン名 -->
END_OF_HTML
if($index_rev[$i][8] ne "2"){
	print '&nbsp;&nbsp;';
	print '【'.$cindex[$workcategory][13].'】';	#レストラン名
}
print <<END_OF_HTML;

</p>

<!-- 内容 -->
<p>$comment</p>

<!-- 関連 -->
<p>
END_OF_HTML

if($url ne ""){
	print '<br>';
	print '<img src="../../common/img/spacer.gif" width="1" height="5"><br>';
	if($urltitle ne ""){
		print '関連：<a href="'.$url.'" target="'.$linktype.'">'.$urltitle.'</a>';
	}else{
		print '関連：<a href="'.$url.'" target="'.$linktype.'">'.$url.'</a>';
	}
}

if($datafilename ne ''){
	print '<br>';
	print '<a href="'.$data_path.'data/'.$datafilename.'">';
	if($datatitle ne ""){print $datatitle;}else{print 'download';}
	print '</a>';
}


print <<"END_OF_HTML";
</p>

</td>
<td align="right" valign="top">

END_OF_HTML

# <!-- 画像 -->
if($thum1filename ne ''||$thum2filename ne ''||$thum3filename ne ''){

	print '<table border="0" cellspacing="0" cellpadding="0">';
	print '<tr>';
	print '<td>';

	if($thum1filename ne ''){
		undef @tmpimg1,@tmpimg2;
		@tmpimg1 = split("_",$thum1filename,-1);
		@tmpimg2 = split('\.',$tmpimg1[$#tmpimg1],-1);
		($imgW,$imgH) = split("x",$tmpimg2[0],-1);

		print '<a href="'.$data_path.'data/'.$img1filename.'" target="_blank"><img border="0" src="'.$data_path.'data/'.$thum1filename.'" width="'.$imgW.'" height="'.$imgH.' class="spacer5"></a>';
		if($img1title ne ""){print '<br>'.$img1title;}
		print '<br>';
		print '<br>';

	}

	if($thum2filename ne ''){
		undef @tmpimg1,@tmpimg2;
		@tmpimg1 = split("_",$thum2filename,-1);
		@tmpimg2 = split('\.',$tmpimg1[$#tmpimg1],-1);
		($imgW,$imgH) = split("x",$tmpimg2[0],-1);

		print '<a href="'.$data_path.'data/'.$img2filename.'" target="_blank"><img border="0" src="'.$data_path.'data/'.$thum2filename.'" width="'.$imgW.'" height="'.$imgH.' class="spacer5"></a>';
		if($img2title ne ""){print '<br>'.$img2title;}
		print '<br>';
		print '<br>';

	}

	if($thum3filename ne ''){
		undef @tmpimg1,@tmpimg2;
		@tmpimg1 = split("_",$thum3filename,-1);
		@tmpimg2 = split('\.',$tmpimg1[$#tmpimg1],-1);
		($imgW,$imgH) = split("x",$tmpimg2[0],-1);

		print '<a href="'.$data_path.'data/'.$img3filename.'" target="_blank"><img border="0" src="'.$data_path.'data/'.$thum3filename.'" width="'.$imgW.'" height="'.$imgH.'"></a>';
		if($img3title ne ""){print '<br>'.$img3title;}
		print '<br>';
		print '<br>';

	}

	print '</td>';
	print '</tr>';
	print '</table>';

}

print <<"END_OF_HTML";


</td>
</tr>
</table>
<!-- InstanceEndEditable --></td>
</tr>
</table></td>
</tr>
</table></td>
<td width="10" background="/common/img/kage_right.jpg"><img src="/common/img/spacer.gif" width="1" height="1"><img src="/common/img/spacer.gif" width="10" height="30"></td>
</tr>
</table>
<table width="760" border="0" align="center" cellpadding="0" cellspacing="0">
<tr>
<td>

END_OF_HTML
#<!--#include virtual="/common/ssi/static/footer.html" -->
open(IN,"$server_path/common/ssi/static/footer.html" );
flock IN,LOCK_SH;
#while(<IN>){if($_ eq "\n"){last;}}
while(<IN>){print $_;}
close(IN);
print <<"END_OF_HTML";

</td>
</tr>
</table>
</body>
<!-- ■コンテンツ終了■ -->
<!-- InstanceEnd -->
</html>

END_OF_HTML
