function isEmailAddr(email)
{
  var result = false
  var theStr = new String(email)
  var index = theStr.indexOf("@");
  if (index > 0)
  {
    var pindex = theStr.indexOf(".",index);
    if ((pindex > index+1) && (theStr.length > pindex+1))
	result = true;
  }
  return result;
}

function FormValidator(theForm)
{

if (document.theForm.q1[0].checked || document.theForm.q1[1].checked || document.theForm.q1[2].checked || document.theForm.q1[3].checked || document.theForm.q1[4].checked || document.theForm.q1[5].checked || document.theForm.q1[6].checked || document.theForm.q1[7].checked || document.theForm.q1[8].checked || document.theForm.q1[9].checked) {

} else {

alert("Please Answer: This program was easy to implement");
return (false);

}

if (document.theForm.q2[0].checked || document.theForm.q2[1].checked || document.theForm.q2[2].checked || document.theForm.q2[3].checked || document.theForm.q2[4].checked || document.theForm.q2[5].checked || document.theForm.q2[6].checked || document.theForm.q2[7].checked || document.theForm.q2[8].checked || document.theForm.q2[9].checked) {

} else {

alert("Please Answer: This program was helpful");
return (false);

}

if (document.theForm.q3[0].checked || document.theForm.q3[1].checked || document.theForm.q3[2].checked || document.theForm.q3[3].checked || document.theForm.q3[4].checked || document.theForm.q3[5].checked || document.theForm.q3[6].checked || document.theForm.q3[7].checked || document.theForm.q3[8].checked || document.theForm.q3[9].checked) {

} else {

alert("Please Answer: The instructions to this program were easy to understand");
return (false);

}

if (document.theForm.q4[0].checked || document.theForm.q4[1].checked || document.theForm.q4[2].checked || document.theForm.q4[3].checked || document.theForm.q4[4].checked || document.theForm.q4[5].checked || document.theForm.q4[6].checked || document.theForm.q4[7].checked || document.theForm.q4[8].checked || document.theForm.q4[9].checked) {

} else {

alert("Please Answer: I would recommend this program to other parents");
return (false);

}



if (theForm.realname.value.length < 2)
  {
    alert("Please enter your \"Name\".");
    theForm.realname.focus();
    return (false);
  }

  
  if (theForm.email.value == "")
  {
    alert("Please enter a value for the \"email\" field.");
    theForm.email.focus();
    return (false);
  }

  if (!isEmailAddr(theForm.email.value))
  {
    alert("Please enter a complete email address in the form: yourname@yourdomain.com");
    theForm.email.focus();
    return (false);
  }
   
  if (theForm.email.value.length < 3)
  {
    alert("Please enter at least 3 characters in the \"email\" field.");
    theForm.email.focus();
    return (false);
  }

if (theForm.Information.value.length < 12)
  {
    alert("Please enter a response for this question.");
    theForm.Information.focus();
    return (false);
  }

if (theForm.Favorite.value.length < 12)
  {
    alert("Please enter a response for this question.");
    theForm.Favorite.focus();
    return (false);
  }

if (theForm.Least.value.length < 12)
  {
    alert("Please enter a response for this question.");
    theForm.Least.focus();
    return (false);
  }


if (document.theForm.comments[0].checked) {
if (theForm.comment2.value.length < 12)
  {
    alert("Please enter your comments or suggestions.");
    theForm.comment2.focus();
    return (false);
  }


} else {


}


if (theForm.testimonial2.value.length < 12)
  {
    alert("Please enter your testimonial.");
    theForm.testimonial2.focus();
    return (false);
  }



  return (true);
}
