function formValidator(){
	// Make quick references to our fields
	var nombre = document.getElementById('nombre');
	var email = document.getElementById('email');
	var telefono = document.getElementById('telefono');
	var consulta = document.getElementById('consulta');
	
		// orden de 
	if(isAlphabet(nombre, "Ingrese su nombre")){
	if(emailValidator(email, "Ingrese correctamente su correo")){
	if(isNumeric(telefono, "Ingrese su numero de telefono")){
	if(notEmpty(pedido, "Ingrese su pedido")){
	if(notEmpty(consulta, "Ingrese su consulta")){
							return true;
						}
					}
				}
			}
	}
	return false;
	
}


function notEmpty(elem, helperMsg){
	if(elem.value.length == 0){
		alert(helperMsg);
		elem.focus();                   //  para que no envie sin completar nada //
		return false;
	}
	return true;
}

function isNumeric(elem, helperMsg){  // solo numeros // 
	var numericExpression = /^[0-9]+$/;
	if(elem.value.match(numericExpression)){
		return true;
	}else{
		alert(helperMsg);
		elem.focus();
		return false;
	}
}


function isAlphabet(elem, helperMsg){    // solo letras //  
	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}$/;  // checkeo de email //  
	if(elem.value.match(emailExp)){
		return true;
	}else{
		alert(helperMsg);
		elem.focus();
		return false;
	}
}