function valida_recomienda(theForm)
{
  if (theForm.Name.value == "")
  {
    alert("Por favor Ingresa tu Nombre");
    theForm.Name.focus();
    return (false);
  }
  if (theForm.email.value == "")
  {
    alert("Por favor Ingresa tu Correo Electrónico ");
    theForm.email.focus();
    return (false);
  }
  if (theForm.email.value.length > 50)
  {
    alert("Inserta una cadena menor de 50 caracteres en el campo\"Tu Correo\".");
    theForm.email.focus();
    return (false);
  }
// email valitacion
	if(theForm.email.value!="")
		{
			 if ((theForm.email.value.indexOf(" ")!=-1)) {
	   	    	alert("Lo siento, pero Tu Correo no debe contener espacios en blanco");
				theForm.email.select();
				theForm.email.focus();
			    return false;
			    }
		 	if ((theForm.email.value.indexOf("@")==-1)) {
				 alert("Tu Correo debe contener el caracter @");
			   	 theForm.email.select();
			   	 theForm.email.focus();
			  	 return false;
			 	}
		 	if (theForm.email.value.indexOf("@")<2) {
			   	 alert("Tu Correo es una direccion invalida"+ "\n"+ "Por favor verifica el texto antes de '@'");
				 theForm.email.select();
				 theForm.email.focus();
				 return false ;
                 }	
		 	 if ((theForm.email.value.indexOf(".",theForm.email.value.indexOf("@")) - theForm.email.value.indexOf("@")) < 2 ) {
				 	alert("Tu Correo es una direccion invalida" + "\n"+ "el dominio no esta especificado")
				    theForm.email.select();
				    theForm.email.focus();
				    return false;
					}
 			if ((theForm.email.value.length - theForm.email.value.indexOf(".",theForm.email.value.indexOf("@"))) < 2 ) {
				 	alert("Tu Correo es una direccion invalida")
			 		theForm.email.select();
					theForm.email.focus();
				 	return false;
				    }
			if (theForm.email.value.charAt(theForm.email.value.length-1) == "." ) {
		 			alert("Tu Correo es una direccion invalida " + "\n"+ "el punto no puede ser el ultimo caracter")
				    theForm.email.select();
				    theForm.email.focus();
				    return false;
				   }
		 }
  if (theForm.Name2.value == "")
  {
    alert("Ingresa el Nombre de tu Amigo");
    theForm.Name2.focus();
    return (false);
  }
  if (theForm.email2.value == "")
  {
    alert("Por favor Ingresa el Correo Electrónico de Tu Amigo");
    theForm.email2.focus();
    return (false);
  }
  if (theForm.email2.value.length > 50)
  {
    alert("Inserta una cadena menor de 50 caracteres en el campo\"Correo de Tu Amigo\".");
    theForm.email2.focus();
    return (false);
  }
// email2 valitacion
	if(theForm.email2.value!="")
	{
		 if ((theForm.email2.value.indexOf(" ")!=-1)) {
			alert("Lo siento, pero el Correo de Tu Amigo no debe contener espacios en blanco");
			theForm.email2.select();
			theForm.email2.focus();
			return false;
			}
		if ((theForm.email2.value.indexOf("@")==-1)) {
			 alert("El Correo de Tu Amigo debe contener el caracter @");
			 theForm.email2.select();
			 theForm.email2.focus();
			 return false;
			}
		if (theForm.email2.value.indexOf("@")<2) {
			 alert("El Correo de Tu Amigo es una direccion invalida"+ "\n"+ "Por favor verifica el texto antes de '@'");
			 theForm.email2.select();
			 theForm.email2.focus();
			 return false ;
			 }	
		 if ((theForm.email2.value.indexOf(".",theForm.email2.value.indexOf("@")) - theForm.email2.value.indexOf("@")) < 2 ) {
				alert("El Correo de Tu Amigo es una direccion invalida" + "\n"+ "el dominio no esta especificado")
				theForm.email2.select();
				theForm.email2.focus();
				return false;
				}
		if ((theForm.email2.value.length - theForm.email2.value.indexOf(".",theForm.email2.value.indexOf("@"))) < 2 ) {
				alert("El Correo de Tu Amigo es una direccion invalida")
				theForm.email2.select();
				theForm.email2.focus();
				return false;
				}
		if (theForm.email2.value.charAt(theForm.email2.value.length-1) == "." ) {
				alert("El Correo de Tu Amigo es una direccion invalida " + "\n"+ "el punto no puede ser el ultimo caracter")
				theForm.email2.select();
				theForm.email2.focus();
				return false;
			   }
	 }
  return (true);
}
function envia_encuesta(theForm)
{
  if (theForm.asunto.value == "")
  {
    alert("Por favor Ingresa el Asunto");
    theForm.asunto.focus();
    return false;
  }
  if (theForm.nombre.value == "")
  {
    alert("Por favor Ingresa el Nombre ");
    theForm.nombre.focus();
    return false;
  }
  if (theForm.correo.value == "")
  {
    alert("Por favor Ingresa el correo");
    theForm.correo.focus();
    return (false);
  }
  if (theForm.ssql.value == "")
  {
    alert("Por favor Ingresa la condicion En SQL");
    theForm.ssql.focus();
    return (false);
  }
  if (theForm.mensaje.value == "")
  {
    alert("Por favor Ingresa el Mensaje");
    theForm.mensaje.focus();
    return (false);
  }
  return true;
 }
