function checkWholeForm(theForm) {
    var why = "";
    why += checkUsername(document.theForm.name.value);
	 why += checkAddress(document.theForm.address.value);
      why += checkCityname(document.theForm.city.value);
	   why += checkState(document.theForm.state.value);
     	 why += checkZipcodename(document.theForm.zipcode.value);
		why += checkAcreagename(document.theForm.acreage.value);
		why += checkZipcode(document.theForm.zipcode.value);

    if (why != "") {
       alert(why);
       return false;
    }
return true;
}
function checkUsername (strng) {
 var error = "";
 if (strng == "") {
    error = "Please enter your name.\n";
    }
	return error;
 }
function checkAddress (strng) {
 var error = "";
 if (strng == "") {
    error = "Please enter your address.\n";
    }
	return error;
 }
 function checkState (strng) {
 var error = "";
 if (strng == "") {
    error = "Please enter your state.\n";
    }
	return error;
 }
 function checkCityname (strng) {
 var error = "";
 if (strng == "") {
    error = "Please enter your city.\n";
    }
	return error;
 }
function checkAcreagename (strng) {
 var error = "";
 if (strng == "") {
    error = "Please enter your acreage.\n";
    }
	return error;
 }
function checkZipcodename (strng) {
 var error = "";
 if (strng == "") {
    error = "Please enter your zip code.\n";
    }
	return error;
 }
function checkEmail(strng) {
var error = "";
var emailFilter=/^.+@.+\..{2,3}$/;
if (!(emailFilter.test(strng))) { 
       error = "Please enter a valid email address.\n";
}
var illegalChars= /[\(\)\<\>\,\;\:\\\/\"\[\]]/
if (strng.match(illegalChars)) {
   error = "The email address contains illegal characters.\n";
}
return error;
}
function checkZipcode(strng) {
var error = "";
var stripped = strng.replace(/[\(\)\.\-\ ]/g, '');
//strip out acceptable non-numeric characters
if (isNaN(parseInt(stripped))) {
   error = "The zip code contains illegal characters.";
}
if (!(stripped.length == 5)) {
	error = "The zip code is the wrong length. Make sure it is five digits.\n";
}
return error;
}
