
// JavaScript Document
function valida (theform) {
    if (theform.nombre.value=="") {
	  alert("NAME is required");
	  return false;
	 }

     if (theform.email.value=="" || !(isemailvalidation(theform.email.value))) {
	  alert("EMAIL is required and must be valid");
	  return false;
	 }
	 if (theform.telefono.value=="") {
	  alert("PHONE is required");
	  return false;
	 }
	 if (theform.asunto.value=="") {
	  alert("SUBJECT is required");
	  return false;
	 }

	return true; 
  }

function validanewsletter2 (theform) {
    if (theform.nombre.value=="") {
	  alert("NAME is required");
	  return false;
	 }

     if (theform.email.value=="" || !(isemailvalidation(theform.email.value)) ) {
	  alert("EMAIL is required and must be valid");
	  return false;
	 }
	 
	return true; 
  }
  

function validaaff (theform) {
    if (theform.affiliate_firstname.value=="") {
	  alert("FIRST NAME is required");
	  return false;
	 }
	 if (theform.affiliate_lastname.value=="") {
	  alert("LAST NAME is required");
	  return false;
	 }	 
	 
     if (theform.affiliate_email.value=="" || !(isemailvalidation(theform.affiliate_email.value)) ) {
	  alert("EMAIL is required and must be valid");
	  return false;
	 }
	 if (theform.affiliate_password.value=="") {
	  alert("PASSWORD is required");
	  return false;
	 }
	 
	return true; 
  }
  
  
  
function isemailvalidation ( stremail ){
var nLongitud, strNum;
nLongitud = stremail.length;
var arroba = false;
var punto = false;
var espacio = false;
for ( var cont = 0; cont < nLongitud; cont++ )	{
strNum = stremail.substring ( cont, cont + 1 );
if ( ( strNum == "@" ) && ( arroba == false ) ){
arroba = true;}
else if ( ( strNum == "@" ) && ( arroba == true ) ){
arroba = false;}
else if ( strNum == "." ){
punto = true;}
else if ( strNum == " " ){
espacio = true;}
}//endfor
if ( arroba && punto && ( nLongitud >= 6 ) && ( ! ( espacio ) ) ){
return true;}
else{
return false;}
}//
  