// getNewsletter.html

function valider() {

	data = document.getNewsletter;

	if (data.txtcourriel.value == ""){
	  data.txtcourriel.focus();
	  alert("Please include your e-mail.");
	  return(false);
	}else{
	  var checkOK = "@";
	  var Courriel = data.txtcourriel.value;
	  var Longueur = Courriel.length;
	  var allValid = true;
	  var nbr = 0
	   for (z = 0;  z < Courriel.length;  z++){
	      ch = Courriel.charAt(z);
	      if (ch == "@"){ 
	        nbr = nbr + 1
	      }
	  ch = Courriel.charAt(z);
    	} 
	}
	if (nbr != 1){
	    alert("There is an error in your e-mail address.");
	    data.txtcourriel.focus();
	    return (false);
	}

	  var checkOK = ".";
	  var Courriel = data.txtcourriel.value;
	  var Longueur = Courriel.length;
	  var allValid = true;
	  var nbr = 0
	   for (z = 0;  z < Courriel.length;  z++){
	      ch = Courriel.charAt(z);
	      if (ch == "."){ 
	        nbr = nbr + 1
       	      }
  		ch = Courriel.charAt(z);
	   } 
	  if (nbr == 0){
	    alert("There is an error in your e-mail address.");
	    data.txtcourriel.focus();
	    return (false);
	  }
	
	document.getNewsletter.submit(); // Envoi des infos à la page ASP

}

