// JavaScript Document
function IsEmpty(aTextField) {
   if ((aTextField.value.length==0) ||
   (aTextField.value==null)) {
      return true;
   }
   else { return false; }
}	

function checkForm(form){
	var error = "";
	var theForm = document.getElementById(form);
	if(theForm == null) alert("Bad Form!");
	// Name Exists
	if(IsEmpty(theForm.name)) {
		alert('Please type your name.');
		theForm.name.focus();
		return false;
	}
	if(IsEmpty(theForm.street)) {
		alert('Please type your street name.');
		theForm.street.focus();
		return false;
	}
	if(IsEmpty(theForm.town)) {
		alert('Please type your town/city name.');
		theForm.town.focus();
		return false;
	}
	if(IsEmpty(theForm.postcode)) {
		alert('Please type your postcode.');
		theForm.postcode.focus();
		return false;
	}
	if(IsEmpty(theForm.email)) {
		alert('Please type your email address.');
		theForm.email.focus();
		return false;
	}
	
	return true;
}