// JavaScript Document
 function checkForm() {
   email = document.getElementById("txt_email").value;
    company = document.getElementById("txt_company").value;
	 person = document.getElementById("txt_person").value;
	  telephone = document.getElementById("txt_telephone").value;
	  
	   var reg = /^([A-Za-z0-9_\-\.])+\@([A-Za-z0-9_\-\.])+\.([A-Za-z]{2,4})$/;
	 

	if(company == "") {
hideAllErrors();
document.getElementById("companyError").style.display = "inline";
document.getElementById("txt_company").select();
document.getElementById("txt_company").focus();
  return false;
  }
  else if(telephone == "") {
hideAllErrors();
document.getElementById("telephoneError").style.display = "inline";
document.getElementById("txt_telephone").select();
document.getElementById("txt_telephone").focus();
  return false;
  }
 else if (email == "" || (!reg.test(email))  ) {
	 
	    hideAllErrors();
		document.getElementById("emailError").style.display = "inline";
		document.getElementById("txt_email").select();
		document.getElementById("txt_email").focus();
  		return false;
		 }
    else if(person == "") {
hideAllErrors();
document.getElementById("personError").style.display = "inline";
document.getElementById("txt_person").select();
document.getElementById("txt_person").focus();
  return false;
  } 
  
  else
   return true;
   }
   function hideAllErrors() {

document.getElementById("emailError").style.display = "none"
document.getElementById("companyError").style.display = "none"
document.getElementById("personError").style.display = "none"
document.getElementById("telephoneError").style.display = "none"



  } 