// JavaScript Document
function isValidEmail(strEmail)
{
   validRegExp = /^[^@]+@[^@]+.[a-z]{2,}$/i;
  
   // search email text for regular exp matches
    if (strEmail.search(validRegExp) == -1) 
   {
      return false;
    } 
    return true; 
}

function check()
{
	if(document.getElementById("nombre").value == "")
	{
		alert("Por favor, complete el campo Nombre");
		return false;
	}

	if(document.getElementById("apellido").value == "")
	{
		alert("Por favor, complete el campo Apellido");
		return false;
	}

	if(!isValidEmail(document.getElementById("email").value))
	{
		alert('Por favor, complete el campo E-Mail');
		return false;
	}
	
	if(document.getElementById("telefono").value == "")
	{
		alert("Por favor, complete el campo Teléfono");
		return false;
	}

	if(document.getElementById("consulta").value == "")
	{
		alert("Por favor, detalle el motivo de su consulta");
		return false;
	}
	return true;
}
