// Check required feilds
function chkForm(theForm) {
	if(theForm.contact_name.value == ""){
		alert("Please enter a Contact Name");
		theForm.contact_name.focus();
		return false;
	}
		if(theForm.company.value == ""){
		alert("Please enter your company name");
		theForm.company.focus();
		return false;
	}
if(theForm.feedback.value == ""){
		alert("You forgot to leave feedback");
		theForm.feedback.focus();
		return false;
	}
	
	return chkEmail(theForm);
}

//Validate email address
function chkEmail(theForm) {
	var result;
	var str = theForm.email.value;
	var filter = /^([\w-]+(?:\.[\w-]+)*)@((?:[\w-]+\.)*\w[\w-]{0,66})\.([a-z]{2,6}(?:\.[a-z]{2})?)$/i;

	if(filter.test(str))
		result = true;
	else{
		alert("Please enter a valid email address.");
		theForm.email.focus();
		result = false;
	}
 	return (result);
}