function formValidator(){
	// Make quick references to our fields
	var first_name= document.getElementById('first_name');
	var last_name= document.getElementById('last_name');
	var email= document.getElementById('email');
        var helperMsg="Enter Valid email address."
	// Check each input in the order that it appears in the form!
		if(lengthRestriction(first_name, 2, 20))


	// Check each input in the order that it appears in the form!
	if(lengthRestriction(last_name, 2, 20)){

        if(emailValidator(email,helperMsg)){
			
							return true;
							
				
		                                     }			

							return false;				
				
		
	                                     }
	
	
	                                return false;
	
}





function lengthRestriction(elem, min, max){
	var uInput = elem.value;
	if(uInput.length >= min && uInput.length <= max){
		return true;
	}else{
		alert("Please enter Name between " +min+ " and " +max+ " characters");
		elem.focus();
		return false;
	}
}

function madeSelection(elem, helperMsg){
	if(elem.value == "Please Choose"){
		alert(helperMsg);
		elem.focus();
		return false;
	}else{
		return true;
	}
}

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;
	}
}
