//test affiliation selection

//global affiliation checked VAR
var affiliation_bool = false;  //ugly, using global var

function affiliation_checked()
{
	//affiliation radio selected
	//set global bool to true
	affiliation_bool = true;
	
	//e-mail check???
	
	//berklee id check???
}

//test contact info

function validate_form()
{	
	//test that an e-mail address is given
	e_mail_bool = false;
	
	email_at_sign_bool = false;
	
	if ( document.form1.email.value.indexOf('@') >= 0)
	{
		email_at_sign_bool = true;
	}
	
	if (document.form1.email.value != '') //email is filled
	{
		e_mail_bool = true;
	}
	
	//if no affiliation selected or emailed entered;
	// return false
	if (affiliation_bool && e_mail_bool && email_at_sign_bool) //true
	{
		return true; //submit form
	}
	else //false, alert
	{
	
		// & create alert message
		
		//---- might need to create a flexible message
		if (!e_mail_bool)
		{
			alert('please provide an email address');
		}
		if (!email_at_sign_bool)
		{
			alert('please provide a valid email address.\n\nFor example make sure you include the "@" symbol (name@example.com)');
		}
		if (!affiliation_bool)
		{
			alert('please specify your Berklee affiliation\nor\nselect "other"');
		}
		
		
		return false;
	}
}