// JavaScript Document

/***********************************************
* Email Validation script- © Dynamic Drive (www.dynamicdrive.com)
* This notice must stay intact for legal use.
* Visit http://www.dynamicdrive.com/ for full source code
***********************************************/

var emailfilter=/^\w+[\+\.\w-]*@([\w-]+\.)*\w+[\w-]*\.([a-z]{2,4}|\d+)$/i

function checkmail(e){
var returnval=emailfilter.test(e.value)
if (returnval==false){
e.select()
}
return returnval
}


function validate_form ( )
{
valid = true;


while ( valid == true)
{
	
        if ( document.Registration.First.value == "" )
        {
                alert ( "Please enter a First Name." );
				break;
                valid = false;
        }
		
		 if ( document.Registration.Last.value == "" )
        {
                alert ( "Please enter a Last Name." );
				break;
                valid = false;
        }
		
		 if ( document.Registration.AddressOne.value == "" )
        {
                alert ( "Please enter an Address." );
				break;
                valid = false;
        }
		
		  if ( document.Registration.State.selectedIndex == 0 )
        {
                alert ( "Please select a State." );
				break;
                valid = false;
        }

			 if ( document.Registration.City2.value == "" )
        {
                alert ( "Please enter a City." );
				break;
                valid = false;
        }
		
			 if ( document.Registration.Zip.value == "" )
        {
                alert ( "Please enter a Zip." );
				break;
                valid = false;
        }
		
			 if (( document.Registration.Phone1.value == "" )|| ( document.Registration.Phone2.value == "" )||( document.Registration.Phone3.value == "" ))
        {
                alert ( "Please enter a valid Phone Number." );
				break;
                valid = false;
        }
		
			 if ( document.Registration.Email.value == "" )
        {
                alert ( "Please enter an Email address." );
				break;
                valid = false;
        }
		
			 if ( document.Registration.ReEnterEmail.value == "" )
        {
                alert ( "Please confirm your email address." );
				break;
                valid = false;
        }
		
			 if ( document.Registration.ReEnterEmail.value != document.Registration.Email.value )
        {
                alert ( "Your email addresses did not match, please try again." );
				break;
                valid = false;
        }
		 
		 
		 
		 
		 if ( ( document.Registration.Info1[0].checked == false ) && ( document.Registration.			Info1[1].checked == false ) && ( document.Registration.Info1[1].checked == false ) )
        {
                alert ( "Please select a guitar play amount choice" );
				break;
                valid = false;
        }
		
			if((checkmail(document.Registration.Email) == false))
			 {
		         alert("Please enter a valid email address.")
				 break;
			 }

      
        if ( document.Registration.agreecheck.checked == false )
        {
              alert ( "Please check the Terms & Conditions box." );
                valid = false;
       }


}
				
        return valid;

}