function validateForm(theForm){	if (theForm.surname.value.length == 0)	{		alert("Please enter your surname!");		theForm.surname.focus();		return false;	}	else if (theForm.firstname.value.length == 0)	{		alert("Please enter your first name!");		theForm.firstname.focus();		return false;	}	else if (theForm.address.value.length == 0)	{		alert("Please enter your address!");		theForm.address.focus();		return false;	}	else if (theForm.city.value.length == 0)	{		alert("Please enter your city!");		theForm.city.focus();		return false;	}    else if (theForm.province.selectedIndex == 0)	{		alert ("Please select your province!");		theForm.province.focus();		return false;	}	else if (theForm.postalcode.value.length == 0)	{		alert("Please enter your postal code!");		theForm.postalcode.focus();		return false;	}	else if (ValidatePostalCode(theForm.postalcode.value) == false)	{		alert("Invalid postal code!");		theForm.postalcode.focus();		theForm.postalcode.select();		return false;	}	else if (theForm.areacode.value.length == 0)	{		alert("Please enter your area code!");		theForm.areacode.focus();		return false;	}	else if (isNaN(theForm.areacode.value))	{		alert("Area code must contain numbers only!");		theForm.areacode.focus();		theForm.areacode.select();		return false;	}	else if (theForm.areacode.value.length != 3)	{		alert("Invalid area code!");		theForm.areacode.focus();		theForm.areacode.select();		return false;	}	else if (theForm.workphone.value.length == 0)	{		alert("Please enter your work phone number!");		theForm.workphone.focus();		return false;	}	else if (isNaN(theForm.workphone.value))	{		alert("Phone number must contain numbers only!");		theForm.workphone.focus();		theForm.workphone.select();		return false;	}	else if (theForm.workphone.value.length != 7)	{		alert("Invalid phone number!");		theForm.workphone.focus();		theForm.workphone.select();		return false;	}	else if (theForm.homephone.value.length == 0)	{		alert("Please enter your home phone number!");		theForm.homephone.focus();		return false;	}	else if (isNaN(theForm.homephone.value))	{		alert("Phone number must contain numbers only!");		theForm.homephone.focus();		theForm.homephone.select();		return false;	}	else if (theForm.homephone.value.length != 7)	{		alert("Invalid phone number!");		theForm.homephone.focus();		theForm.homephone.select();		return false;	}	else if (theForm.email.value.length == 0)	{		alert("Please enter your e-mail address!");		theForm.email.focus();		return false;	}	else if (ValidateEmail(theForm.email.value) == false)	{		alert("Invalid e-mail address!");		theForm.email.focus();		theForm.email.select();		return false;	}    else if (theForm.Choice_1A.selectedIndex == 0)	{		alert ("Please select your 1st choice for the concurrent A session!");		theForm.Choice_1A.focus();		return false;	}    else if (theForm.Choice_2A.selectedIndex == 0)	{		alert ("Please select your 2nd choice for the concurrent A session!");		theForm.Choice_2A.focus();		return false;	}    else if (theForm.Choice_3A.selectedIndex == 0)	{		alert ("Please select your 3rd choice for the concurrent A session!");		theForm.Choice_3A.focus();		return false;	}    else if (theForm.Choice_1A.selectedIndex == theForm.Choice_2A.selectedIndex ||		 theForm.Choice_1A.selectedIndex == theForm.Choice_3A.selectedIndex ||		 theForm.Choice_2A.selectedIndex == theForm.Choice_3A.selectedIndex)	{		alert ("You have duplicated one of your 'A' selections!");		theForm.Choice_2A.focus();		return false;	}    else if (theForm.Choice_1B.selectedIndex == 0)	{		alert ("Please select your 1st choice for the concurrent B session!");		theForm.Choice_1B.focus();		return false;	}    else if (theForm.Choice_2B.selectedIndex == 0)	{		alert ("Please select your 2nd choice for the concurrent B session!");		theForm.Choice_2B.focus();		return false;	}    else if (theForm.Choice_3B.selectedIndex == 0)	{		alert ("Please select your 3rd choice for the concurrent B session!");		theForm.Choice_3B.focus();		return false;	}    else if (theForm.Choice_1B.selectedIndex == theForm.Choice_2B.selectedIndex ||		 theForm.Choice_1B.selectedIndex == theForm.Choice_3B.selectedIndex ||		 theForm.Choice_2B.selectedIndex == theForm.Choice_3B.selectedIndex)	{		alert ("You have duplicated one of your 'B' selections!");		theForm.Choice_2B.focus();		return false;	}    else if (theForm.Choice_1C.selectedIndex == 0)	{		alert ("Please select your 1st choice for the concurrent C session!");		theForm.Choice_1C.focus();		return false;	}    else if (theForm.Choice_2C.selectedIndex == 0)	{		alert ("Please select your 2nd choice for the concurrent C session!");		theForm.Choice_2C.focus();		return false;	}    else if (theForm.Choice_3C.selectedIndex == 0)	{		alert ("Please select your 3rd choice for the concurrent C session!");		theForm.Choice_3C.focus();		return false;	}    else if (theForm.Choice_1C.selectedIndex == theForm.Choice_2C.selectedIndex ||		 theForm.Choice_1C.selectedIndex == theForm.Choice_3C.selectedIndex ||		 theForm.Choice_2C.selectedIndex == theForm.Choice_3C.selectedIndex)	{		alert ("You have duplicated one of your 'C' selections!");		theForm.Choice_2C.focus();		return false;	}	    else if (theForm.music_ministry[0].checked == false &&    		 theForm.music_ministry[1].checked == false)	{		alert ("Please specify if you can help with the music ministry!");		return false;	}		return true;}function ValidateEmail(myEmail){	validRegExp = /^[^@]+@[^@]+.[a-z]{2,}$/i;	// search email text for regular exp matches	if (myEmail.search(validRegExp) == -1) 	{		return false;	} 	return true; }// Check that a Canadian postal code is validfunction ValidatePostalCode(myPostal){	if (myPostal.search)	{		myPostal = removeSpaces(myPostal);		if (myPostal.length == 6 &&			myPostal.search(/^[a-zA-Z]\d[a-zA-Z]\d[a-zA-Z]\d$/) != -1)		{			return true;		}		else if (myPostal.length == 7 &&				 myPostal.search(/^[a-zA-Z]\d[a-zA-Z]-\d[a-zA-Z]\d$/) != -1)		{			return true;		}		else		{			return false;		}	}	return true;}// Remove all spaces from a stringfunction removeSpaces(string){	var newString = '';	for (var i = 0; i < string.length; i++)	{		if (string.charAt(i) != ' ')		{			newString += string.charAt(i);		}	}	return newString;}