<!--

function MM_preloadImages() { //v3.0

  var d=document; if(d.images){ if(!d.MM_p) d.MM_p=new Array();

    var i,j=d.MM_p.length,a=MM_preloadImages.arguments; for(i=0; i<a.length; i++)

    if (a[i].indexOf("#")!=0){ d.MM_p[j]=new Image; d.MM_p[j++].src=a[i];}}

}



function MM_swapImgRestore() { //v3.0

  var i,x,a=document.MM_sr; for(i=0;a&&i<a.length&&(x=a[i])&&x.oSrc;i++) x.src=x.oSrc;

}



function MM_findObj(n, d) { //v4.01

  var p,i,x;  if(!d) d=document; if((p=n.indexOf("?"))>0&&parent.frames.length) {

    d=parent.frames[n.substring(p+1)].document; n=n.substring(0,p);}

  if(!(x=d[n])&&d.all) x=d.all[n]; for (i=0;!x&&i<d.forms.length;i++) x=d.forms[i][n];

  for(i=0;!x&&d.layers&&i<d.layers.length;i++) x=MM_findObj(n,d.layers[i].document);

  if(!x && d.getElementById) x=d.getElementById(n); return x;

}



function MM_swapImage() { //v3.0

  var i,j=0,x,a=MM_swapImage.arguments; document.MM_sr=new Array; for(i=0;i<(a.length-2);i+=3)

   if ((x=MM_findObj(a[i]))!=null){document.MM_sr[j++]=x; if(!x.oSrc) x.oSrc=x.src; x.src=a[i+2];}

}





function centerPop(theURL,winName,features, myWidth, myHeight, isCenter) { //v3.0

  if(window.screen)if(isCenter)if(isCenter=="true"){

    var myLeft = (screen.width-myWidth)/2;

    var myTop = (screen.height-myHeight)/2;

    features+=(features!='')?',':'';

    features+=',left='+myLeft+',top='+myTop;

  }

  window.open(theURL,winName,features+((features!='')?',':'')+'width='+myWidth+',height='+myHeight);

}





function centrado(myLink,winName,params, ancho, alto, centrar) { 

  if(window.screen)if(centrar)if(centrar=="true"){

    var myLeft = (screen.width-ancho)/2;

    var myTop = (screen.height-alto)/2;

    params+=(params!='')?',':'';

    params+=',left='+myLeft+',top='+myTop;

  }

  window.open(myLink,winName,params+((params!='')?',':'')+'width='+ancho+',height='+alto);

}



function MM_openBrWindow(theURL,winName,features) { //v2.0

  window.open(theURL,winName,features);

}



function Lvl_openWin(u,n,w,h,l,t,c,f,x) { //v2.0 4LevelWebs

  var ww=((screen.width-w)/2);if(c==1){l=ww;t=(screen.height-h)/2;}if(c==2){l=ww}

	f+=',top='+t+',left='+l;LvlWin = window.open(u,n,f);LvlWin.focus();

	document.MM_returnValue=false;

}


function champsobligatoire()
{
	var msg ="Merci de renseigner : ";
	var prob=false;
	
	
	if (document.form1.sports.value == -1)
	{
		prob=true;
		msg +="\nle sport" ;
	}
	if (document.form1.numclasse.value == -1)
	{
		prob=true;
		msg +="\nla classe" ;
	}
	
	if (prob==true){
		alert (msg);
		return false;
	}
	return true;
}

function champsobligatoireinscription()
{
	var msg ="Merci de renseigner : "
	var prob=false;
	
	if (document.form1.nom.value.length == 0)
	{
		prob=true;
		msg +="\nvotre nom" ;
		
	}
	if (document.form1.prenom.value.length == 0)
	{
		prob=true;
		msg +="\nvotre prénom" ;
	}
	if (document.form1.tel.value.length == 0)
	{
		prob=true;
		msg +="\nvotre téléphone" ;
	}
	if (document.form1.email.value.length == 0)
	{
		prob=true;
		msg +="\nvotre email" ;
	}
	
	
	if (prob==true){
		alert (msg);
		return false;
	}
	return true;
}


function checkEmail(emailAddr) {
	// Cette fonction vérifie la bon format d'une adresse e-mail.
	// Comme :
	// user@domain.com ou user.perso@domain.com
	
	var i;
	
	// Recherche de @
	i = emailAddr.indexOf("@");
	if (i == -1) {
		return false;
	}
	
	// Séparation du nom de l'utilisateur et du nom de domaine.
	var username = emailAddr.substring(0, i);
	var domain = emailAddr.substring(i + 1, emailAddr.length)

	// Recherche des espaces au début du nom de l'utilisateur.
	i = 0;
	while ((username.substring(i, i + 1) == " ") && (i < username.length)) {
		i++;
	}
	// Les enlève s'il en trouve.
	if (i > 0) {
		username = username.substring(i, username.length);
	}

	// Recherche d'espaces à la fin du nom de domaine.
	i = domain.length - 1;
	while ((domain.substring(i, i + 1) == " ") && (i >= 0)) {
		i--;
	}
	// Les enlève s'il en trouve.
	if (i < (domain.length - 1)) {
		domain = domain.substring(0, i + 1);
	}

	// Vérifie que le nom de l'utilisateur et du domaine ne soit pas vide.
	if ((username == "") || (domain == "")) {
		return false;
	}
	
	// Vérifie s'il n'y a pas de caractères interdits dans le nom de l'utilisateur.
	var ch;
	for (i = 0; i < username.length; i++) {
		ch = (username.substring(i, i + 1)).toLowerCase();
		if (!(((ch >= "a") && (ch <= "z")) || 
			((ch >= "0") && (ch <= "9")) ||
			(ch == "_") || (ch == "-") || (ch == "."))) {
				return false;
		}
	}
	
	// Vérifie s'il n'y a pas de caractères interdits dans le nom de domaine
	for (i = 0; i < domain.length; i++) {
		ch = (domain.substring(i, i + 1)).toLowerCase();
		if (!(((ch >= "a") && (ch <= "z")) || 
			((ch >= "0") && (ch <= "9")) ||
			(ch == "_") || (ch == "-") || (ch == "."))) {
				return false;
		}
	}

// Ajouter ci-dessous de nouveaux noms de domaine.
// Voir tous les noms de domaine sur http://www.toulou?????ase-renaissance.net/c_outils/c-nom-domaine.htm
//
var aSuffix = new Array("com","net","int","aero","biz","museum","name","info","coop","pro","eu","edu","org","gov","mil","bj","dz","de","ad","be","ca","bf","bi","cm","cf","cg","cd","ci","dj","fr","ga","gp","gf","lu","mg","ml","ma","mq","mr","mc","nc","pf","re","pm","sn","ch","td","tf","tn");
	var bFoundSuffix = false;
	i = 0;
	while (i < aSuffix.length) {
		if (("." + aSuffix[i]) == domain.substring(domain.length - aSuffix[i].length - 1, domain.length)) {
			return true;
		}
		i++;
	}
	// Si le nom de domaine est inconnu  : return false
	return false;
	
}	
	

function emailOK(emailAddr) {
	if (!(checkEmail(emailAddr))) {
		document.form1.email.style.color='#FF0000';
		alert("Merci de vérifier votre adresse e-mail. Elle n\'est pas dans le bon format.");
		document.form1.email.value='';
		
	}
	else
	{
		document.form1.email.style.color='';
	}
}
// -->
//-->
