
var submitcount=0;

function checkForm(form)
{
	if (!isFilled(form.realname))
	{
		alert("Please enter your name.");
		form.realname.focus();
		return false;
	}

	if (isEmail(form.Email) == false)
	{
		alert("Please enter your email address.");
		form.Email.focus();
		return false;
	}
	else
	{
		checkSubmit();
	}
}

function checkSubmit()
{
	if (submitcount == 0)
	{
		submitcount++;
		return true;
	}
	else
	{
		alert("You have already submitted email.  Thanks!");
		return false;
	}
}

function isFilled(fld)
{
	if (fld.value == "" || fld.value == null)
	{
		return false;
	}
	else
	{
		return true;
	}
}

function isEmail(ema)
{
	if (ema.value.indexOf("@") != "-1"  &&
		ema.value.indexOf(".") != "-1" &&
		ema.value != "")
	{
		return true;
	}
	else
	{
		return false;
	}
}

function doRequest()
{
document.writeln('<FORM METHOD="POST" ACTION="./cgi-bin/main.pl"  ');
document.writeln('	onSubmit="return checkForm(this)"> ');
document.writeln('<input type="hidden" name="subject"  ');
document.writeln('	value="Prince Kuhio General Inquiry"> ');
document.writeln('<input type="hidden" name="Title"  ');
document.writeln('	value="You have an inquiry from http://www.prince-kuhio.com"> ');
document.writeln('<input type="hidden" name="redirect"  ');
document.writeln('	value="http://www.prince-kuhio.com/emailThanks.html"> ');
document.writeln('<input type="hidden" name="recipient" value="pkcom" /> ');
document.writeln('<input type="hidden" name="required" ');
document.writeln('	value="Title,Name,email,Message"> ');
document.writeln('<input type="hidden" name="print_config" value="Name,email,subject"> ');
document.writeln('<TABLE BORDER="2" CELLPADDING="8" CELLSPACING="0" WIDTH="450"  ');
document.writeln('	BGCOLOR="EEEEEE"> ');
document.writeln('<TR ALIGN=LEFT VALIGN=TOP> ');
document.writeln('<TD WIDTH="450"> ');
document.writeln('<P> ');
document.writeln('<FONT SIZE="-1" FACE="Helvetica, Arial" COLOR="#333333"> ');
document.writeln('	Please provide us with your <B>contact information</B>.</FONT> ');
document.writeln('<P> ');
document.writeln(' ');
document.writeln('<TABLE BORDER="0" CELLSPACING="0" CELLPADDING="0" WIDTH="450"> ');
document.writeln('<TR> ');
document.writeln('<TD><FONT SIZE="-1" FACE="Helvetica, Arial" COLOR="#7F7F7F"> ');
document.writeln('	Your Name:</FONT></TD> ');
document.writeln('<TD> ');
document.writeln('<INPUT TYPE="TEXT" NAME="Name" MAXLENGTH="60" SIZE="40"> ');
document.writeln('</TD> ');
document.writeln('</TR> ');
document.writeln(' ');
document.writeln('<TR> ');
document.writeln('<TD>&nbsp;</TD> ');
document.writeln('<TD>&nbsp;</TD> ');
document.writeln('</TR> ');
document.writeln(' ');
document.writeln('<TR> ');
document.writeln('<TD><FONT SIZE="-1" FACE="Helvetica, Arial" COLOR="#7F7F7F"> ');
document.writeln('	Day Telephone:</FONT></TD> ');
document.writeln('<TD> ');
document.writeln('<INPUT TYPE="TEXT" SIZE="6" MAXLENGTH="3" NAME="DayPhone">&nbsp; ');
document.writeln('<INPUT TYPE="TEXT" NAME="DayPhone" SIZE="30" MAXLENGTH="10"> ');
document.writeln('</TD> ');
document.writeln('</TR> ');
document.writeln('<TR> ');
document.writeln('<TD><FONT SIZE="-1" FACE="Helvetica, Arial" COLOR="#7F7F7F"> ');
document.writeln('	Evening Telephone:</FONT></TD> ');
document.writeln('<TD> ');
document.writeln('<INPUT TYPE="TEXT" SIZE="6" MAXLENGTH="3" NAME="NightPhone">&nbsp; ');
document.writeln('<INPUT TYPE="TEXT" NAME="NightPhone" SIZE="30" MAXLENGTH="10"> ');
document.writeln('</TD> ');
document.writeln('</TR> ');
document.writeln('<TR> ');
document.writeln('<br> ');
document.writeln('<TD><FONT SIZE="-1" FACE="Helvetica, Arial" COLOR="#7F7F7F"> ');
document.writeln('	Email Address</FONT></TD> ');
document.writeln('<TD><INPUT TYPE="TEXT" NAME="email" MAXLENGTH="50" SIZE="42"></TD> ');
document.writeln('</TR> ');
document.writeln('</TABLE> ');
document.writeln('<br> ');
document.writeln('<FONT SIZE="-1" FACE="Helvetica, Arial" COLOR="#333333"> ');
document.writeln('	Please enter any questions or comments that you have in the ');
document.writeln('	space provided below.  You can enter as much text as you want.   ');
document.writeln('	</FONT><P> ');
document.writeln(' ');
document.writeln('<TABLE BORDER="0" CELLSPACING="0" CELLPADDING="0" WIDTH="400"> ');
document.writeln('<TR ALIGN=LEFT VALIGN=TOP> ');
document.writeln('<TD><FONT SIZE="-1" FACE="Helvetica, Arial" COLOR="#7F7F7F"> ');
document.writeln('	Questions&nbsp;&nbsp;</FONT></TD> ');
document.writeln('<TD><TEXTAREA NAME="Message" ROWS=4 COLS=40 wrap=virtual></TEXTAREA></TD> ');
document.writeln('</TR> ');
document.writeln('</TABLE> ');
document.writeln('<P> ');
document.writeln('<HR> ');
document.writeln('<P> ');
document.writeln('<CENTER> ');
document.writeln('<INPUT TYPE="SUBMIT" VALUE="Send Comment"> ');
document.writeln('</CENTER> ');
document.writeln('</FORM> ');
}
