function formValidator(){
	// Make quick references to our fields
	var firstname = document.getElementById('fname');
	var lastname = document.getElementById('lname');

var email = document.getElementById('eml');
if(isAlphabet(firstname, "Please enter only letters for your first name")){
	if(notEmpty(firstname, "First name should not empty")){
		if(isAlphabet1(lastname, "Please enter only letters for your last name")){
		if(notEmpty1(lastname, "Last name should not empty")){
	

if(emailValidator(email, "Please enter a valid email address")){
							return true;
						}
					}
				}
}
}
return false;
	
}

function notEmpty(elem, helperMsg){
	if(elem.value.length == 0){
		alert(helperMsg);
		elem.focus(); // set the focus to this input
		return false;
	}
	return true;
}


function isAlphabet(elem, helperMsg){
	var alphaExp = /^[a-zA-Z ]+$/;
	if(elem.value.match(alphaExp)){
		return true;
	}else{
		alert(helperMsg);
		elem.focus();
		return false;
	}
}

function notEmpty1(elem, helperMsg){
	if(elem.value.length == 0){
		alert(helperMsg);
		elem.focus(); // set the focus to this input
		return false;
	}
	return true;
}


function isAlphabet1(elem, helperMsg){
	var alphaExp = /^[a-zA-Z ]+$/;
	if(elem.value.match(alphaExp)){
		return true;
	}else{
		alert(helperMsg);
		elem.focus();
		return false;
	}
}
function emailValidator(elem, helperMsg){
	var emailExp = /^[\w\-\.\+]+\@[a-zA-Z0-9\.\-]+\.[a-zA-z0-9]{2,4}$/;
	if(elem.value.match(emailExp)){
		return true;
	}else{
		alert(helperMsg);
		elem.focus();
		return false;
	}
}

