function validate_form ( )
{
	valid = true;

        if ( document.sncregistration_form.first.value == "" )
        {
                alert ( "Please fill in Swimmer First Name box." );
                valid = false;
        }

 
       if ( document.sncregistration_form.last.value == "" )
        {
                alert ( "Please fill in Swimmer Last Name box." );
                valid = false;
        }

 
       if ( document.sncregistration_form.swimlevel.value == "" )
        {
                alert ( "Please fill in the 'Swim Level' box to help us place your swimmer." );
                valid = false;
        }


        if ( document.sncregistration_form.dob.value == "" )
        {
                alert ( "Please fill in the 'Birthdate' box." );
                valid = false;
        }


        if ( document.sncregistration_form.address.value == "" )
        {
                alert ( "Please fill in the 'Address' box." );
                valid = false;
        }


        if ( document.sncregistration_form.phone.value == "" )
        {
                alert ( "Please fill in the 'Phone Number' box." );
                valid = false;
        }

 // only allow 0-9, hyphen and comma be entered
var checkOK = "0123456789-,";
var checkStr = sncregistration_form.phone.value;
var allValid = true;
var decPoints = 0;
var allNum = "";
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 (ch != ",")
allNum += ch;
}
if (!allValid)
{
alert("Please enter the phone number as 123-123-1234 format.");
sncregistration_form.phone.focus();
return (false);
}


         if ( document.sncregistration_form.email.value == "" )
        {
                alert ( "Please provide your Email Address in the 'email' box for a confirmation email. If you do not have an email address, please enter 'None'. Thanks." );
                valid = false;
        }


        if ( document.sncregistration_form.carecard.value == "" )
        {
                alert ( "Please fill in the 'Care Card Number' box." );
                valid = false;
        }


        return valid;
}

