var fields = new Array(
			"first_name",
			"last_name",
			"company",
			"email",
			"cemail",
			"phone",
			"state", "00N80000003oGFe");

function validateForm(thisForm){
	for (var i=0; i < fields.length; i++) {
		if (thisForm.elements[fields[i]].value == "") {
			alert("Please fill in the required field(s)");
			thisForm.elements[fields[i]].focus();
			return false;
		}
	}

	return validateEmail(thisForm);

}

function validateForm2(thisForm, vfields){
	for (var i=0; i < vfields.length; i++) {
		if (thisForm.elements[vfields[i]].value == "") {
			alert("Please fill in the required field(s)");
			thisForm.elements[vfields[i]].focus();
			return false;
		}
	}

	return true;

}

function validateEmail(thisForm){
	if (!thisForm.email.value.match(/^\w+([\.\-]\w+)*@\w+([\.\-]\w+)*\.[a-z]{2,4}$/i)){
		alert("Invalid Email address");
		thisForm.email.focus();
		return false;
	}

	if (thisForm.email.value != thisForm.cemail.value) {
		alert("Email address doesn't match confirmation email address\nPlease check the spelling of your email address in both fields");
		thisForm.email.focus();

		return false;
	}

	thisForm.submit();
	return true;
}

