// 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.division.value == ""){
		alert("Please select a division of interest");
		theForm.division.focus();
		return false;
	}
		if(theForm.phone.value == ""){
		alert("Please enter your phone number");
		theForm.phone.focus();
		return false;
	}
	
		if(theForm.subject.value == ""){
		alert("Please fill out the Subject line");
		theForm.subject.focus();
		return false;
	}

	if(theForm.message.value == ""){
		alert("You forgot to write a message");
		theForm.message.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);
}