function emailCheck (emailStr) {
var checkTLD=1;
var knownDomsPat=/^(com|net|org|edu|int|mil|gov|arpa|biz|aero|name|coop|info|pro|museum)$/;
var emailPat=/^(.+)@(.+)$/;
var specialChars="\\(\\)><@,;:\\\\\\\"\\.\\[\\]";
var validChars="\[^\\s" + specialChars + "\]";
var quotedUser="(\"[^\"]*\")";
var ipDomainPat=/^\[(\d{1,3})\.(\d{1,3})\.(\d{1,3})\.(\d{1,3})\]$/;
var atom=validChars + '+';
var word="(" + atom + "|" + quotedUser + ")";
var userPat=new RegExp("^" + word + "(\\." + word + ")*$");
var domainPat=new RegExp("^" + atom + "(\\." + atom +")*$");
var matchArray=emailStr.match(emailPat);
if (matchArray==null) 
	{
	alert("Cette adresse email semble être invalide!");
	return false;
	}
var user	=matchArray[1];
var domain	=matchArray[2];

for (i=0; i<user.length; i++) 
	{
	if (user.charCodeAt(i)>127) 
		{
		alert("Cette adresse email est invalide.");
		return false;
		}
	}
for (i=0; i<domain.length; i++) 
	{
	if (domain.charCodeAt(i)>127) 
	{
	alert("Ce nom de domaine est invalide.");
	return false;
	}
	}
if (user.match(userPat)==null) 
	{
	alert("Le compte de cette adresse n'est pas valide.");
	return false;
	}

var IPArray=domain.match(ipDomainPat);
if (IPArray!=null) {

for (var i=1;i<=4;i++) 
	{
	if (IPArray[i]>255) 
		{
		alert("La destination cette adresse IP est invalide!");
		return false;
		}
	}
return true;
}
var atomPat=new RegExp("^" + atom + "$");
var domArr=domain.split(".");
var len=domArr.length;
for (i=0;i<len;i++) 
	{
	if (domArr[i].search(atomPat)==-1) 
		{
		alert("Le nom de domaine ne semble pas être valide.");
		return false;
		}
	}
if (checkTLD && domArr[domArr.length-1].length!=2 && domArr[domArr.length-1].search(knownDomsPat)==-1) 
	{
	alert("Cette adresse doit se terminer par un nom domaine reconnu.");
	return false;
	}
if (len<2) {
	alert("Il manque le nom de domaine à cette adresse!");
	return false;
	}
return true;
}

function submitLaForm(f) {
w = window.open("", "Ma_BR","width=550");
w.focus();
window.location.reload();
}
function confirmSubmit()
  {
  var elt;
  var pb;pb=true;
  
  for (var i = 0; i < document.forms['Inscription'].elements.length; i++)
    {
  if (document.forms['Inscription'].elements[i].name.charAt(0) != "_" )
  { 
    if ( ((document.forms['Inscription'].elements[i].type == 'select-one') || (document.forms['Inscription'].elements[i].type == 'text')) && (document.forms['Inscription'].elements[i].value == '') ) 
      {
	  alert('Vous avez oublié de saisir votre \''+document.forms['Inscription'].elements[i].name+'\''); 
  	  document.forms['Inscription'].elements[i].focus();
	  pb=false;
      return false;
      }
	}
   }
   if (pb==true)
   {
   submitLaForm(document.forms['Inscription']);
	return true;
	}
}
function confirmSubmitBrochure()
  {
  var elt;
  var pb;pb=true;
  
  for (var i = 0; i < document.forms['Inscription'].elements.length; i++)
    {
  if (document.forms['Inscription'].elements[i].name.charAt(0) != "_" )
  { 
    if ( ((document.forms['Inscription'].elements[i].type == 'select-one') || (document.forms['Inscription'].elements[i].type == 'text')) && (document.forms['Inscription'].elements[i].value == '') ) 
      {
	  alert('Vous avez oublié de saisir votre \''+document.forms['Inscription'].elements[i].name+'\''); 
  	  document.forms['Inscription'].elements[i].focus();
	  pb=false;
      return false;
      }
	}
   }
   if (pb==true)
   {
	return true;
	}
}
function confirmSubmitJeux(Formulaire)
  {
	var nom_form = Formulaire;
  var elt;
  var pb;pb=true;
  
  for (var i = 0; i < document.forms[nom_form].elements.length; i++)
    {
  if (document.forms[nom_form].elements[i].name.charAt(0) != "_" )
  { 
    if ( ((document.forms[nom_form].elements[i].type == 'select-one') || (document.forms[nom_form].elements[i].type == 'text')) && (document.forms[nom_form].elements[i].value == '') ) 
      {
	  alert('Vous avez oublié de saisir votre \''+document.forms[nom_form].elements[i].name+'\''); 
  	  document.forms[nom_form].elements[i].focus();
	  pb=false;
      return false;
      }
	}
   }
   if (pb==true)
   {
	return true;
	}
}
function confirmSubmitSurPlace()
{
var elt;
var pb;pb=true;
for (var i = 0; i < document.forms['Inscription'].elements.length; i++)
	{
	if (document.forms['Inscription'].elements[i].name.charAt(0) != "_" )
		{ 
		if ( ((document.forms['Inscription'].elements[i].type == 'select-one') || (document.forms['Inscription'].elements[i].type == 'text')) && (document.forms['Inscription'].elements[i].value == '') ) 
			{
			alert('Vous avez oublié de saisir votre \''+document.forms['Inscription'].elements[i].name+'\''); 
			document.forms['Inscription'].elements[i].focus();
			pb=false;
			return false;
			}
		if (document.forms['Inscription'].elements[i].type == 'checkbox')
			{
			if (document.forms['Inscription'].elements[i].checked == false)
				{
				alert('Vous avez oublié de valider votre \''+document.forms['Inscription'].elements[i].name+'\''); 
				document.forms['Inscription'].elements[i].focus();
				pb=false;
				return false;
				}
			}
		if (document.forms['Inscription'].elements[i].name == 'email')
			{
			var email   = document.forms['Inscription'].elements[i].value;
			if (emailCheck (email) == false)
				{
				return false;
				document.forms['Inscription'].elements[i].focus();
				pb=false;
				return false;
				}
			}
		}
	}
return true;
}

