function verify(theForm) {
var msg = "";
	msg += filled(theForm.firstname.value,theForm.firstname.id);
	msg += filled(theForm.surname.value,theForm.surname.id);
	msg += email(theForm.email.value,theForm.emailconfirm.value);
 	msg += confirmemail(theForm.email.value,theForm.emailconfirm.value);
	msg += codechk(theForm.northcote.checked,theForm.elwood.checked,theForm.washington.checked,theForm.boston.checked);
 	msg += security(theForm.code.value,theForm.code.id);
   if (msg != "") {
     alert(msg);
      return false;
   }
return true;
}

function filled(strng,id) {
var error = "";
if (strng == "") {
    error = "Please fill in your ";
 	error += id;
	error += ".\n";
 }
 return error;
}

function codechk(venue1,venue2,venue3,venue4) {
var error = "";
if ((venue1 == false)&&(venue2 == false)&&(venue3 == false)&&(venue4 == false)){
    error = "\nPlease select at least one location.";
 }
 return error;
}

function email(email, emailconfirm)
{
	var error = "";
	if (email == "" || emailconfirm == "")
	{
		error = "Please fill out both email fields.";
	}

	return error;
}

function confirmemail(email, emailconfirm)
{
	var error = "";
	if (email != emailconfirm)
	{
		error = "The email addresses you entered do not match.";
	}
	return error;
}

function security(strng,id) {
var error = "";
if (strng == "") {
    error = "\nPlease fill in the letters displayed in the ";
 	error += id;
	error += ".\n";
 }
 return error;
}