function enroll_coach_form ( )
{
    valid = true;
    if ( document.coachform.institution.value == "" )
    {
        alert ( "Your Institution Name is Missing." );
        document.coachform.institution.focus();
        return false;
    }
    if ( document.coachform.hc_name.value == "" )
    {
        alert ( "Your Head Coaches Name is Missing." );
        document.coachform.hc_name.focus();
        return false;
    }
    if ( document.coachform.hc_email.value == "" )
    {
        alert ( "Your Head Coaches Email is Missing." );
        document.coachform.hc_email.focus();
        return false;
    }
    if ( document.coachform.hc_cell.value == "" )
    {
        alert ( "Your Head Coaches Cell Phone is Missing." );
        document.coachform.hc_cell.focus();
        return false;
    }
    if ( document.coachform.arrival.value == "" )
    {
        alert ( "Your planned arrival date is missing." );
        document.coachform.arrival.focus();
        return false;
    }

}




function enroll_pass_form ( )
{
    valid = true;
    if ( document.myform2.team.value == "" )
    {
        alert ( "Your Team Name is Missing." );
        document.myform2.team.focus();
        return false;
    }
    if ( document.myform2.coach.value == "" )
    {
        alert ( "Your Coaches Name is Missing." );
        document.myform2.coach.focus();
        return false;
    }
    if ( document.myform2.address.value == "" )
    {
        alert ( "Your Address is Missing." );
        document.myform2.address.focus();
        return false;
    }
    if ( document.myform2.city.value == "" )
    {
        alert ( "Your City is Missing." );
        document.myform2.city.focus();
        return false;
    }

    if ( document.myform2.zip.value == "" )
    {
        alert ( "Your Zip is Missing." );
        document.myform2.zip.focus();
        return false;
    }
    if ( document.myform2.email.value == "" )
    {
        alert ( "Your Email is Missing." );
        document.myform2.email.focus();
        return false;
    }
    if ( document.myform2.password.value == "" )
    {
        alert ( "Your Password is Missing." );
        document.myform2.password.focus();
        return false;
    }

}



function addplayer_form ( )
{
    valid = true;
    if ( document.addform.player.value == "" )
    {
        alert ( "Your Player Name is Missing." );
        document.addform.player.focus();
        return false;
    }
    if ( document.addform.jersey.value == "" )
    {
        alert ( "Your player's jersey number is missing." );
        document.addform.jersey.focus();
        return false;
    }
    if ( document.addform.address.value == "" )
    {
        alert ( "Your player's address is missing." );
        document.addform.address.focus();
        return false;
    }
    if ( document.addform.citystatezip.value == "" )
    {
        alert ( "Your city state and zip is Missing." );
        document.addform.citystatezip.focus();
        return false;
    }

    if ( document.addform.phone.value == "" )
    {
        alert ( "Your player phone is Missing." );
        document.addform.phone.focus();
        return false;
    }

}


function myPopup2() {
window.open( "pass_forgot.asp", "myWindow",
"status = 1, height = 300, width = 500, resizable = 0" )
}

function myPopup3() {
window.open( "camp_form_pass_forgot.asp", "myWindow",
"status = 1, height = 300, width = 500, resizable = 0" )
}

function echeck(str) {

		var at="@"
		var dot="."
		var lat=str.indexOf(at)
		var lstr=str.length
		var ldot=str.indexOf(dot)
		if (str.indexOf(at)==-1){
		   alert("Invalid E-mail Address Format")
		   return false
		}

		if (str.indexOf(at)==-1 || str.indexOf(at)==0 || str.indexOf(at)==lstr){
		   alert("Invalid E-mail Address Format")
		   return false
		}

		if (str.indexOf(dot)==-1 || str.indexOf(dot)==0 || str.indexOf(dot)==lstr){
		    alert("Invalid E-mail Address Format")
		    return false
		}

		 if (str.indexOf(at,(lat+1))!=-1){
		    alert("Invalid E-mail Address Format")
		    return false
		 }

		 if (str.substring(lat-1,lat)==dot || str.substring(lat+1,lat+2)==dot){
		    alert("Invalid E-mail Address Format")
		    return false
		 }

		 if (str.indexOf(dot,(lat+2))==-1){
		    alert("Invalid E-mail Address Format")
		    return false
		 }

		 if (str.indexOf(" ")!=-1){
		    alert("Invalid E-mail Address Format")
		    return false
		 }

 		 return true
	}

function ValidateForm(){
	var emailID=document.myform.Email

	if ((emailID.value==null)||(emailID.value=="")){
		alert("Please Enter your Email Address")
		emailID.focus()
		return false
	}
	if (echeck(emailID.value)==false){
		emailID.value=""
		emailID.focus()
		return false
	}
	return true
 }

function ValidateForm2(){
	var emailID=document.myform2.Email

	if ((emailID.value==null)||(emailID.value=="")){
		alert("Please Enter your Email Address")
		emailID.focus()
		return false
	}
	if (echeck(emailID.value)==false){
		emailID.value=""
		emailID.focus()
		return false
	}
	return true
 }

function pass_form ( )
{
    valid = true;
    if ( document.myform.Customer.value == "" )
    {
        alert ( "Please fill in your Name." );
        document.myform.Customer.focus();
        return false;
    }
    if ( document.myform.Email.value == "" )
    {
        alert ( "Please fill in your Email Address." );
        document.myform.Email.focus();
        return false;
    }
    if ( document.myform.cap.value == "" )
    {
        alert ( "Please fill in your Spam Guard Answer." );
        document.myform.cap.focus();
        return false;
    }
    if ( document.myform.Comments.value == "" )
    {
        alert ( "Please fill in the Comments field." );
        document.myform.Comments.focus();
        return false;
    }

}

