package ForumHTML;
###################################################
#
# Each piece of HTML needed is provided vy a subroutine
# in this package and then printed in each seperate CGI
# Version 0.1 12/7/2004
#
# Ben Martin
#
# These HTML sections should be used like this:
#
# page.cgi
#
# #!/usr/bin/perl -T
# use strict;
# use warnings;
# use CGI;
# use CGI::Carp qw(fatalstobrowser);
# use ForumHTML;
#
#  *CGI script operations*
#
# print "header";
# print "content-type = text/html\n\n";
# print ForumHTML->top();
# print ForumHTML->mainbdy();
# print ForumHTML->bottom();
#
###################################################
use strict;
use warnings;
use CGI;
#use CGI::Carp qw(fatalstobrowser);

# the banner and navigation bar of the forum pages
  sub page_top{
    my($title) = @_;
    return qq(
      <html>
       <head><title>$title</title></head>
       <body>
        <table>
         <tr>
          <td colspan="2"><h2>page_banner</h2></td>
         </tr>
         <tr>
          <td width="50%"><a href="homescript.cgi">home</a></td>
          <td width="50%"><a href="forums.cgi">forums</a></td>
         </tr>
        </table>
    );
  }
  
  sub page_bottom{
    return qq(
        <table>
         <tr>
          <td width="50%"><a href="user_login.cgi">My Home</a></td>
          <td width="50%"><a href="createuser.cgi">Create User</a></td>
         </tr>
         <tr>
          <td colspan="2">benjamin\@marlboro.edu for bugs, questions, and comments.</td>
         </tr>
        </table>
       </body>
      </html>
    );
  }

  sub page_banner{
    my @banners = ( "PERL: The swiss army chainsaw of computer programming.",
                    "PERL: There's more than one way to do it",
                    "How many PERL Programmers does it take to change a light bulb?
                     A million, one to do it and the rest to try to do it in fewer lines",
                  );
    my $index = int(rand(3));
    my $quote = $banners[$index];

    return $quote;
  }

1;

