function validateListForm(){
		
	// quickie references to my fields
	var name = document.getElementById('name');
	var email = document.getElementById('email');
	var suburb = document.getElementById('suburb');
		
	// check the inputs  (main function nav)
	if (alphaNumField(name, "mand", "your name.")) {
		if (emailField(email, "mand", "valid email address.")) {
			if (alphaNumField(suburb, "mand", "the suburb in which you live.")) {
				return true;
			}
		}
	}
	return false;
}

function validateUnsubscribeForm(){
		
	// quickie references to my fields
	var email = document.getElementById('email2');
		
	// check the inputs  (main function nav)
	if (emailField(email, "mand", "valid email address.")) {
		return true;
	}
	return false;
}

// function for checking alphanumeric text fields
function alphaNumField(element, which, fieldDesc) {
	var alphaNumExp = /^[-0-9a-zA-Z',&.'";:-_ /]+$/;
	if ((which == 'mand') && (element.value.length < 2)) {
		var shortStub = 'Please enter ';
		alert(shortStub + fieldDesc);
		element.focus(); // set the focus to this input
		return false;
	} else if ((element.value.length > 1) && (!element.value.match(alphaNumExp))) {
	var wrongStub = 'Please enter only letters and numbers for your ';
		alert(wrongStub + fieldDesc);
		element.focus();
		return false;
	} else {
		return true;
	}
}
	
// function for checking text areas
function textArea(element, which, message){
	if ((which == 'mand') && (element.value.length < 20)) {
		alert(message);
		element.focus();
		return false;
	} else {
		return true;
	}
}

// function for quickly checking email format (check again on server side)	
function emailField(element, which, fieldDesc){
	var emailExp = /^[\w\-\.\+]+\@[a-zA-Z0-9\.\-]+\.[a-zA-z0-9]{2,4}$/;
	if ((which == 'mand') && (element.value.length < 6)) {
		var shortStub = 'Please enter your ';
		alert(shortStub + fieldDesc);
		element.focus(); // set the focus to this input
		return false;
	} else if (element.value.match(emailExp)) {
		return true;
	} else {
		var wrongStub = 'Please check the format of your ';
		alert(wrongStub + fieldDesc);
		element.focus();
		return false;
	}
}
