function valForm(theForm) {
	var eMess = 'You have errors in your form!\n\n';
	var eFlag = false;
	
	for (var i=0; i<theForm.length; i++) {
		switch (theForm[i].name) {
			case 'contactName':
				if (theForm[i].value == '') {
					eFlag = true;
					eMess += '- Please provide a contact name\n';
				} else if (theForm[i].value.search(/[^a-zA-Z0-9 ]/g) != -1) {
					eFlag = true;
					eMess += '- Please only use letters and numbers for your contact name\n';
				}
				
				break;
			case 'contactPhone':
				if (theForm[i].value != '') {
					if (theForm[i].value.search(/[^0-9 ]/g) != -1) {
						eFlag = true;
						eMess += '- Please only use numbers and spaces for your contact number\n';
					}
				}
				
				break;
			case 'contactEmail':
				if (theForm[i].value == '') {
					eFlag = true;
					eMess += '- Please provide a contact email address\n';
				} else if (theForm[i].value.search(/^([\w ]+[ ]?<{1})?[\w._~-]+@[\w._~-]+\.[a-zA-Z]{2,5}>?$/i) == -1) {
					eFlag = true;
					eMess += '- The email address you provided does not seem to be valid\n';
				}
				
				break;
			case 'contactSubject':
				if (theForm[i].value == 'null') {
					eFlag = true;
					eMess += '- Please choose a subject\n';
				}
				
				break;
			case 'contactComments':
				if (theForm[i].value == '') {
					eFlag = true;
					eMess += '- Please provide your enquiry\n';
				} else if (theForm[i].value.search(/[a-zA-Z0-9'"!.,_ \n-]/g) == -1) {
					theForm[i].value = theForm[i].value.replace(/[^a-zA-Z0-9'"!.,_ \n-]/g, '');
					eFlag = true;
					eMess += '- Your enquiry contained invalid characters which have been removed. Please check the enquiry and continue\n';
				}
				
				break;
		}
	}
	
	if (eFlag)	{ alert (eMess+'\nPlease correct these errors to continue'); return false; }
	return true;
}