//Check the enquiry form is filled in correctly
function CheckForm () { 

	//Initialise variables
	var errorMsg = "";

	//Check for a first name
	if (document.frmEnquiry.firstName.value == ""){
		errorMsg += "\n\tNombre \t- Introducir Nombre";	
	}
	
	//Check for a last name
	if (document.frmEnquiry.lastName.value == ""){
		errorMsg += "\n\tApellido \t- Introducir Apellido";
	}
	 	
	//Check for an e-mail address and that it is valid
	if ((document.frmEnquiry.email.value == "") || (document.frmEnquiry.email.value.length > 0 && (document.frmEnquiry.email.value.indexOf("@",0) == - 1 || document.frmEnquiry.email.value.indexOf(".",0) == - 1))) { 
		errorMsg += "\n\tCorreo \t- Introducir correo valido";
	}
			
	//Check for an enquiry
	if (document.frmEnquiry.enquiry.value == "") { 
 		errorMsg += "\n\tSolicitud \t- Introducir solicitud";
	}
		
	//If there is aproblem with the form then display an error
	if (errorMsg != ""){
		msg = "______________________________________________________________\n\n";
		msg += "Su solicitud no ha sido mandada porque ha habido un problema(s) con el formulario.\n";
		msg += "Por favor corriga el problema(s) y re-envie la solicitud.\n";
		msg += "______________________________________________________________\n\n";
		msg += "El siguiente dato(s) necesita ser corregido: -\n";
		
		errorMsg += alert(msg + errorMsg + "\n\n");
		return false;
	}
	
	return true;
}

