function validate_form() {
  validity = true; // assume valid

  if (!check_empty(document.theForm.name.value))
        { validity = false; alert('You must enter your name'); }
		
 ;

  
  return validity;
}
function check_empty(text) {
  return (text.length > 0); // returns false if empty
}

function redirect_page() {
document.location='thanks.shtml';
}

function contact_email() {
	if (validate_form()) {

		var output = "";

		output = "\n\nBelow is a email from the KingsHead Web site\n\n";
		output += document.theForm.name.value + " has visited the KingsHead web site and is requestion additional information. \n\n\n";

		output += "The following information was included on the form...\n\n";
		output += "Name:   		 "+document.theForm.name.value+"\n";
		output += "Phone:		 "+document.theForm.phone.value+"\n";
		output += "E-mail:		 "+document.theForm.email.value+"\n";
		
		output += "Additional Information:\n";
		for (var z = 0; z < 5; z++) {
			var checked = document.theForm.checkRespond[z].checked;
				if (checked) {
					output += (document.theForm.checkRespond[z].value) + "\n";
					check = 1;
				}
		}
		
		output += "Address:      "+document.theForm.address.value+"\n\n";
		
		document.NewForm.KingsHead.value = output;
		document.NewForm.submit();
		
		redirect_page()
	}
}

