#!/usr/bin/perl
require ('cgi-lib.pl');

&PrintHeader;
print "Content-type: text/html\n\n";
print "<body bgcolor=\"#000000\" text=\"#FFFFFF\">";


if (defined $ENV{'REMOTE_ADDR'}) {
    $remote_addr = $ENV{'REMOTE_ADDR'};
} else {
    $remote_addr = "";
}

if (defined $ENV{'REMOTE_HOST'}) {
    $remote_addr = $ENV{'REMOTE_HOST'};
}


# Get the vaules from the form and process them...
&ReadParse (*input);
$input{issue} =~ tr/,/ /;   # remove any commas, since they're delimeters
$issue = $input{issue};
$sound = $input{sound};
$sender_email = $input{sender_email};
$senders_name = $input{senders_name};

$image = "http://www.hansen1.com/gifs/$issue";

if ($issue eq "ulapic25.jpg")  {
    $image = "http://www.contortionhomepage.com/ula/ulapic25.jpg"; }

if ($issue eq "slugs.jpg") {
	$image = "http://www.best.com/~drzeus/Slugs.jpg"; }

if ($issue eq "original.jpg") {
	    $image = "http://www.inmind.com/people/dglass/original.jpg"; }

print "
<center>
<h1>Customize your YikesCard</h1>
<img src=\"$image\"><br>
<font size=\"-1\">

All information stays
<A HREF=\"../yikes/private.html\" onClick=\"return popup(this, \'privacy\')\">private</A>.


</font>
<FORM METHOD=\"POST\" ACTION=\"http://www.hansen1.com/cgi/send2.cgi\">
<INPUT TYPE=hidden NAME=issue value=$issue>
<INPUT TYPE=hidden NAME=sound value=$sound>
Your Name: <INPUT TYPE=TEXT NAME=sender_name SIZE=30 MAXLENGTH=30 VALUE=\"$senders_name\">
Your Email: <INPUT TYPE=TEXT NAME=sender_email SIZE=30 MAXLENGTH=75 VALUE=\"$sender_email\"><br>
Their Name: <INPUT TYPE=TEXT NAME=recipient_name SIZE=30 MAXLENGTH=30>
Their Email: <INPUT TYPE=TEXT NAME=recipient_email SIZE=30 MAXLENGTH=75><br>
<textarea name=message rows=4 cols=60 max=320 wrap>
Happy Easter!</textarea>
<!-- Hi there! Thought you\'d enjoy this! </textarea> -->
<INPUT TYPE=SUBMIT VALUE=\"Preview & Send -->\">
<br>
Enter your personal message above<br>
";

if ($sender_email) {
    print "<p><a href=\"http://www.hansen1.com/yikes/\">Click here</a> to see if there\'s a different <i>Yikes!</i> photograph you\'d like to send...<br>";  }

print "
<SCRIPT TYPE=\"text/javascript\">
  <!--
  function popup(mylink, windowname)
  {
  if (! window.focus)return true;
  var href;
  if (typeof(mylink) == 'string')
     href=mylink;
  else
     href=mylink.href;
  window.open(href, windowname, 'width=350,height=330,resizable=yes,scrollbars=yes');
  return false;
  }
  //-->
  </SCRIPT>

</html>";
die;

