#!%PERL_PATH%

# HyperNikkiSystem Title List
# version 0.0.1
# 1999/4/11 Akihiro Arisawa <ari@nijino.com>

$version = "0.0.1";

# Copyright (C) 1998,1999  Akihiro Arisawa, HyperNikkiSystem Project

# This program is free software; you can redistribute it and/or
# modify it under the terms of the GNU General Public License
# as published by the Free Software Foundation; either version 2
# of the License, or (at your option) any later version.

# This program is distributed in the hope that it will be useful,
# but WITHOUT ANY WARRANTY; without even the implied warranty of
# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
# GNU General Public License for more details.

# You should have received a copy of the GNU General Public License
# along with this program; if not, write to the Free Software
# Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA  02111-1307, USA.

# $Id: title_wrapper.cgi.in,v 1.3 2000/09/27 14:13:21 kenji Exp $

$TITLE_CGI_URL = 'title.cgi';

$_ = $ENV{'QUERY_STRING'};
@vars = split(/&/, $_);
foreach (@vars) {
	s/%([A-F0-9][A-F0-9])/pack("C", hex($1))/gie;
	s/(.*)=(.*)/push(@{$1}, $2)/e;
}
$arg = $YEAR[0];
if ($MONTH[0] ne "ALL") {
	$arg .= $MONTH[0];
	$arg .= $DAY[0] if ($DAY[0] ne "ALL");
}

foreach (@CAT) {
	$arg .= "&CAT=$_";
}

print "Content-Type: text/html\n";
print "Location: $TITLE_CGI_URL?$arg\n\n";

