#!/usr/bin/perl
print "Content-type: text/html\n\n";
$dir = $ENV{'QUERY_STRING'};
@bgs = ("<body background='../images/backgrounds/ljust/rainbow/wet.jpg'><table border='0' width='100%'><tr><td width='130'></td><td width='*'>","<body background='../images/backgrounds/ljust/circles.jpg'><table border='0' width='100%'><tr><td width='125'></td><td width='*'>","<body background='../images/backgrounds/ljust/circlestairs.jpg'><table border='0' width='100%'><tr><td width='140'></td><td width='*'>","<body bgcolor='black' background='../images/backgrounds/ljust/rainbow/spectrum.jpg' text='white'><table border='0' width='100%'><tr><td width='130' text='white'></td><td width='*'>","<body bgcolor='black' background='../images/backgrounds/ljust/rainbow/stngls.jpg'><table border='0' width='100%'><tr><td width='130' text='white'></td><td width='*'>","<body background='../images/backgrounds/ljust/rainbow/specks.jpg'><table border='0' width='100%'><tr><td width='125'></td><td width='*'>","<body background='../images/backgrounds/ljust/rainbow/silky.jpg'><table border='0' width='100%'><tr><td width='126' text='#FFFF80'></td><td width='*'>","<body background='../images/backgrounds/ljust/dstflwr.jpg'><table border='0' width='100%'><tr><td width='128'></td><td width='*'>","<body bgcolor='black' background='../images/backgrounds/ljust/treehous.jpg'><table border='0' width='100%'><tr><td width='132' text='white'></td><td width='*'>","<body background='../images/backgrounds/ljust/greenfractal.jpg'><table border='0' width='100%'><tr><td width='130' text='#FFFF80'></td><td width='*'>","<body background='../images/backgrounds/ljust/rainbow/pastel-bg.jpg'><table border='0' width='100%'><tr><td width='136'></td><td width='*'>","<body background='../images/backgrounds/ljust/rainbow/roto.jpg'><table border='0' width='100%'><tr><td width='127'></td><td width='*'>","<body background='../images/backgrounds/ljust/rainbow/crystal.jpg'><table border='0' width='100%'><tr><td width='130'></td><td width='*'>","<body background='../images/backgrounds/ljust/rainbow/rainbow.jpg'><table border='0' width='100%'><tr><td width='130'></td><td width='*'>","<body background='../images/backgrounds/ljust/rainbow/splotchy.jpg'><table border='0' width='100%'><tr><td width='130'></td><td width='*'>","<body background='../images/backgrounds/ljust/rainbow/horizontal.jpg'><table border='0' width='100%'><tr><td width='130'></td><td width='*'>");
srand(time ^ $$);
$num = rand(@bgs); # Pick a Random Number
$background = $bgs[$num];

print "
<html><head><title>Post a Message</title></head>\n
\n
$background
<p align='center'><big><big><big>Post A Message! </big></big>[to group $dir]</big></p>
<form method='POST'
action='http://weber.u.washington.edu/~inspire/philosophy/wwwboard.cgi?$dir'>
  <table border='1' width='100%' height='288'>
    <tr>
      <td width='50%' height='282'>Your Name: (required, nicks o.k.)<input type='text' name='name' size='50'><br>
      <br>
      E-Mail: (optional)<input type='text' name='email' size='50'><p>Subject: (required)<input type='text'
      name='subject' size='50'><br>
      Optional Image URL: <input type='text' name='img' size='45'></td>
      <td width='50%' height='282'><div align='left'><p><big><font face='Book Antiqua'>Message:</font></big><br>
      <textarea COLS='43' ROWS='18' name='body'></textarea></td>
    </tr>
  </table>
  <div align='center'><center><p>
<input TYPE=image name='submit' border=0 alt='Send'
        src='../images/sendbutton.gif'>
<a href='add.cgi?$dir'>
<img src='../images/clearbutton.gif' border=0 alt='Clear'></a>
  </center></div>
</form>

<hr>\n
";
$show = "no";
if ($show eq "yes") {
print "<p>Sign up to receive updates to this message board via email!</p>

<form method='POST' action='/$dir/emailer.cgi'>
  <div align='center'><center><table border='3' cellpadding='3' cellwidth='3'>
    <tr>
      <th><b>Select Notification Action: </b><input TYPE='RADIO' NAME='action'
      VALUE='Subscribed'> Subscribe <input TYPE='RADIO' NAME='action' VALUE='Unsubscribed'>
      Unsubscribe<br>
      <b>Your Internet e-mail address:</b> <input type='text' size='40' name='email'></th>
    </tr>
    <tr>
      <th><input type='SUBMIT' value=' Submit Request '></th>
    </tr>";
}
print "
  </table>
  </center></div>
</form>
</body>
</html>";