// JavaScript Document




function isEmptyField(inputValue) {
	
	var aCharExists = false;
	
	for (var i=0; i <= inputValue.length; i++)
		{
		     if (inputValue.charAt(i) != " " && inputValue.charAt(i) != "")
			 {
				aCharExists = true;
			        break;
			 }
		}

    return aCharExists
}




function checkform() {

  if (!isEmptyField(document.contact.FIRSTNAME.value)) {
   	alert("Please fill in the First Name.");
   	document.contact.FIRSTNAME.focus();
   	return false;
  }

  if (!isEmptyField(document.contact.LASTNAME.value)) {
   	alert("Please fill in the Last Name.");
   	document.contact.LASTNAME.focus();
   	return false;
  }


  if (!isEmptyField(document.contact.EMAIL.value)) {
   	alert("Please fill in the Email Address.");
   	document.contact.EMAIL.focus();
   	return false;
  }

  if (!isEmptyField(document.contact.DAYCONTACT.value)) {
   	alert("Please provide a phone number.");
   	document.contact.DAYCONTACT.focus();
   	return false;
  }

  if (!isEmptyField(document.contact.COMMENTS.value)) {
    alert("Please tell us the nature of your concern.");
    document.contact.COMMENTS.focus();
    return false;
  }

      

  document.contact.submit();

}


