function validate_required(field,alerttxt){
	with (field){
		if (value==null||value==""){
			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 fill in your Name")==false){
			name.focus();return false
		}
		if (validate_required(email,"Please Fill in your E-mail address")==false){
			email.focus();return false
		}else{
			if (validate_email(email,"Not a valid E-mail address")==false){
				email.focus();return false
			}
		}
		if (validate_required(comments,"Please enter your message")==false){
			comments.focus();return false
		}
	}
}