<!--
function checkJoinAssociateForm(theForm) {
	var pSurname 	= theForm.pSurname.value;	
	var pForename	= theForm.pForename.value;
	var pAddr1		= theForm.pAddr1.value;
	var pTown		= theForm.pTown.value;
	var pPostcode	= theForm.pPostcode.value;
	var pTel		= theForm.pTel.value;
	var pEmail		= theForm.pEmail.value;
    var pCollectionSoc  = theForm.pCollectionSoc.value;
    var pOrgMemNo       = theForm.pOrgMemNo.value;
    var pCAEno          = theForm.pCAEno.value;
    
	//1. check required fields
	if (pSurname 	== "") 	{ alert("Please enter your surname."); 			theForm.pSurname.focus(); 	return false;	}
	if (pForename 	== "")	{ alert("Please enter your first name."); 		theForm.pForename.focus();	return false;	}
	if (pAddr1 		== "")	{ alert("Please enter your address."); 			theForm.pAddr1.focus();		return false;	}
	if (pTown 		== "")	{ alert("Please enter your town."); 			theForm.pTown.focus();		return false;	}
	if (pPostcode 	== "")	{ alert("Please enter your postcode."); 		theForm.pPostcode.focus();	return false;	}
	if (pTel 		== "")	{ alert("Please enter your phone number.");		theForm.pTel.focus();		return false;	}
	if (pEmail 		== "")	{ alert("Please enter your email address.");	theForm.pEmail.focus();		return false;	}
	
	if(checkEmail(pEmail) != "") 	{
		alert (checkEmail(pEmail));
		theForm.pEmail.focus();
		return false;
	}	
	//var rcs = theForm.rcs.value;
	//if (!(radio_button_checker(theForm.rcs)))	{
	//	alert("Please choose whether you are a member of a collecting society or not .");	
	//	theForm.rcs[0].focus();		
	//	return false;	
	//}
	
	if (pCollectionSoc 		== "")	{
	    alert("Please enter the name of your collection society address.");	
	    theForm.pCollectionSoc.focus();		
	    return false;	
	}
	
	if ((pOrgMemNo == "") && (pCAEno == "")) { 
	    alert ("Please enter either your Society Membership Number or your CAE Number");	
	    theForm.pOrgMemNo.focus();		
	    return false;
	}
	
	if (!(radio_button_checker(theForm.pVote)))	{
		alert("Please indicate the genre you feel best represents the music you write:.");	
		theForm.pVote[0].focus();		
		return false;	
	}
	

	return true;
}

function checkJoinProfessionalForm(theForm) {
	var pSurname 			= theForm.pSurname.value;	
	var pForename			= theForm.pForename.value;
	var pAddr1				= theForm.pAddr1.value;
	var pTown				= theForm.pTown.value;
	var pPostcode			= theForm.pPostcode.value;
	var pTel				= theForm.pTel.value;
	var pEmail				= theForm.pEmail.value;
	var pCollectionSoc		= theForm.pCollectionSoc.value;
	var pOrgMemNo			= theForm.pOrgMemNo.value;
	var pCAEno				= theForm.pCAEno.value;
	

	//1. check required fields
	if (pSurname 	== "") 	{ alert("Please enter your surname."); 			theForm.pSurname.focus(); 	return false;	}
	if (pForename 	== "")	{ alert("Please enter your first name."); 		theForm.pForename.focus();	return false;	}
	if (pAddr1 		== "")	{ alert("Please enter your address."); 			theForm.pAddr1.focus();		return false;	}
	if (pTown 		== "")	{ alert("Please enter your town."); 			theForm.pTown.focus();		return false;	}
	if (pPostcode 	== "")	{ alert("Please enter your postcode."); 		theForm.pPostcode.focus();	return false;	}
	if (pTel 		== "")	{ alert("Please enter your phone number.");		theForm.pTel.focus();		return false;	}
	if (pEmail 		== "")	{ alert("Please enter your email address.");	theForm.pEmail.focus();		return false;	}
	
	if(checkEmail(pEmail) != "") 	{
			alert (checkEmail(pEmail));
			theForm.pEmail.focus();
			return false;
		}	
	
	if (((pCollectionSoc == "") && (pOrgMemNo == "")) && (pCAEno == ""))	{
		alert ("Please enter either your collecting society and your society membership number or your CAE number.");
		theForm.pOrgMemNo.focus();
		return false;
	}


	if (!(radio_button_checker(theForm.pVote)))	{
		alert("Please indicate the genre you feel best represents the music you write:.");	
		theForm.pVote[0].focus();		
		return false;	
	}
	

	return true;
}

function radio_button_checker(theButton)
{
	var radio_choice = false;

	// Loop from zero to the one minus the number of radio button selections
	for (counter = 0; counter < theButton.length; counter++)
	{
		// If a radio button has been selected it will return true
		if (theButton[counter].checked)	{
			return true; 
		}
	}
	return false;
}

function checkEmail (strng) {
	var error="";
	if (strng == "") {
	   error = "You didn't enter an email address.\n";
	}

    var emailFilter=/^.+@.+\..{2,3}$/;
    if (!(emailFilter.test(strng))) { 
       error = "Please enter a valid email address.\n";
    }
    else {
		//test email for illegal characters
		var illegalChars= /[\(\)\<\>\,\;\:\\\"\[\]]/
        //"
		if (strng.match(illegalChars)) {
    		error = "The email address contains illegal characters.\n";
		}
    }
	return error;    
}
//-->