<!--
window.onload = initForms;

function initForms() {
	for (var i=0; i<document.forms.length; i++) {
	   document.forms[i].onsubmit = function() {return validForm();}
	}
}

function validForm() {
	var inputarray = document.getElementsByTagName("input");
	var selectarray = document.getElementsByTagName("select");

	// name
	if (inputarray[2].value == "") {
	   window.alert("Please enter your name.");
	   inputarray[2].select();
	   inputarray[2].focus();
	   return false;
	   }

	// email
	if (document.forms[0].email.value == "" | document.forms[0].email.value == "Enter your email address") {
	   window.alert("You must enter your email address");
	   document.forms[0].email.focus();
	   return false;
	   }

	// email requirements
	var reg = /^\w+([\.-]?\w+)*@\w+([\.-]?\w+)*(\.\w{2,3})+$/;
	var address = document.forms[0].email.value;
	if (reg.test(address) == false) {
	   alert("Invalid email address.");
	   inputarray[3].select();
	   inputarray[3].focus();
	   return false;
	   }

	// time length
	if (selectarray[0].value == "") {
	   window.alert("Please rate the time length of your order.");
	   selectarray[0].focus();
	   return false;
	   }

	// expectations
	if (selectarray[1].value == "") {
	   window.alert("Please rate your expectations compared to the final results.");
	   selectarray[1].focus();
	   return false;
	   }

	// fairness of prices
	if (selectarray[2].value == "") {
	   window.alert("Please rate the fairness of the prices.");
	   selectarray[2].focus();
	   return false;
	   }

	// quality of final results
	if (selectarray[3].value == "") {
	   window.alert("Please rate the quality of the final results.");
	   selectarray[3].focus();
	   return false;
	   }
}
-->