<?php
function Output($render, $stage){
include("common.php3");
if ($render == "www"){
	pagetop("AW Buildings FAQ -- WWW");
} else {
	pagetop("AW Buildings FAQ -- AW");
}

pagemiddle($render, "faq");

// Begin unique content here.
if ($stage == 1) {
print "<p>\n";
print "There are no Frequently Asked Questions yet, since the data base \n";
print "has only just opened.  If you <i>have</i> a question, please \n";
print "send it to me:\n";
print "</p>\n";
print "<p>\n";
print "<form action=\"faq.php3?render=".$render."\" method=\"POST\" name=\"messageForm\">\n";
print "<table align=\"center\" cellspacing=\"2\" cellpadding=\"2\" border=\"0\">\n";
if ($render == "www"){
print "<tr>\n";
print "<td>Address: <input type=\"Text\" name=\"from\" size=\"64\" maxlength=\"1024\" tabindex=\"1\" value=\"Your email address here.\"></td>\n";
print "</tr>\n";
print "<tr>\n";
print "<td>Subject: <input type=\"Text\" name=\"subject\" size=\"64\" maxlength=\"1024\" tabindex=\"2\"></td>\n";
print "</tr>\n";
print "<tr>\n";
print "<td>\n";
print "<textarea name=\"messagebody\" cols=\"64\" rows=\"12\" wrap=\"PHYSICAL\" tabindex=\"3\"></textarea>\n";
print "</td>\n";
print "</tr>\n";
print "<tr>\n";
print "<td>\n";
print "<input type=\"Submit\" name=\"submit\" value=\"Submit\" tabindex=\"4\">\n";
print "</td>\n";
print "</tr>\n";
} else {
print "<tr>\n";
print "<td>Address: <input type=\"Text\" name=\"from\" size=\"20\" maxlength=\"1024\" tabindex=\"1\" value=\"Your email address here.\"></td>\n";
print "</tr>\n";
print "<tr>\n";
print "<td>Subject: <input type=\"Text\" name=\"subject\" size=\"20\" maxlength=\"1024\" tabindex=\"2\"></td>\n";
print "</tr>\n";
print "<tr>\n";
print "<td>\n";
print "<textarea name=\"messagebody\" cols=\"24\" rows=\"12\" wrap=\"PHYSICAL\" tabindex=\"3\"></textarea>\n";
print "</td>\n";
print "</tr>\n";
print "<tr>\n";
print "<td>\n";
print "<input type=\"Submit\" name=\"submit\" value=\"Submit\" tabindex=\"4\">\n";
print "</td>\n";
print "</tr>\n";
}
print "</table>\n";
print "</form>\n";
print "</p>\n";
} else {
	print "<p>Message sent!  Thanks for your input. :-)</p>\n";
}
// End unique content.
pagebottom();
}

if (!$render) {
	$render = "www";
}

if (($render != "aw") && ($render != "www")) {
	$render = "www";
}

if ($submit) {
	include ("sendmail.php3");
	$date = date("D, d M Y H:i:s");
	$sent = send_mail("selanit@atuan.com",  $from, $subject, $date, $messagebody);
	if ($sent){
	Output($render, 2);
	} else {
	print "Error sending message. :-(\n";
	}

} else {
Output($render, 1);
}

?>