function checkorder() {
	var theform = document.theform;
	var emailpattern = /^([a-zA-Z0-9_\.\-\+])+\@(([a-zA-Z0-9\-])+\.)+([a-zA-Z0-9]{2,4})+$/;
	var phonepattern = /[0-9]{3}.*[0-9]{3}.*[0-9]{4}/;
	if (theform.title.value == '' || theform.authors.value == '' || theform.categories.value == '' || theform.contactname.value == '' || theform.publisher.value == '' || theform.address.value == '' || theform.city.value == '' || theform.province.value == '' || theform.postal.value == '' || theform.phone.value == '' || theform.email.value == '') {
		alert ("All fields are required in order to submit your entry.");
		return false;
	}
	if (!theform.phone.value.match(phonepattern)) {
		alert ("Please enter your phone number including area code.");
		return false;
	}
	if (!theform.email.value.match(emailpattern)) {
		alert ("You must enter a valid email address to continue.");
		return false;
	}
	if (theform.email.value != theform.email2.value) {
		alert ("You must enter the same email address twice to continue.");
		return false;
	}
	if ((isNaN(theform.finalistrolls.value) || theform.finalistrolls.value < 1) && (isNaN(theform.winnerrolls.value) || theform.winnerrolls.value < 1) || Number(theform.finalistrolls.value) + Number(theform.winnerrolls.value) < 2) {
		alert ("You must enter at least 2 rolls to continue.");
		return false;
	}
	return true;
}
function updateprice() {
	var theform = document.theform;
	var theprice = 15 * (Number(document.getElementById('finalistrolls').value) + Number(document.getElementById('winnerrolls').value));
	if (theprice < 30) theprice = 30;
	theform.price.value = '$'+theprice+'.00';
}
