	function validate_required(field,alerttxt){
		with (field){if (value==null||value==""){alert(alerttxt);return false}else {return true}}
	}
	function validate_radio(btn,alerttxt) {
		with (btn){if (!checked){alert(alerttxt);return false}else {return true}}
	}
	function validate_email(field,alerttxt){
		with (field){
			apos=value.indexOf("@")
			dotpos=value.lastIndexOf(".")
			if (apos<1||dotpos-apos<2){
				alert(alerttxt);
				return false
			}
		else{
			return true;
		}
	}
	}
	function validate_form(thisform) {
		with (thisform){if (validate_required(name,"Please enter a name.")==false){name.focus();return false}}
		with (thisform){if (validate_required(location,"Please enter a location.")==false){location.focus();return false}}
		with (thisform){if (validate_email(email,"Please enter a correctly formatted email address.")==false){email.focus();return false}}
	
		myOption = -1;
	
		for (i=0; i<thisform.rating.length; i++) {
			if (thisform.rating[i].checked) {
				myOption = i;
			}
		}
		if (myOption == -1){
			alert("Please select a rating.");
			return false;
		}
		var bodyText = document.customerReview.body.value;
		if(bodyText.match("<") || bodyText.match(">") || bodyText.match("/")){
			alert("Please remove the HTML from your review.");
			return false;
		}else{
			return true;
		}
	}