function mailChk(theForm)
{

  if (theForm.eMail.value == "")
  {
    alert("Please enter a value for the \"mail\" field.");
    theForm.eMail.focus();
    return (false);
  }
  return (true);
}


function formChk(theForm)
{

  if (theForm.Name.value == "")
  {
    alert("Please enter a value for the \"Name\" field.");
    theForm.Name.focus();
    return (false);
  }

  if (theForm.Company.value == "")
  {
    alert("Please enter a value for the \"Company\" field.");
    theForm.Company.focus();
    return (false);
  }

  if (theForm.Street.value == "")
  {
    alert("Please enter a value for the \"Address\" field.");
    theForm.Street.focus();
    return (false);
  }

  if (theForm.City.value == "")
  {
    alert("Please enter a value for the \"City\" field.");
    theForm.City.focus();
    return (false);
  }

  if (theForm.State.value == "")
  {
    alert("Please enter a value for the \"State\" field.");
    theForm.State.focus();
    return (false);
  }

  if (theForm.ZipCode1.value == "")
  {
    alert("Please enter a value for the \"Zip\" field.");
    theForm.ZipCode1.focus();
    return (false);
  }
  theForm2 = theForm.ZipCode1;
  var chrResult = chrChk(theForm2);
  if (!chrResult)
  {
    alert("Please enter a value for the \"Zip\" field in a half-size.");
    theForm2.focus();
    return (false);
  }

  if (theForm.Country.value == "")
  {
    alert("Please enter a value for the \"Country\" field.");
    theForm.Country.focus();
    return (false);
  }

  if (theForm.Tel.value == "")
  {
    alert("Please enter a value for the \"tel\" field.");
    theForm.Tel.focus();
    return (false);
  }

  if (theForm.eMail.value == "")
  {
    alert("Please enter a value for the \"mail\" field.");
    theForm.eMail.focus();
    return (false);
  }

  if (theForm.eMail2.value == "")
  {
    alert("Please enter a value for the \"mail(Confirmation)\" field.");
    theForm.eMail2.focus();
    return (false);
  }

  if (theForm.eMail.value != theForm.eMail2.value)
  {
    alert("The mail address is not corresponding.");
    theForm.eMail2.focus();
    return (false);
  }

  if (theForm.Kenmei.value == "")
  {
    alert("Please enter a value for the \"subject\" field.");
    theForm.Kenmei.focus();
    return (false);
  }

  if (theForm.Naiyo.value == "")
  {
    alert("Please enter a value for the \"comments\" field.");
    theForm.Naiyo.focus();
    return (false);
  }

  return (true);
}


function chrChk(theForm)
{
  var checkOK  = "0123456789";
  checkOK = checkOK + "abcdefghijklmnopqrstuvwxyz";
  checkOK = checkOK + "ABCDEFGHIJKLMNOPQRSTUVWXYZ";
  var checkStr = theForm.value;
  var allValid = true;
  var validGroups = true;
  var decPoints = 0;
  var allNum = "";
  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;
    }
    allNum += ch;
  }
  if (!allValid)
  {
    return (false);
  }
  return (true);
} 
