// JavaScript Document
function isValidEmail(str) {
	if (/^\w+([\.-]?\w+)*@\w+([\.-]?\w+)*(\.\w{2,3})+$/.test(str)){
		return true;
	}
	else {
		return false;
	}
}

function checkForm(){
	var frmtxt = "";
	
	if (document.contact.Name.value==''){
		frmtxt += '\n- Please enter your Name.'
	}
	
	if (document.contact.Telephone.value==''){
		frmtxt += '\n- Please enter your Telephone Number.'
	}
	
	if (isValidEmail(document.contact.email.value)==false){
		frmtxt += '\n- Please enter your Email Address.'
	}
	
	if (document.contact.Subject.value==''){
		frmtxt += '\n- Please select your Subject of Enquiry.'
	}
	
	if (frmtxt!==''){
		alert('One or more errors were found while submitting this form. The errors found are displayed below.\n' + frmtxt + '\n\nPlease correct the above form errors and try again.');
		return false;
	}
	else{
		return true;
	}
}