//get the value out of all the form fields

  function checkForm() {
first_name = document.getElementById("first_name").value;
last_name = document.getElementById("last_name").value;
email = document.getElementById("email").value;
title = document.getElementById("title").value;
//role = document.getElementById("role").value;
phone = document.getElementById("phone").value;
company = document.getElementById("company").value;
type_organization = document.getElementById("type_organization").value;
country = document.getElementById("country").value;
state = document.getElementById("state").value;
//zip = document.getElementById("zip").value;
 
//if the fields are blank display warning
 
  if (first_name == "") {
  hideAllErrors();
document.getElementById("firstnameError").style.display = "inline";
document.getElementById("first_name").select();
document.getElementById("first_name").focus();
  return false;
  
  } else if (last_name == "") {
hideAllErrors();
document.getElementById("lastnameError").style.display = "inline";
document.getElementById("last_name").select();
document.getElementById("last_name").focus();
	return false;
	
   } else if (email == "") {
hideAllErrors();
document.getElementById("emailError").style.display = "inline";
document.getElementById("email").select();
document.getElementById("email").focus();
	return false;
}	
//skip title verification
 
 /*   else if (role == "") {
hideAllErrors();
document.getElementById("roleError").style.display = "inline";
document.getElementById("role").focus();	
	return false;  
	
    }*/
	
	else if (phone == "") {
hideAllErrors();
document.getElementById("phoneError").style.display = "inline";
document.getElementById("phone").select();
document.getElementById("phone").focus();
	return false; 	
	
	
	}else if (company == "") {
hideAllErrors();
document.getElementById("companyError").style.display = "inline";
document.getElementById("company").select();
document.getElementById("company").focus();
	return false; 
 
  } else if (type_organization == "") {
hideAllErrors();
document.getElementById("organizationError").style.display = "inline";
document.getElementById("type_organization").focus();	
	return false;  
 
  } else if (country == "") {
hideAllErrors();
document.getElementById("countryError").style.display = "inline";
document.getElementById("country").focus();	
	return false;   
	
  } else if (state == "") {
hideAllErrors();
document.getElementById("stateError").style.display = "inline";
document.getElementById("state").focus();	
	return false;   
 }
  /*   else if (zip == "") {
hideAllErrors();
document.getElementById("zipError").style.display = "inline";
document.getElementById("zip").select();
document.getElementById("zip").focus();
	return false; 
  
  }
*/  
// if there are values and no warnings then hide everything and submit  
  return true;
  }
 
  function hideAllErrors() {
document.getElementById("firstnameError").style.display = "none"
document.getElementById("lastnameError").style.display = "none"
document.getElementById("emailError").style.display = "none"
//document.getElementById("roleError").style.display = "none"
document.getElementById("phoneError").style.display = "none"
document.getElementById("companyError").style.display = "none"
document.getElementById("organizationError").style.display = "none"
document.getElementById("countryError").style.display = "none"
document.getElementById("stateError").style.display = "none"
//document.getElementById("zipError").style.display = "none"

  }