#!/usr/local/bin/perl

use CGI qw(:standard :html);

$recipients="jeo\@math,rll\@math,jmr\@math,bhunt\@math";
@recipientlist=("Brian Hunt","Ron Lipsman","John Osborn","Jonathan Rosenberg");
$labels{'jmr\@math'}="Jonathan Rosenberg";
$labels{'bhunt\@math'}="Brian Hunt";
$labels{'jeo\@math'}="John Osborn";
$labels{'rll\@math'}="Ron Lipsman";
$mailprog = '/usr/lib/sendmail';

$title = 'Contact Us';

print header;

print start_html(-title=>$title,
		 -BGCOLOR=>'white',
		 -BACKGROUND=>"../images/border.gif");

###################################################################
print "<table width=700>
<tr><td width=200 valign=top>

<IMG valign=top align=left  hspace=10 vspace=5 width=100 height=125 SRC=\"../images/Hunt_fnlcvr.jpg\"><BR Clear=all>
<IMG align=left hspace=10 vspace=5 SRC=\"../images/dewmmas.jpg\"><BR Clear=all>
<IMG align=left hspace=10 vspace=5 SRC=\"../images/dewmpls.jpg\"><BR Clear=all>
<BR>

<DL>
  <DT><A HREF=\"../index.html\"  >Home</A>
  <DT><A HREF=\"../description.html\">Project Description</A>
  <DT><A HREF=\"../authors.html\"  >Authors</A>
  <DT><A HREF=\"../cgi-bin/comments.cgi\"  >Contact Us</A><br><br>       
  <DT><A HREF=\"../DewMtlb.html\"><em>Differential Equations<br>&nbsp; with Matlab</em></A>
       <UL compact>
       	 <LI><A HREF=\"../dewmtlb_preface.html\" >Preface</A>
	 <LI><A HREF=\"../dewmtlb_contents.html\" >Contents</A>
	 <LI><A HREF=\"../sample_problemMtlb.html\"  >Samples</A>
	 <LI><A HREF=\"http://www.wiley.com/search\">Ordering</A>
	 <LI><A HREF=\"../Mfiles\" >Mfiles</A>
       </UL><br><br>
  <DT><A HREF=\"../DewMma.html\"><em>Differential Equations<br>&nbsp; with Mathematica</em></A>
       <UL>
	 <LI><A HREF=\"../dewmma_preface.html\" >Preface</A>
	 <LI><A HREF=\"../dewmma_contents.html\" >Contents</A>
	 <LI><A HREF=\"../sample_problemMma.html\">Samples</A>
	 <LI><A HREF=\"http://www.wiley.com/search\">Ordering</A>
       </UL><br><br>
  <DT><A HREF=\"../DewMpl.html\"><em>Differential Equations<br>&nbsp; with Maple</em></A>
       <UL compact>
	 <LI><A HREF=\"../dewmpl_preface.html\" >Preface</A>
	 <LI><A HREF=\"../dewmpl_contents.html\" >Contents</A>
	 <LI><A HREF=\"../sample_problemMpl.html\"  >Samples</A>
	 <LI><A HREF=\"http://www.wiley.com/search\">Ordering</A>
       </UL><br><br>

</DL>
</td><td width=400>";

print "<IMG valign=top align=center width=234 SRC=\"../images/F-5.gif\"><BR Clear=all>";
###if first time called or via cancel button
unless (param()) {
    print center(h1("The SCHOLaR ODE Project")),
    p, center(h2('Contact Us')),
    p,"Please use this form to send us your comments and to request information about our books or projects.",
    br,
    start_form(),
    table(TR(td("Your Name:"),td(textfield(-name=>'name',-size=>40))),
	  TR(td("Affiliation:"),td(textfield(-name=>'affiliation', -size=>40))),
	  TR(td("Email Address:",br,br),td(textfield(-name=>'email',-size=>40),br,br)),
	  TR(td("Comments:"),td()),
	  TR(td({-colspan=>2}, textarea(-name=>'comments',-rows=>20,-columns=>50))),
	  td(submit(-name=>"Submit"))),
#    "If you want to target your request or comment to a specific author, use this selection list.",br,
#    scrolling_list(-name=>'recipient',
#               -value=>[@recipientlist],
#               -labels=>\%labels,
#               -size=>5),
    end_form} 
else {
    open (MAIL, "|$mailprog $recipients") 
	|| die "Can't open $mailprog!\n";
    print MAIL "Subject: Comment from SCHOL ODE site\n\n";
    print MAIL "Name: ",param('name'),"\n",
    "Affiliation: ",param('affiliation'),"\n",
    "Email: ",param('email'),"\n\n",
    param('comments');
    close(MAIL);
    print h3("Thank you for your comments.");
}

print "</td></tr></table>";
print end_html();
    




