// validate function for the candidate form
function validate(){
	var name = document.catform.name.value;
	var company = document.catform.company.value;
	var country = document.catform.country.value;
	var email = document.catform.email.value;
	var dt = new Date();
	
	// check for blank name 
	if(name == ""){
		alert("Please Enter the name ");
		document.catform.name.focus();
		return false;
	}
	// check for empty username
	if(company == "") {
		alert("Please Enter Company Name");
		document.catform.company.focus();
		return false;
	}
	// check for blank password	
	if(country == ""){
		alert("Please Enter the Country Name");
		document.catform.country.focus();
		return false;
	}
	
	// check for blank password	
	if(email == ""){
		alert("Please Enter the Email");
		document.catform.email.focus();
		return false;
	}
	
	// check for the validity of the email
	if((document.catform.email.value.indexOf('@',0) == -1) ||(document.catform.email.value.indexOf('.',0) == -1)) {
		alert("Invalid Email Address. Please check your email address");
		document.catform.email.focus();
		return false;
	}	

	// if all conditions are true then
	return true;
}
	
