// Form Validation
function isValidEmail(str) {
	if (/^\w+([\.-]?\w+)*@\w+([\.-]?\w+)*(\.\w{2,3})+$/.test(str)){
		return true;
	}
	else {
		return false;
	}
}

function checkcontactForm(){
	var ftxt = '';
	
	if (document.contactForm.name.value==''){
		ftxt += '\n- Please enter your Full Name.';
	}
		
	if (isValidEmail(document.contactForm.email.value)==false){
		ftxt += '\n- Please enter an Email Address.';
	}
	
	if (document.contactForm.message.value==''){
		ftxt += '\n- Please enter message into the Comments box.';
	}
	
	if (ftxt!==''){
		alert('One or more errors were found while submitting this form. The errors found are displayed below.\n' + ftxt + '\n\nPlease correct the above errors and try again.');
		return false;
	}
	else {
		return true;
	}
}

