# The AFE FAQ HTMLizer - Style.pm, style definitions for riva.ucam.org
# Written by Kamion.
# 
# Copyright (c) 2000, 2001 Colin Watson <cjwatson@chiark.greenend.org.uk>
# 
# 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
# 
# A copy of the GNU General Public License is available on the World Wide
# Web at http://www.gnu.org/copyleft/gpl.html.
# 
# Style.pm (riva.ucam.org) 1.x:
#   * Lower-case HTML tag names.
#   * Add prev and next links.
#
# Style.pm (riva.ucam.org) 1.1 (8 July 2001):
#   * Make the footer link to faq2html.pl and Style.pm.
# 
# Style.pm (riva.ucam.org) 1.0 (dawn of time):
#   * Initial release.

package Style;
require Exporter;
@ISA = qw/Exporter/;

@EXPORT_OK = qw/html_header html_footer/;

sub html_header ($;$$$)
{
	my $name = shift;
	my $up = shift;
	my $previous = shift;
	my $next = shift;
	print <<"EOF";
<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.0 Transitional//EN"
 "http://www.w3.org/TR/REC-html40/loose.dtd">
<html lang="en">

<head>
<title>Guardians of the West: The alt.fan.eddings FAQ: $name</title>
<link rel="stylesheet" href="../standard.css" type="text/css">
EOF
	if (defined $previous)
	{
		print <<"EOF";
<link rel="prev" href="$previous">
EOF
	}
	if (defined $next)
	{
		print <<"EOF";
<link rel="next" href="$next">
EOF
	}
	print <<"EOF";
</head>

<body>
EOF
}

sub html_footer (;$$$)
{
	my $up = shift;
	my $previous = shift;
	my $next = shift;
	my $links;
	if (defined $previous)
	{
		$links .= "<a href=\"$previous\">Previous</a>";
	}
	if (defined $up)
	{
		$links .= " |\n" if defined $links;
		$links .= "<a href=\"$up\">Up</a>";
	}
	if (defined $next)
	{
		$links .= " |\n" if defined $links;
		$links .= "<a href=\"$next\">Next</a>";
	}
	print "<hr>\n\n";
	print "<p class=\"navigation\">\n$links\n</p>\n\n" if defined $links;
	print <<'EOF';
<address>
This FAQ is maintained by
<a href="mailto:vanan@aol.com">Vanan</a>;<br>
the HTML version was produced by <a href="faq2html.pl">faq2html.pl</a>
with these <a href="Style.pm">style definitions</a>, both written by
<a href="mailto:kamion@earthling.net">Kamion</a>,
based on a sed script by
<a href="http://www.kryogenix.albatross.co.uk/">Aquarius</a>.
</address>

</body>

</html>
EOF
}
