  function checkForm() {
  
	  email = document.getElementById("txt_email").value;
	
	   
	   var reg = /^([A-Za-z0-9_\-\.])+\@([A-Za-z0-9_\-\.])+\.([A-Za-z]{2,4})$/;
	  
  
  }
alert(name);
	if(name == "") {
hideAllErrors();
document.getElementById("nameError").style.display = "inline";
document.getElementById("txt_name").select();
document.getElementById("txt_name").focus();
  return false;
  }

  
   else if(age == "") {
hideAllErrors();
document.getElementById("ageError").style.display = "inline";
document.getElementById("txt_age").select();
document.getElementById("txt_age").focus();
  return false;
  }
 
   else if(occupation == "") {
hideAllErrors();
document.getElementById("occupationError").style.display = "inline";
document.getElementById("txt_occupation").select();
document.getElementById("txt_occupation").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
   return true;
   }
   function hideAllErrors() {

document.getElementById("nameError").style.display = "none"
document.getElementById("ageError").style.display = "none"
document.getElementById("occupationError").style.display = "none"
document.getElementById("emailError").style.display = "none"
  } 