function check_form ()
{
  valid = true; // assume valid

  if (document.victory.fname.value.length == 0)
     { valid = false; alert('First Name Must be Filled In!');
      document.victory.fname.focus();return false; }
  if (document.victory.lname.value.length == 0)
     { valid = false; alert('Last Name Must be Filled In!');
      document.victory.lname.focus();return false; }

  if (document.victory.address.value.length == 0)
     { valid = false; alert('Address Must be Filled In with Street Number and Name');
      document.victory.address.focus(); return false;}

  if (document.victory.city.value.length == 0)
     { valid = false; alert('City Must be Filled In!');
      document.victory.city.focus(); return false;}

  if (document.victory.state.selectedIndex == false )
     { valid = false; alert('State Must be Selected!');
      document.victory.state.focus();return false; }

	if (document.victory.zip.value.length == 0)
     { valid = false; alert('Zip Must be Filled In!');
      document.victory.zip.focus(); return false;}

	if (document.victory.dphone.value.length == 0)
     { valid = false; alert('Day Phone Number Must be Filled In!');
      document.victory.dphone.focus(); return false;}
	if (document.victory.ephone.value.length == 0)
     { valid = false; alert('Evening Phone Number Must be Filled In!');
      document.victory.ephone.focus(); return false;}

  if (document.victory.fname2.value.length > 0 ||
      document.victory.lname2.value.length > 0)
		{
				if (document.victory.fname2.value.length == 0)
					 { valid = false; alert('First Name (Person who this testimony is for) Must be Filled In!');
						document.victory.fname2.focus();return false; }
				if (document.victory.lname2.value.length == 0)
					 { valid = false; alert('Last Name (Person who this testimony is for) Must be Filled In!');
						document.victory.lname2.focus();return false; }

				if (document.victory.address2.value.length == 0)
					 { valid = false; alert('Address (Person who this testimony is for) Must be Filled In!');
						document.victory.address2.focus(); return false;}

				if (document.victory.city2.value.length == 0)
					 { valid = false; alert('City (Person who this testimony is for) Must be Filled In!');
						document.victory.city2.focus(); return false;}

				if (document.victory.state2.selectedIndex == false )
					 { valid = false; alert('State (Person who this testimony is for) Must be Selected!');
						document.victory.state2.focus();return false; }

				if (document.victory.zip2.value.length == 0)
					 { valid = false; alert('Zip (Person who this testimony is for) Must be Filled In!');
						document.victory.zip2.focus(); return false;}

				if (document.victory.dphone2.value.length == 0)
					 { valid = false; alert('Day (Person who this testimony is for) Phone Number Must be Filled In!');
						document.victory.dphone2.focus(); return false;}
				if (document.victory.ephone2.value.length == 0)
					 { valid = false; alert('Evening (Person who this testimony is for) Phone Number Must be Filled In!');
						document.victory.ephone2.focus(); return false;}
		}


	if (document.victory.hfrom.value.length == 0)
     { valid = false; alert('Healed From Must be Filled In!');
      document.victory.hfrom.focus(); return false;}

  if (!document.victory.q1[0].checked &&
		  !document.victory.q1[1].checked )
     { valid = false; alert('Were you diagnosed with the aforsaid from a professional doctor or practioner? MUST BE ANSWERED!');
      document.victory.q1[0].focus();return false; }

	if (!document.victory.q2[0].checked &&
		  !document.victory.q2[1].checked )
     { valid = false; alert('Were you hospitalized as a result of the aforsaid for any legnth of time? MUST BE ANSWERED!');
      document.victory.q2[0].focus();return false; }

	if (!document.victory.q3[0].checked &&
		  !document.victory.q3[1].checked )
     { valid = false; alert('Were you taking any medication for the initial health problem? MUST BE ANSWERED!');
      document.victory.q3[0].focus();return false; }

	if (!document.victory.q4[0].checked &&
		  !document.victory.q4[1].checked )
     { valid = false; alert('Has healing come as a direct result of prayer or laying on of hands for healing? MUST BE ANSWERED!');
      document.victory.q4[0].focus();return false; }

	if (document.victory.moh.selectedIndex == false )
     { valid = false; alert('Month of Healing (mm) Must be Selected!');
      document.victory.moh.focus();return false; }
  if (document.victory.doh.selectedIndex == false )
     { valid = false; alert('Day of Healing (dd) Must be Selected!');
      document.victory.doh.focus();return false; }
  if (document.victory.yoh.selectedIndex == false )
     { valid = false; alert('Year of Healing (yyyy) Must be Selected!');
      document.victory.yoh.focus();return false; }


	if (!document.victory.q6[0].checked &&
		  !document.victory.q6[1].checked )
     { valid = false; alert('Have you seen a doctor or practitioner since that date? MUST BE ANSWERED!');
      document.victory.q6[0].focus();return false; }

	if (!document.victory.q7[0].checked &&
		  !document.victory.q7[1].checked )
     { valid = false; alert('Has he/she confirmed that the original ailment is gone? MUST BE ANSWERED!');
      document.victory.q7[0].focus();return false; }

	if (document.victory.q6[1].checked &&
	    document.victory.q8.value.length == 0)
     { valid = false; alert('If you have not seen a practitioner, what is your personal evaluation of your current condition as opposed to the former? MUST BE ANSWERED!');
      document.victory.q8.focus(); return false;}

	if (document.victory.testimony.value.length == 0)
     { valid = false; alert('Please Describe Your Victory Testimony');
      document.victory.testimony.focus(); return false;}

	if (document.victory.sign.value.length == 0)
     { valid = false; alert('Digital Signature Must be Filled In!');
      document.victory.sign.focus(); return false;}


  if (valid)
       {
				alert("Please be patient while your form is processed. \n" +
								 "DO NOT CLICK SUBMIT AGAIN, \n" + 
								 "It can result in a duplicate information." +
								 "\n\n Click OK to Continue.");

				if (document.victory.q1[0].checked){document.victory.q1x.value = "YES";}
				if (document.victory.q1[1].checked){document.victory.q1x.value = "NO";}
				if (document.victory.q2[0].checked){document.victory.q2x.value = "YES";}
				if (document.victory.q2[1].checked){document.victory.q2x.value = "NO";}
				if (document.victory.q3[0].checked){document.victory.q3x.value = "YES";}
				if (document.victory.q3[1].checked){document.victory.q3x.value = "NO";}
				if (document.victory.q4[0].checked){document.victory.q4x.value = "YES";}
				if (document.victory.q4[1].checked){document.victory.q4x.value = "NO";}
				document.victory.q5x.value = document.victory.moh.value + "/" + document.victory.doh.value + "/" + document.victory.yoh.value; 

				if (document.victory.q6[0].checked){document.victory.q6x.value = "YES";}
				if (document.victory.q6[1].checked){document.victory.q6x.value = "NO";}
				if (document.victory.q7[0].checked){document.victory.q7x.value = "YES";}
				if (document.victory.q7[1].checked){document.victory.q7x.value = "NO";}

				document.victory.submit();
				return true;

        }

   document.victory.fname.focus();
//   document.victory.email.focus();
   return false;
}


function VerifyEmailaddress1()
{
  var Reason  = "Your Email address1 appears incorrect.  \n\nPlease check. \n\nReason:"
  var Success = "Email address1 entered Correctly!"
  var checkStr = document.victory.email.value;
  var ix = (checkStr.length - 4)
  var RC = true;
  var x = AtSignValid = DoublePeriod = PeriodValid = SpaceValid = ExtValid = RL = 0;

  for (i = 0;  i < checkStr.length;  i++)
  {
    if (checkStr.charAt(i) == '@')
      AtSignValid++;
    else if (checkStr.charAt(i) == '.')
    {
      if (x == (i-1))
        DoublePeriod++;
      else
      {
        x = i;
        PeriodValid++;
      }
    }
    else if (checkStr.charAt(i) == ' ')
      SpaceValid ++;
  }
  if (checkStr.indexOf(".com", ix) > -1)
    ExtValid++;
  else if (checkStr.indexOf(".edu", ix) > -1)
    ExtValid++;
  else if (checkStr.indexOf(".biz", ix) > -1)
    ExtValid++;
  else if (checkStr.indexOf(".net", ix) > -1)
    ExtValid++;
  else if (checkStr.indexOf(".org", ix) > -1)
    ExtValid++;
  else if (checkStr.indexOf(".gov", ix) > -1)
    ExtValid++;
  else if (checkStr.indexOf(".mil", ix) > -1)
    ExtValid++;
  else if (checkStr.indexOf(".cc", ix) > -1)
    ExtValid++;
  RL = Reason.length;
  if (AtSignValid != 1)
    Reason += "\nOnly one '@' allowed, " + AtSignValid + " found.";
  if (PeriodValid == 0)
    Reason += "\naddress1 must contain at least one period.";
  if (SpaceValid > 0)
    Reason += "\nNo Spaces allowed. address1 contains " + SpaceValid + " space";
  if (SpaceValid > 1)
    Reason += "s.";
  if (checkStr.length > 120)
    Reason += "\nPlease limit the Email address1 to 120 characters.";

  if (RL != Reason.length)
  {
 alert(Reason);
 return false;
  }
  return true;
}
