// 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 a Name.';
	}
	
	if (isValidEmail(document.contactform.email.value)==false){
		ftxt += '\n- Please enter an Email Address.';
	}
	
	if (document.contactform.message.value==''){
		ftxt += '\n- Please enter a Message.';
	}
			
	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;
	}
}

