// Check contact form for required fields
function checkForm(){
	if (document.reab_form.name.value == "") {
		alert("please enter your name."); 
		document.reab_form.name.focus();
	} else if (document.reab_form.email.value == "") {
		alert("please enter your email address."); 
		document.reab_form.email.focus();
	} else if(null == document.reab_form.email.value.match(/[a-zA-Z0-9._]+@[a-zA-Z0-9.-_]+/)) {
		alert("please enter a valid email address."); 
		document.reab_form.email.focus();
	} else if (document.reab_form.comments.value == "") {
		alert("please enter your comments.");
		document.reab_form.comments.focus();
	} else {
	document.reab_form.action="http://w3.net.nz/reab/website/mail.php";
	document.reab_form.submit();
	}
}

// this totals the prices on the order form
var top_price = "60";

function orderTotal(){
	var quantity_one = document.exercise_tops.quantity_one.value;
	var quantity_two = document.exercise_tops.quantity_two.value;
	var quantity_three = document.exercise_tops.quantity_three.value;
	document.exercise_tops.total.value = (quantity_one * top_price) + (quantity_two * top_price) + (quantity_three * top_price);
}

function jump(sel) {
	var url = sel.options[sel.selectedIndex].value;
	if ( url != '#' ) top.location = url;
}