/////////////////////////////////////////////////
// JavaScript Document
// made external and modfied January 28, 2008 by 
// Marion A. Douglas
// IFAS Communication Services - 352-392-2411
//
// modified February 21, 2008 by
// Samantha E. Kennedy
// Manatee County Extension/ FCS Agent - 941-722-4524
// for use in 4-H forms
//
////////////////////////////////////////////////
function FrontPage_Form2_Validator(theForm)
{
	
	if (theForm.ClubName.value="")
	{
		alert("Please enter a value for the \"ClubName\" field.")
		theForm.ClubName.focus();
	}
	
	if (theForm.ReporterName.value="")
	{
		alert("Please enter a value for the \"ReporterName\" field.")
		theForm.ReporterName.focus();
	}
	
	if (theForm.ReporterPhone.value="")
	{
		alert("Please enter a value for the \"ReporterPhone\" field.")
		theForm.ReporterPhone.focus();
	}
	
	if (theForm.MeetingDate.value="")
	{
		alert("Please enter a value for the \"MeetingDate\" field.")
		theForm.MeetingDate.focus();
	}
	
	if (theForm.MeetingPlace.value="")
	{
		alert("Please enter a value for the \"MeetingPlace\" field.")
		theForm.MeetingPlace.focus();
	}

	if (theForm.ClubNews.value="")
	{
		alert("Please enter a value for the \"ClubNews\" field.")
		theForm.ClubNews.focus();
	}

 if (theForm.State.value == "")
 {
 alert("Please enter a value for the \"State\" field.");
 theForm.State.focus();
 return (false);
 }

 if (theForm.State.value.length < 2)
 {
 alert("Please enter at least 2 characters in the \"State\" field.");
 theForm.State.focus();
 return (false);
 }

 if (theForm.State.value.length > 2)
 {
 alert("Please enter at most 2 characters in the \"State\" field.");
 theForm.State.focus();
 return (false);
 }

 var checkOK = "ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz";
 var checkStr = theForm.State.value;
 var allValid = true;
 var validGroups = 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 characters in the \"State\" field.");
 theForm.State.focus();
 return (false);
 }

 if (theForm.Zip.value == "")
 {
 alert("Please enter a value for the \"Zip\" field.");
 theForm.Zip.focus();
 return (false);
 }

 if (theForm.Zip.value.length < 5)
 {
 alert("Please enter at least 5 characters in the \"Zip\" field.");
 theForm.Zip.focus();
 return (false);
 }

 if (theForm.Zip.value.length > 10)
 {
 alert("Please enter at most 10 characters in the \"Zip\" field.");
 theForm.Zip.focus();
 return (false);
 }

 var checkOK = "0123456789--";
 var checkStr = theForm.Zip.value;
 var allValid = true;
 var validGroups = 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 \"Zip\" field.");
 theForm.Zip.focus();
 return (false);
 }
 return (true);
}