function validate_form ( )
{
	valid = true;


        if ( document.owregistration_form.first.value == "" )
        {
                alert ( "Please fill in Swimmer First Name box." );
                valid = false;
        }

 
       if ( document.owregistration_form.last.value == "" )
        {
                alert ( "Please fill in Swimmer Last Name box." );
                valid = false;
        }
 
        if ( document.owregistration_form.level.value == "" )
        {
                alert ( "Please fill in the 'Level' box." );
                valid = false;
        }

       if ( ( document.owregistration_form.session[0].checked == false ) && ( document.owregistration_form.session[1].checked == false ) && ( document.owregistration_form.session[2].checked == false ))
        {
                alert ( "Please choose the Session" );
                valid = false;
        }

       if ( ( document.owregistration_form.time[0].checked == false ) && ( document.owregistration_form.time[1].checked == false ) && ( document.owregistration_form.time[2].checked == false ) && ( document.owregistration_form.time[3].checked == false ) && ( document.owregistration_form.time[4].checked == false ))
        {
                alert ( "Please choose your preferred time" );
                valid = false;
        }

       if ( ( document.owregistration_form.session[2].checked) && ( document.owregistration_form.time[2].checked ) )
        {
                alert ( "Tues Thurs not offered in Session 3" );
                valid = false;
        }

       if ( ( document.owregistration_form.session[2].checked) && ( document.owregistration_form.time[3].checked ) )
        {
                alert ( "Tues Thurs not offered in Session 3" );
                valid = false;
        }

       if ( ( document.owregistration_form.session[2].checked) && ( document.owregistration_form.time[4].checked ) )
        {
                alert ( "Tues Thurs not offered in Session 3" );
                valid = false;
        }

     if ( document.owregistration_form.dob.value == "" )
        {
                alert ( "Please fill in the 'birth date' box." );
                valid = false;
        }

       if ( document.owregistration_form.gender.value == "" )
        {
                alert ( "Please fill in the Gender box." );
                valid = false;
        }

       if ( document.owregistration_form.mother.value == "" )
        {
                alert ( "Please fill in the 'Mother' box." );
                valid = false;
        }

       if ( document.owregistration_form.father.value == "" )
        {
                alert ( "Please fill in the 'Father' box." );
                valid = false;
        }

        if ( document.owregistration_form.phone.value == "" )
        {
                alert ( "Please fill in the 'phone' box." );
                valid = false;
        }


 // only allow 0-9, hyphen and comma be entered
var checkOK = "0123456789-,";
var checkStr = owregistration_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.");
owregistration_form.phone.focus();
return (false);
}

        if ( document.owregistration_form.email.value == "" )
        {
                alert ( "Please provide your Email Address in the 'email' box. A confirmation email will be sent to you. If you do not have an email address, please enter No. Thanks." );
                valid = false;
        }

   	if ( document.owregistration_form.address.value == "" )
        {
                alert ( "Please fill in the 'address' box." );
                valid = false;
        }

       if ( document.owregistration_form.postalcode.value == "" )
        {
                alert ( "Please fill in the 'postal' box." );
                valid = false;
        }


         return valid;
}



