function MM_reloadPage(init) {  //reloads the window if Nav4 resized
  if (init==true) with (navigator) {if ((appName=="Netscape")&&(parseInt(appVersion)==4)) {
    document.MM_pgW=innerWidth; document.MM_pgH=innerHeight; onresize=MM_reloadPage; }}
  else if (innerWidth!=document.MM_pgW || innerHeight!=document.MM_pgH) location.reload();
}
MM_reloadPage(true);

function MM_openBrWindow(theURL,winName,features) { //v2.0
  window.open(theURL,winName,features);
}

function popupcentree(page,largeur,hauteur,options)
{
var top=(screen.height-hauteur)/2;
var left=(screen.width-largeur)/2;
window.open(page,"","top="+top+",left="+left+",width="+largeur+",height="+hauteur+","+options);
}

function MM_goToURL() { //v3.0
  var i, args=MM_goToURL.arguments; document.MM_returnValue = false;
  for (i=0; i<(args.length-1); i+=2) eval(args[i]+".location='"+args[i+1]+"'");
}

function EmailValide(email)
{   
   var atIndex     = email.indexOf('@')
   var dotIndex    = email.indexOf('.',atIndex)

         // check 0 < atIndex < dotindex < length
   if( (0 < atIndex) && (atIndex < dotIndex) && (dotIndex < email.length-1) )
   { 
           // first character is a letter and all other are not whitespace
      var firstChar = email.charAt(0)
      
      if( (firstChar>='a' && firstChar<='z') ||  
          (firstChar>='A' && firstChar<='Z') ||
          (firstChar>='0' && firstChar<='9') )
      { 
         for(var i=1;i<email.length;++i){
            if(email.charCodeAt(i) <= 0x20){
               if(email.charAt(i) == ' ')
                  alert("Votre adresse e-mail ne doit pas contenir d'espaces.")
               else 
                  alert("Votre adresse e-mail ne doit pas contenir les caractères \"" + email.charAt(i))
               return false;
            }    
         }
         return true;
          
      }
      alert("Le caractère \"" + firstChar + "\" de votre adresse e-mail est incorrect.")
   }
   alert("L'adresse email que vous avez fourni comporte une erreur.")
   return false;
}

function changeBox(cbox)
{
box = eval(cbox);
box.checked = !box.checked;
}

function ChangeUrlClassements(formulaire)
{
if (formulaire.Classements.selectedIndex != 0)
	{
	location.href = formulaire.Classements.options[formulaire.Classements.selectedIndex].value;
	}
	else 
	{
	alert('Veuillez choisir une étape.');
	}
}

function ChangeUrlThemes(formulaire)
{
if (formulaire.Themes.options[formulaire.Themes.selectedIndex].value)
	{
	location.href = formulaire.Themes.options[formulaire.Themes.selectedIndex].value;
	}
	else 
	{
	alert('Veuillez choisir un thème.');
	}
}