function isMail(_email) 
{
	var emailReg = /^[a-z][a-z-_0-9\.]+@[a-z-_=>0-9\.]+\.[a-z]{2,3}$/i
	return emailReg.test(_email);
}


function checkForm(theForm)
{

 theForm.txtName.value = trim(theForm.txtName.value);
 if (theForm.txtName.value.length == 0)
  {
    alert("Por favor introduzca su nombre");
    theForm.txtName.focus();
    return (false);
  }

 theForm.txtMail.value = trim(theForm.txtMail.value);
 if (theForm.txtMail.value.length == 0)
  {
    alert("Por favor introduzca su e-mail");
    theForm.txtMail.focus();
    return (false);
  }

 if (!isMail(theForm.txtMail.value)) {
	alert("El e-mail no es correcto");
    theForm.txtMail.focus();
    return (false);		 
 }
 
 theForm.txtComment.value = trim(theForm.txtComment.value);
 if (theForm.txtComment.value.length == 0)
  {
    alert("Por favor introduzca su comentario");
    theForm.txtComment.focus();
    return (false);
  }

  return (true);
}

