<!--
// Global Variables for script.
var allValid = true;
var allNum = "";
var checkStr="";
var validchars = true;
var atfound = false;
function FrontPage_Form1_Validator(theForm)
{
  //debugger;
  if (theForm.Firstname.value == "")
  {
    alert("Please enter a value for the \"First Name\" field.");
    theForm.Firstname.focus();
    return (false);
  }

  if (theForm.Firstname.value.length < 3)
  {
    alert("Please enter at least 3 characters in the \"First Name\" field.");
    theForm.Firstname.focus();
    return (false);
  }

  if (theForm.email.value == "")
  {
    alert("Please enter a value for the \"Your Email\" field.");
    theForm.email.focus();
    return (false);
  }

  if (theForm.email.value.length < 9)
  {
    alert("Please enter at least 9 characters in the \"Your Email\" field.");
    theForm.email.focus();
    return (false);
  }

  if (theForm.email.value.length > 70)
  {
    alert("Please enter at most 70 characters in the \"Your Email\" field.");
    theForm.email.focus();
    return (false);
  }

  var checkOK = "ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789--_@.";
  var checkStr = theForm.email.value;
  var allValid = true;
  for (i = 0;  i < checkStr.length;  i++)
  {
    ch = checkStr.charAt(i);
    for (j = 0;  j < checkOK.length;  j++)
      if (ch == checkOK.charAt(j))
        break;
    if (j == checkOK.length)
    {
      allValid = false;
      break;
    }
  }
  if (!allValid)
  {
    alert("Please enter only letter, digit and \"-_@.\" characters in the \"Your Email\" field.");
    theForm.email.focus();
    return (false);
  }
  
  ValidateEmail(theForm.email.value)

  if (!validchars)
  {
    alert("Please enter only letters, numbers and \"-@_.\" characters in the \"Your Email\"  entry.");
    theForm.email.focus();
    return (false);
  }

  if (!atfound)
  {
    alert("Please enter a valid email address in the \"Your Email\"  entry.");
    theForm.email.focus();
    return (false);
  }
  
  if (theForm.Lastname.value == "")
  {
    alert("Please enter a value for the \"Last Name\" field.");
    theForm.Lastname.focus();
    return (false);
  }

  if (theForm.Lastname.value.length < 3)
  {
    alert("Please enter at least 3 characters in the \"Last Name\" field.");
    theForm.Lastname.focus();
    return (false);
  }

  var checkOK = "ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz .\t\r\n\f";
  var checkStr = theForm.Title.value;
  var allValid = true;
  for (i = 0;  i < checkStr.length;  i++)
  {
    ch = checkStr.charAt(i);
    for (j = 0;  j < checkOK.length;  j++)
      if (ch == checkOK.charAt(j))
        break;
    if (j == checkOK.length)
    {
      allValid = false;
      break;
    }
  }
  if (!allValid)
  {
    alert("Please enter only letter and whitespace characters in the \"Title\" field.");
    theForm.Title.focus();
    return (false);
  }

  var checkOK = "ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789-.,- \t\r\n\f";
  var checkStr = theForm.Company.value;
  var allValid = true;
  for (i = 0;  i < checkStr.length;  i++)
  {
    ch = checkStr.charAt(i);
    for (j = 0;  j < checkOK.length;  j++)
      if (ch == checkOK.charAt(j))
        break;
    if (j == checkOK.length)
    {
      allValid = false;
      break;
    }
  }
  if (!allValid)
  {
    alert("Please enter only letter, digit, whitespace and \".,-\" characters in the \"Company Name\" field.");
    theForm.Company.focus();
    return (false);
  }

  if (theForm.WebSite.value.length > 70)
  {
    alert("Please enter at most 70 characters in the \"Your Web Site\" field.");
    theForm.WebSite.focus();
    return (false);
  }

  var checkOK = "ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789-:/.-";
  var checkStr = theForm.WebSite.value;
  var allValid = true;
  for (i = 0;  i < checkStr.length;  i++)
  {
    ch = checkStr.charAt(i);
    for (j = 0;  j < checkOK.length;  j++)
      if (ch == checkOK.charAt(j))
        break;
    if (j == checkOK.length)
    {
      allValid = false;
      break;
    }
  }
  if (!allValid)
  {
    alert("Please enter only letter, digit and \":/.-\" characters in the \"Your Web Site\" field.");
    theForm.WebSite.focus();
    return (false);
  }
  	
  if (theForm.Address1.value == "")
  {
    alert("Please enter a value for the \"Address Line 1\" field.");
    theForm.Address1.focus();
    return (false);
  }

  var checkOK = "ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789-., \t\r\n\f";
  var checkStr = theForm.Address1.value;
  var allValid = true;
  for (i = 0;  i < checkStr.length;  i++)
  {
    ch = checkStr.charAt(i);
    for (j = 0;  j < checkOK.length;  j++)
      if (ch == checkOK.charAt(j))
        break;
    if (j == checkOK.length)
    {
      allValid = false;
      break;
    }
  }
  if (!allValid)
  {
    alert("Please enter only letter, digit, whitespace and \".,\" characters in the \"Address Line 1\" field.");
    theForm.Address1.focus();
    return (false);
  }

  if (theForm.HowFound.selectedIndex < 0)
  {
    alert("Please select one of the \"How Found\" options.");
    theForm.HowFound.focus();
    return (false);
  }

  if (theForm.HowFound.selectedIndex == 0)
  {
    alert("The first \"How Found\" option is not a valid selection.  Please choose one of the other options.");
    theForm.HowFound.focus();
    return (false);
  }

  if (theForm.Example.value.length > 70)
  {
    alert("Please enter at most 70 characters in the \"Example Site\" field.");
    theForm.Example.focus();
    return (false);
  }

  var checkOK = "ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789-:/.-";
  var checkStr = theForm.Example.value;
  var allValid = true;
  for (i = 0;  i < checkStr.length;  i++)
  {
    ch = checkStr.charAt(i);
    for (j = 0;  j < checkOK.length;  j++)
      if (ch == checkOK.charAt(j))
        break;
    if (j == checkOK.length)
    {
      allValid = false;
      break;
    }
  }
  if (!allValid)
  {
    alert("Please enter only letter, digit and \":/.-\" characters in the \"Example Site\" field.");
    theForm.Example.focus();
    return (false);
  }

  if (theForm.City.value == "")
  {
    alert("Please enter a value for the \"City\" field.");
    theForm.City.focus();
    return (false);
  }

  var checkOK = "ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz";
  var checkStr = theForm.City.value;
  var allValid = true;
  for (i = 0;  i < checkStr.length;  i++)
  {
    ch = checkStr.charAt(i);
    for (j = 0;  j < checkOK.length;  j++)
      if (ch == checkOK.charAt(j))
        break;
    if (j == checkOK.length)
    {
      allValid = false;
      break;
    }
  }
  if (!allValid)
  {
    alert("Please enter only letter, whitespace and \".\" characters in the \"City\" field.");
    theForm.City.focus();
    return (false);
  }

  if (theForm.Start.value.length > 10)
  {
    alert("Please enter at most 10 characters in the \"Start Date\" field.");
    theForm.Start.focus();
    return (false);
  }

  var checkOK = "0123456789-/-";
  var checkStr = theForm.Start.value;
  var allValid = true;
  for (i = 0;  i < checkStr.length;  i++)
  {
    ch = checkStr.charAt(i);
    for (j = 0;  j < checkOK.length;  j++)
      if (ch == checkOK.charAt(j))
        break;
    if (j == checkOK.length)
    {
      allValid = false;
      break;
    }
  }
  if (!allValid)
  {
    alert("Please enter only digit and \"/-\" characters in the \"Start Date\" field.");
    theForm.Start.focus();
    return (false);
  }

  if (theForm.State.value == "")
  {
    alert("Please enter a value for the \"State\" field.");
    theForm.State.focus();
    return (false);
  }

  var checkOK = "ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz";
  var checkStr = theForm.State.value;
  var allValid = true;
  for (i = 0;  i < checkStr.length;  i++)
  {
    ch = checkStr.charAt(i);
    for (j = 0;  j < checkOK.length;  j++)
      if (ch == checkOK.charAt(j))
        break;
    if (j == checkOK.length)
    {
      allValid = false;
      break;
    }
  }
  if (!allValid)
  {
    alert("Please enter only letter and whitespace characters in the \"State\" field.");
    theForm.State.focus();
    return (false);
  }

  if (theForm.Required.value.length > 10)
  {
    alert("Please enter at most 10 characters in the \"Required Date\" field.");
    theForm.Required.focus();
    return (false);
  }

  var checkOK = "0123456789-/-";
  var checkStr = theForm.Required.value;
  var allValid = true;
  for (i = 0;  i < checkStr.length;  i++)
  {
    ch = checkStr.charAt(i);
    for (j = 0;  j < checkOK.length;  j++)
      if (ch == checkOK.charAt(j))
        break;
    if (j == checkOK.length)
    {
      allValid = false;
      break;
    }
  }
  if (!allValid)
  {
    alert("Please enter only digit and \"/-\" characters in the \"Required Date\" field.");
    theForm.Required.focus();
    return (false);
  }

  if (theForm.Zip.value == "")
  {
    alert("Please enter a value for the \"Zip Code\" field.");
    theForm.Zip.focus();
    return (false);
  }

  if (theForm.Zip.value.length < 4)
  {
    alert("Please enter at least 4 characters in the \"Zip Code\" field.");
    theForm.Zip.focus();
    return (false);
  }

  if (theForm.Zip.value.length > 10)
  {
    alert("Please enter at most 10 characters in the \"Zip Code\" field.");
    theForm.Zip.focus();
    return (false);
  }

  var checkOK = "ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789--";
  var checkStr = theForm.Zip.value;
  var allValid = true;
  for (i = 0;  i < checkStr.length;  i++)
  {
    ch = checkStr.charAt(i);
    for (j = 0;  j < checkOK.length;  j++)
      if (ch == checkOK.charAt(j))
        break;
    if (j == checkOK.length)
    {
      allValid = false;
      break;
    }
  }
  if (!allValid)
  {
    alert("Please enter only letter, digit and \"-\" characters in the \"Zip Code\" field.");
    theForm.Zip.focus();
    return (false);
  }

  if (theForm.Contact.selectedIndex < 0)
  {
    alert("Please select one of the \"Contact Me By\" options.");
    theForm.Contact.focus();
    return (false);
  }

  if (theForm.Contact.selectedIndex == 0)
  {
    alert("The first \"Contact Me By\" option is not a valid selection.  Please choose one of the other options.");
    theForm.Contact.focus();
    return (false);
  }

  if (theForm.Phone.value == "")
  {
    alert("Please enter a value for the \"Phone\" field.");
    theForm.Phone.focus();
    return (false);
  }

  if (theForm.Phone.value.length < 10)
  {
    alert("Please enter at least 10 characters in the \"Phone\" field.");
    theForm.Phone.focus();
    return (false);
  }

  if (theForm.Phone.value.length > 12)
  {
    alert("Please enter at most 12 characters in the \"Phone\" field.");
    theForm.Phone.focus();
    return (false);
  }

  var checkOK = "0123456789--";
  var checkStr = theForm.Phone.value;
  var allValid = true;
  for (i = 0;  i < checkStr.length;  i++)
  {
    ch = checkStr.charAt(i);
    for (j = 0;  j < checkOK.length;  j++)
      if (ch == checkOK.charAt(j))
        break;
    if (j == checkOK.length)
    {
      allValid = false;
      break;
    }
  }
  if (!allValid)
  {
    alert("Please enter only digit and \"-\" characters in the \"Phone\" field.");
    theForm.Phone.focus();
    return (false);
  }

  if (theForm.Budget.selectedIndex < 0)
  {
    alert("Please select one of the \"Budget\" options.");
    theForm.Budget.focus();
    return (false);
  }

  if (theForm.Budget.selectedIndex == 0)
  {
    alert("The first \"Budget\" option is not a valid selection.  Please choose one of the other options.");
    theForm.Budget.focus();
    return (false);
  }

  if (theForm.Fax.value.length > 12)
  {
    alert("Please enter at most 12 characters in the \"Fax\" field.");
    theForm.Fax.focus();
    return (false);
  }

  var checkOK = "0123456789--";
  var checkStr = theForm.Fax.value;
  var allValid = true;
  for (i = 0;  i < checkStr.length;  i++)
  {
    ch = checkStr.charAt(i);
    for (j = 0;  j < checkOK.length;  j++)
      if (ch == checkOK.charAt(j))
        break;
    if (j == checkOK.length)
    {
      allValid = false;
      break;
    }
  }
  if (!allValid)
  {
    alert("Please enter only digit and \"-\" characters in the \"Fax\" field.");
    theForm.Fax.focus();
    return (false);
  }

  if (theForm.Bid.value.length > 9)
  {
    alert("Please enter at most 9 characters in the \"Competitive Bid\" field.");
    theForm.Bid.focus();
    return (false);
  }

  var checkOK = "0123456789-,";
  var checkStr = theForm.Bid.value;
  var allValid = true;
  for (i = 0;  i < checkStr.length;  i++)
  {
    ch = checkStr.charAt(i);
    for (j = 0;  j < checkOK.length;  j++)
      if (ch == checkOK.charAt(j))
        break;
    if (j == checkOK.length)
    {
      allValid = false;
      break;
    }
  }
  if (!allValid)
  {
    alert("Please enter only digit and \",\" characters in the \"Competitive Bid\" field.");
    theForm.Bid.focus();
    return (false);
  }

  if (theForm.Cell.value.length > 12)
  {
    alert("Please enter at most 12 characters in the \"Cell Phone\" field.");
    theForm.Cell.focus();
    return (false);
  }

  var checkOK = "0123456789--";
  var checkStr = theForm.Cell.value;
  var allValid = true;
  for (i = 0;  i < checkStr.length;  i++)
  {
    ch = checkStr.charAt(i);
    for (j = 0;  j < checkOK.length;  j++)
      if (ch == checkOK.charAt(j))
        break;
    if (j == checkOK.length)
    {
      allValid = false;
      break;
    }
  }
  if (!allValid)
  {
    alert("Please enter only digit and \"-\" characters in the \"Cell Phone\" field.");
    theForm.Cell.focus();
    return (false);
  }

  if (theForm.Competition.value.length > 70)
  {
    alert("Please enter at most 70 characters in the \"Competition Web Site\" field.");
    theForm.Competition.focus();
    return (false);
  }

  var checkOK = "ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789-:/.-";
  var checkStr = theForm.Competition.value;
  var allValid = true;
  for (i = 0;  i < checkStr.length;  i++)
  {
    ch = checkStr.charAt(i);
    for (j = 0;  j < checkOK.length;  j++)
      if (ch == checkOK.charAt(j))
        break;
    if (j == checkOK.length)
    {
      allValid = false;
      break;
    }
  }
  if (!allValid)
  {
    alert("Please enter only letter, digit and \":/.-\"\ characters in the \"Competitive Bid\" field.");
    theForm.Competition.focus();
    return (false);
  }

  if (theForm.body.value.length < 20)
  {
    alert("Please give us something to work with. Enter at least 20 characters in the \"Your Request\" field.");
    theForm.body.focus();
    return (false);
  }
  
  if (theForm.body.value.length > 3000)
  {
    alert("Please enter at most 3000 characters in the \"Your Request\" field.");
    theForm.body.focus();
    return (false);
  }
  return (true);
}

function ValidateEmail(checkStr) {
  var checkOK = "ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789-@_.";
  var ati = 0;     
  validchars = true;
  atfound = false;
  dotfound = false;
  www = 0;
  for (i = 0;  i < checkStr.length;  i++)
  {
    ch = checkStr.charAt(i);
    if (i < 4 && (ch == "W" ||  ch == "w" || ch ==".")) {www++}
    for (j = 0;  j < checkOK.length;  j++)
      if (ch == checkOK.charAt(j))
        {
        if (ch  == "@"  && i <  checkStr.length - 5)
           {
           ati  = i
           break;
           }
           else {
                 if (ati > 0 && ch == "." && i  > ati + 2 && i  < checkStr.length - 2)
                    {
                    atfound=true
                    break;
                    }
                    else {
                          if (ch == "." && i <  checkStr.length - 2)
                             {
                             dotfound=true
                             break;
                             }
                             else {
                                   break;
                                   }
                          }
                 }
    }
    if (j == checkOK.length)
       {
       validchars = false;
       break;
       }
  }
 return;
}
//-->