// validates e-mail and verifycode 
function Form1_Validator(theForm)
{
  var code = theForm.Verify_Code.value;
  var vcode = "25624";
 
  if (vcode  != code)
  {
    alert("Please enter verification code as shown.");
    theForm.Verify_Code.focus();
    return (false);
  }

  if (theForm.email.value.length > 50  ||  theForm.email.value.length < 7)
  {
    alert("Please enter a valid e-mail address.");
    theForm.email.focus();
    return (false);
  }
  return (true);
}

// this will build the guest book form
// part 1
function GuestBook(id)
{
  var file_name = document.location.href;
  document.write('<table border="9" cellpadding="0" cellspacing="0" style="border-collapse: collapse" width="75%" bordercolor="#FF0000" height="340">');
    document.write('<tr>');
      document.write('<td width="100%" bgcolor="#FFFFCC" >');
      document.write('<center>');
        document.write('<p align="center">');
        document.write('<b>');
        document.write('<font color="#000080" size="4" face="arial">');
        document.write('<form action="/cgi-bin/cgiemail/contact/gb.txt" method="POST" name="Form1" onsubmit="return Form1_Validator(this)" language="JavaScript">');
        document.write('<input type="hidden" name="html_name" value="'+file_name+'">');
          document.write('<input type="hidden" name="success"  value="http://www.jmcutlery.com/confirm.html">');
          document.write('<font size="5" >');
          document.write('<br>Be the first to know about our  news and sales.<br>');
          document.write('Sign Our J. Mark Guest Register<br>');
          document.write('</font>');
          document.write('We never share your information or send you excessive email.<br>');
          document.write('<br>');
          document.write('<font color="#990000" size="4">');
          document.write('* Your email address<br>');
          document.write('<input type="text" size="50" name="email">');
          document.write('<br><br>Any Comments?...<br>');
          document.write('<textarea name="comment" rows="3" cols="35"></textarea>');
          document.write('<br><br>Enter Verification Code Shown In Image<br>');
          document.write('</font>');
          document.write('<img src="vcode.jpg" width="155" height="57">');
          document.write('<input type="text" size="10" name="Verify_Code"><br><br>');
          document.write('<input type="submit" value="send" name="'+id+'">');
          document.write('<input type="reset"  value="clear">');
        document.write('</form>');
        document.write('<br>Please Save this page in your favorites  and');
         document.write('<br>use your &quot;back&quot; arrow to return here after you click send.<br><br>');
        document.write('</font>');
        document.write('</b>');
        document.write('</p>');
      document.write('</center>');                          
      document.write('</td>');
    document.write('</tr>');
  document.write('</table>');
 



}
