// JavaScript Document
<!-- Begin to hide script contents from old browsers

function formSubmit(formobj)
{
	if (formValidate(formobj))
	{
	}
	else
	{
		return(false);
	}
}

function formValidate(formobj)
{
   // Array of all feild names to be checked
   var fieldRequired = Array(	"rep_name", "rep_phone", "rep_email", "month_tot_hours", "date_month", 
   								"date_year", "agency_name", "agency_sup", "serv_descr");

   // Array of all correlating descriptions to the previous array (what will be displayed by the alert window)
   var fieldDescription = Array("Name", "Phone Number", "Email",
   								"Total hours for month", "Date : Month", "Date : Year", "Event or Agency Name",
   								"Agency Supervisor", "Description of Service");

	if (formobj.usm_org)
	{
		if (formobj.usm_org.options[formobj.usm_org.selectedIndex].value == "-1")
		{
			alert("Please choose a USM Organization.");
			
			formobj.usm_org.focus();
			
			return (false);
		}
	}
	
  	if (!formCheck(formobj, fieldRequired, fieldDescription))
		return(false);
	
	if (formobj.usm_org)
	{
		if (formobj.usm_org.options[formobj.usm_org.selectedIndex].value == "Other") 
		{
			if ((checkForNull(formobj.usm_org_other.value) == "") || (formobj.usm_org_other.value == "For Other, specify here"))
			{
				alert("If you choose \"Other\", please specify the USM Organization.");
				
				formobj.usm_org_other.focus();
				
				return (false);
			}
		}
	}

      // Check the Phone field
	if (!isPhoneNumber(formobj.rep_phone.value))
	{
		alert("Invalid format for Day Phone.\n\nPlease enter as (###-###-####).");
		
		formobj.rep_phone.focus();
		
		return(false);
	}
	
	// Check email format to make sure it follows email address requirements
	if (!echeck(formobj.rep_email.value))
	{
		alert("Invalid email address!\n\nFormat should be <username>@<domain>.<extension>\n\nExample \"me@mydomain.com\"");
		
		formobj.rep_email.focus();
		
		return (false);
	}
	
	if (formobj.agency_name.options[formobj.agency_name.selectedIndex].value == "-1")
	{
		alert("Please choose a Event or Agency.");
		
		formobj.agency_name.focus();
		
		return (false);
	}
	
	if (formobj.agency_name.options[formobj.agency_name.selectedIndex].value == "Other") 
	{
		if ((checkForNull(formobj.agency_other.value) == "") || (formobj.agency_other.value == "For Other, specify here"))
		{
			alert("If you choose \"Other\", please specify the Event or Agency name.");
			
			formobj.agency_other.focus();
			
			return (false);
		}
	}//usm_org_other
	
	if (!isNumeric(formobj.month_tot_hours.value))
	{
		alert("The value you entered for \"Total hours for month\" is not a number.\n\nPlease enter a number.");
		
		formobj.month_tot_hours.focus();
		
		return (false);
	}
	
	if (formobj.num_volunteer)
	{
		
		if ((!isNumeric(formobj.num_volunteer.value)) || (formobj.num_volunteer.value == ""))
		{
			alert("Please enter a number for \"Number of Volunteers\"");
			
			formobj.num_volunteer.focus();
			
			return (false);
		}
	}
	
	
  	 
	return(true);
}
   
// End the hiding here -->