function validate_email(field,alerttxt)
{
with (field)
    {
    apos=value.indexOf("@");
    dotpos=value.lastIndexOf(".");
    if (apos<1||dotpos-apos<2)
        {alert(alerttxt); return false;}
    }
}


function tryout_validation()
{
    if ( document.MyForm.First_Name.value == "" )
    {
        alert ( "Please fill in the 'First Name' box." )
	MyForm.First_Name.focus();
        return false;
    }

    if ( document.MyForm.Last_Name.value == "" )
    {
        alert ( "Please fill in the 'Last Name' box." )
	MyForm.Last_Name.focus();
        return false;
    }

    if (validate_email(document.MyForm.Player_Email,"Please enter a valid Player email address.")==false)
	{MyForm.Player_Email.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 ( document.MyForm.Player_Phone.value == "" )
    {
        alert ( "Please fill in the 'Player Phone' box." )
	MyForm.Player_Phone.focus();
        return false;
    }

    if ( document.MyForm.Age.value == "" )
    {
        alert ( "Please fill in the 'Age' box." )
	MyForm.Age.focus();
        return false;
    }

    if ( document.MyForm.DOB.value == "" )
    {
        alert ( "Please fill in the 'Date of Birth' box." )
	MyForm.DOB.focus();
        return false;
    }

    if ( document.MyForm.Parent_Name.value == "" )
    {
        alert ( "Please fill in the 'Parent Name' box." )
	MyForm.Parent_Name.focus();
        return false;
    }

    if (validate_email(document.MyForm.Parent_Email,"Please enter a valid Parent email address.")==false)
	{MyForm.Parent_Email.focus();
        return false;
    }

    if ( document.MyForm.Parent_Phone.value == "" )
    {
        alert ( "Please fill in the 'Parent Phone' box." )
	MyForm.Parent_Phone.focus();
        return false;
    }

    if ( MyForm.team_type.selectedIndex == 0 )
    {
        alert ( "Please select a team type." )
	MyForm.team_type.focus();
        return false;
    }


    if ( MyForm.Position1.selectedIndex == 0 )
    {
        alert ( "Please select a primary position.  This is informational only and not set in stone." )
	MyForm.Position1.focus();
        return false;
    }

    if ( document.MyForm.Agree.checked == false )
    {
        alert ( "Please check the 'I/We Agree' box." )
	MyForm.Agree.focus();
        return false;
    }

    if ( document.MyForm.Agree_Name.value == "" )
    {
        alert ( "Please fill in the 'Parent/Guardian Name' box." )
	MyForm.Agree_Name.focus();
        return false;
    }

    if ( MyForm.Jersey_Size.selectedIndex == 0 )
    {
        alert ( "Please select a jersey size." )
	MyForm.Jersey_Size.focus();
        return false;
    }

    if ( MyForm.Shirt_Size.selectedIndex == 0 )
    {
        alert ( "Please select a shirt size." )
	MyForm.Shirt_Size.focus();
        return false;
    }

    if ( MyForm.Sweatshirt_Size.selectedIndex == 0 )
    {
        alert ( "Please select a sweatshirt size." )
	MyForm.Sweatshirt_Size.focus();
        return false;
    }

    if ( MyForm.Spandex_Size.selectedIndex == 0 )
    {
        alert ( "Please select a spandex size." )
	MyForm.Spandex_Size.focus();
        return false;
    }

    return true;
}


