function validate_email(field,alerttxt)
{
with (field)
    {
    apos=value.indexOf("@");
    dotpos=value.lastIndexOf(".");
    if (apos<1||dotpos-apos<2)
        {alert(alerttxt); return false;}
    }
}


function fall_validation()
{
    if ( document.MyForm.FirstName.value == "" )
    {
        alert ( "Please fill in the 'First Name' box." )
	MyForm.FirstName.focus();
        return false;
    }

    if ( document.MyForm.LastName.value == "" )
    {
        alert ( "Please fill in the 'Last Name' box." )
	MyForm.LastName.focus();
        return false;
    }

    if ( document.MyForm.Address.value == "" )
    {
        alert ( "Please fill in the 'Address' box." )
	MyForm.Address.focus();
        return false;
    }

    if ( document.MyForm.City.value == "" )
    {
        alert ( "Please fill in the 'City' box." )
	MyForm.City.focus();
        return false;
    }

    if ( document.MyForm.ZipCode.value == "" )
    {
        alert ( "Please fill in the 'Zipcode' box." )
	MyForm.ZipCode.focus();
        return false;
    }

    if ( MyForm.Grade.selectedIndex == 0 )
    {
        alert ( "Please select your grade level." )
	MyForm.Grade.focus();
        return false;
    }

    if ( document.MyForm.School.value == "" )
    {
        alert ( "Please fill in what school you attend." )
	MyForm.School.focus();
        return false;
    }

    if ( MyForm.ShirtSize.selectedIndex == 0 )
    {
        alert ( "Please select your adult shirt size." )
	MyForm.ShirtSize.focus();
        return false;
    }

    if ( document.MyForm.ParentName.value == "" )
    {
        alert ( "Please fill in the 'Parent Name' box." )
	MyForm.ParentName.focus();
        return false;
    }

    if (validate_email(document.MyForm.ParentEmail,"Please enter a valid Parent email address.")==false)
	{MyForm.ParentEmail.focus();
        return false;
    }

    if ( document.MyForm.ParentPhone.value == "" )
    {
        alert ( "Please fill in the 'Parent Phone' box." )
	MyForm.ParentPhone.focus();
        return false;
    }

    if ( MyForm.Volunteer.selectedIndex == 0 )
    {
        alert ( "Please let us know if you are interested in being a volunteer coach this season." )
	MyForm.Volunteer.focus();
        return false;
    }

    return true;
}


