#!/usr/local/bin/perl

use CGI;
$query = new CGI;
print $query->header;
print $query->start_html('Popup Window');

if (!$query->param) {
    print "
Ask your Question
\n";
    print $query->startform(-target=>'_new');
    print "What's your name? ",$query->textfield('name');
    print "<P>What's the combination?<P>",
    $query->checkbox_group(-name=>'words',
			   -values=>['eenie','meenie','minie','moe'],
			   -defaults=>['eenie','moe']);

    print "<P>What's your favorite color? ",
    $query->popup_menu(-name=>'color',
		       -values=>['red','green','blue','chartreuse']),
    "<P>";
    print $query->submit;
    print $query->endform;

} else {
    print "
And the Answer is...
\n";
    print "Your name is ",$query->param(name),"\n";
    print "<P>The keywords are: ",join(", ",$query->param(words)),"\n";
    print "<P>Your favorite color is ",$query->param(color),"\n";
}
print qq{<P>Go to the documentation};
print $query->end_html;
