// JavaScript Document

function validarFormulario(formulario)
{
	//a)campo APELLIDO
	if (formulario.txtApellido.value == "")
	{ 
		alert("Ingrese el Apellido.");
		formulario.txtApellido.focus();
		return false;
	}
	//b)campo NOMBRE
	if (formulario.txtNombre.value == "")
	{ 
		alert("Ingrese el Nombre.");
		formulario.txtNombre.focus();
		return false;
	}	
	//c) campo EMAIL
	if (formulario.txtMail.value == "")
	{ 
		alert("Ingrese el e-mail.")
		formulario.txtMail.focus()
		return false
	}
	else
	{
		var parte1 = formulario.txtMail.value.indexOf("@");
        var parte2 = formulario.txtMail.value.indexOf(".");
        var parte3 = formulario.txtMail.value.length;
        if (!(parte1 >= 3 && parte2 >= 6 && parte3 >= 9)) 
		{
        	alert("La dirección de e-mail es incorrecta.");
            formulario.txtMail.focus();
            return false;
         }
	}
	//d)campo COMENTARIO
	if (formulario.txtComentario.value == "")
	{ 
		alert("Ingrese su cuestión y/o comentario.")
		formulario.txtComentario.focus()
		return false
	}	
}
