<!--

agt=navigator.userAgent.toLowerCase()
app=navigator.appName.toLowerCase()
ver = parseInt(navigator.appVersion)
var ie=(agt.indexOf('msie')!=-1 || agt.indexOf('Microsoft')!=-1)?1:0;
var n=(agt.indexOf('netscape')!=-1 || app.indexOf('netscape')!=-1)?1:0;
var ns4=(n && ver==4)?1:0;
var ns6=(n && ver==5)?1:0;

var ctl = "O";
aujourdhui = new Date();

//var annee = aujourdhui.getYear();
//annee = (ie)?annee:(1900 + annee);
var limiteage = annee - 18;
var sexe = "";

tTshirt =  new Array();
tTshirt[0] =new Array();
tTshirt[1] =new Array();
tTshirt[1][1] ="S";
tTshirt[1][2] ="M";
tTshirt[1][3] ="L";
tTshirt[1][4] ="XL";
tTshirt[1][5] ="XXL";
tTshirt[0][1] =5;
tTshirt[2] =new Array();
tTshirt[2][1] ="XS";
tTshirt[2][2] ="S";
tTshirt[2][3] ="M";
tTshirt[2][4] ="L";
tTshirt[2][5] ="XL";
tTshirt[0][2] =5;

function ControleTshirt(btnradio1, form1){
	var intT = (btnradio1[0].checked)?1:2;
	
	for (var c=1; c<=tTshirt[0][intT];c++) {
		form1.options[c]=null;
	}
	
	for (var c=1; c<=tTshirt[0][intT];c++) {
		
		o=new Option(tTshirt[intT][c],tTshirt[intT][c]);   
		form1.options[c]=o; 
	} 
	form1.options.selectedIndex=0;	
}

function ControleLicence(){
	var lic = document.forms["frmInscript"].elements["LICENCE"].options[document.forms["frmInscript"].elements["LICENCE"].selectedIndex].value;
	if (lic == "Non licencié(e)" || lic == "Autre" ){
		document.getElementById("licenceobligatoire").style.display="block";
		document.getElementById("nolicence").style.display="none";		
		document.getElementById("anolicence").style.display="none";
				
	}
	else{
		document.getElementById("licenceobligatoire").style.display="none";
		document.getElementById("nolicence").style.display="block";		
		document.getElementById("anolicence").style.display="block";
	}

}

function ControleInfo(btnradio1, btnradio2, btnradio3){
ctl = "O";  
	
	var nbp = document.forms["frmInscript"].elements["NB_PARTICIPATION"].options[document.forms["frmInscript"].elements["NB_PARTICIPATION"].selectedIndex].value;
	if (nbp == "**"){
		window.alert("Please indicate how many times you have participated in the 20 Kilomètres de Paris!");
		document.forms["frmInscript"].elements["NB_PARTICIPATION"].focus();
		ctl = "N";
		return false;
	}
	var ctl1 = ""; 
	var ctl2 = ""; 
	if (btnradio1[0].checked){		
    		ctl1 = "O"; 
	}
	if (btnradio1[1].checked){		
    		ctl2 = "O"; 
	}
	if (ctl1 == "" && ctl2 == "" ){
		window.alert("Please specify your gender!");
		ctl = "N";
		return false;
	}
	
	document.forms["frmInscript"].elements["DOSELITE"].value="";
	/*if (document.forms["frmInscript"].elements["PREFERENTIEL1"].checked == true || document.forms["frmInscript"].elements["PREFERENTIEL2"].checked == true){
	
		alert("PREFERENTIEL are closed !");
			document.forms["frmInscript"].elements["PREFERENTIEL1"].focus();	
			ctl = "N";
			return false;
	
	}*/
	
	
	/*if (document.forms["frmInscript"].elements["PREFERENTIEL1"].checked == true && document.forms["frmInscript"].elements["PREFERENTIEL2"].checked == true){
	
	window.alert("Please check Préférentiel 1 or Préférentiel 2 !");
					document.forms["frmInscript"].elements["PREFERENTIEL1"].focus();	
					ctl = "N";
					return false;		
	}		
	if (document.forms["frmInscript"].elements["PREFERENTIEL1"].checked == true){
		document.forms["frmInscript"].elements["DOSELITE"].value="PREFERENTIEL1";	
	}	
	if (document.forms["frmInscript"].elements["PREFERENTIEL2"].checked == true){
		document.forms["frmInscript"].elements["DOSELITE"].value="PREFERENTIEL2";	
	}*/
	
	if(document.forms["frmInscript"].elements["DOSELITE"].value==""){
		document.forms["frmInscript"].elements["DOSELITE"].value="AUTRES";
	}
	
	VerifSaisie("NOM", "your Last name !");
	if (ctl == "N") return false;	
	document.forms["frmInscript"].elements["NOM"].value = CtlSaisie(document.forms["frmInscript"].elements["NOM"].value);
	
	
	VerifSaisie("PRENOM", "your first name !");
	if (ctl == "N") return false;
	document.forms["frmInscript"].elements["PRENOM"].value = CtlSaisie(document.forms["frmInscript"].elements["PRENOM"].value);
	
	if (document.forms["frmInscript"].elements["ENTREPRISE"].value.length > 0){
		document.forms["frmInscript"].elements["ENTREPRISE"].value = CtlSaisie(document.forms["frmInscript"].elements["ENTREPRISE"].value);
	}
	
	VerifSaisie("ADRESS1", "your address !");
	if (ctl == "N") return false;	
	document.forms["frmInscript"].elements["ADRESS1"].value = CtlSaisie(document.forms["frmInscript"].elements["ADRESS1"].value);
	document.forms["frmInscript"].elements["ADRESS1"].value = CtlAdresse(document.forms["frmInscript"].elements["ADRESS1"].value);
	
	if (document.forms["frmInscript"].elements["ADRESS2"].value.length > 0){
		document.forms["frmInscript"].elements["ADRESS2"].value = CtlSaisie(document.forms["frmInscript"].elements["ADRESS2"].value);
		document.forms["frmInscript"].elements["ADRESS2"].value = CtlAdresse(document.forms["frmInscript"].elements["ADRESS2"].value);
	}
	if (document.forms["frmInscript"].elements["ADRESS3"].value.length > 0){
		document.forms["frmInscript"].elements["ADRESS3"].value = CtlSaisie(document.forms["frmInscript"].elements["ADRESS3"].value);
		document.forms["frmInscript"].elements["ADRESS3"].value = CtlAdresse(document.forms["frmInscript"].elements["ADRESS3"].value);
	}
	
	VerifSaisie("CODEPOS", "your post code !");
	if (ctl == "N"){ return false;}
	
	var pays = document.forms["frmInscript"].elements["PAYS"].options[document.forms["frmInscript"].elements["PAYS"].selectedIndex].value;
	if (pays == "FRANCE"){
		ncodepost = parseInt(document.forms["frmInscript"].elements["CODEPOS"].value);
	
		if(isNaN(ncodepost)){
			window.alert("Your post code appears to be incorrect!");
			document.forms["frmInscript"].elements["CODEPOS"].focus();
			ctl = "N";
			return false;	
			
		}
	
	}
	document.forms["frmInscript"].elements["CODEPOS"].value = CtlSaisie(document.forms["frmInscript"].elements["CODEPOS"].value);
	
	VerifSaisie("VILLE", "your city !");
	if (ctl == "N"){ return false;}	
	document.forms["frmInscript"].elements["VILLE"].value = CtlSaisie(document.forms["frmInscript"].elements["VILLE"].value);
	
	//if (btnradio2[0].checked){	
	VerifSaisie("EMAIL", "your e-mail address !");
	if (ctl == "N"){ return false;}	
	//}
	
	
	if (document.forms["frmInscript"].elements["EMAIL"].value.length > 0){
	document.forms["frmInscript"].elements["EMAIL"].value = document.forms["frmInscript"].elements["EMAIL"].value.toLowerCase();
        document.forms["frmInscript"].elements["CONF_EMAIL"].value = document.forms["frmInscript"].elements["CONF_EMAIL"].value.toLowerCase();
        var mail = document.forms["frmInscript"].elements["EMAIL"].value;
         var reg = /^[a-z0-9._-]+@[a-z0-9.-]{2,}[.][a-z]{2,4}$/	
   		ctl2 = reg.exec(mail)!=null
   		ctl = ctl2?"O":"N";
		if (ctl == "N"){ 
			window.alert("Your e-mail addresses appears to be incorrect !");
        		document.forms["frmInscript"].elements["EMAIL"].focus();          		
        		avalid = false;
			return false;	
		}
        
        
        
        								
    }
	
	if (document.forms["frmInscript"].elements["CONF_EMAIL"].value != document.forms["frmInscript"].elements["EMAIL"].value){
		window.alert("The e-mail address and confirmation are different !");
        	document.forms["frmInscript"].elements["CONF_EMAIL"].focus();        		
        	ctl = "N";
			return false;
	}
	
	
	var jj = document.forms["frmInscript"].elements["JJNAISS"].options[document.forms["frmInscript"].elements["JJNAISS"].selectedIndex].value;
	var mm = document.forms["frmInscript"].elements["MMNAISS"].options[document.forms["frmInscript"].elements["MMNAISS"].selectedIndex].value;
	var aa = document.forms["frmInscript"].elements["ANNAISS"].options[document.forms["frmInscript"].elements["ANNAISS"].selectedIndex].value;
	var datenaiss = jj + "/" + mm + "/" + aa
		
	if (verif_date(datenaiss)){
		}
		else{	
			window.alert("Your date of birth is not valid!");
	 		document.forms["frmInscript"].elements["JJNAISS"].focus();
	 		ctl = "N"
	 		return false;
	 
	 	}
	
	
	if (btnradio1[0].checked){		
    		sexe = "M"
	}	
	if (btnradio1[1].checked){		
    		sexe = "F"
	}	
	//CtlCateg(btnradio1);
	
				
	//VerifSaisie("TELDOM", "votre N° de téléphone !");
	//if (ctl == "N"){ return false;}	
	if (document.forms["frmInscript"].elements["TELDOM"].value.length > 0){	
	var pays = document.forms["frmInscript"].elements["PAYS"].options[document.forms["frmInscript"].elements["PAYS"].selectedIndex].value;
	if (pays == "FRANCE"){
		nb = document.forms["frmInscript"].elements["TELDOM"].value		
		
		var ok = ""
		while (nb.length > 0){
			nbn = parseInt(nb.charAt(0))
			if (isNaN(nbn)){
				ok = "n"
			}	
			nb = nb.substring(1,nb.length)
		}
		if (ok == "n"){
			window.alert("Your telephone number is not valid !");
			document.forms["frmInscript"].elements["TELDOM"].focus();	
			ctl = "N";
			return false;
		}
		else{ 					
				
				if (document.forms["frmInscript"].elements["TELDOM"].value.length != 10){
					window.alert("Your telephone number is not valid !");
					document.forms["frmInscript"].elements["TELDOM"].focus();	
					ctl = "N";
					return false;		
				}	
				else{
					nb = document.forms["frmInscript"].elements["TELDOM"].value		
					nb = nb.substring(0,2)					
					if (nb == "06" || nb == "07"){
					window.alert("Your telephone number is not valid !");
					document.forms["frmInscript"].elements["TELDOM"].focus();	
					ctl = "N";
					return false;		
					}	
				}		
						
		}
	}		
	}
	if (document.forms["frmInscript"].elements["TELMOB"].value.length > 0){	
	var pays = document.forms["frmInscript"].elements["PAYS"].options[document.forms["frmInscript"].elements["PAYS"].selectedIndex].value;
	if (pays == "FRANCE"){
		nb = document.forms["frmInscript"].elements["TELMOB"].value		
		
		var ok = ""
		while (nb.length > 0){
			nbn = parseInt(nb.charAt(0))
			if (isNaN(nbn)){
				ok = "n"
			}	
			nb = nb.substring(1,nb.length)
		}
		if (ok == "n"){
			window.alert("Your mobile phone number is not valid !");
			document.forms["frmInscript"].elements["TELMOB"].focus();	
			ctl = "N";
			return false;
		}
		else{ 					
				
				if (document.forms["frmInscript"].elements["TELMOB"].value.length != 10){
					window.alert("Your mobile phone number is not valid !");
					document.forms["frmInscript"].elements["TELMOB"].focus();	
					ctl = "N";
					return false;		
				}			
		}	
		}	
	}
	
	//if (btnradio3[0].checked){	
	
    	if (document.forms["frmInscript"].elements["LICFFA"].value.length > 0 && document.forms["frmInscript"].elements["PASSRUNNING"].value.length > 0){	
    					window.alert("Please type in your FFA membership number  - or -  your Pass'Running number  !");
    					document.forms["frmInscript"].elements["LICFFA"].focus();	
    					ctl = "N";
    					return false;		
    	}	
    	/*if (document.forms["frmInscript"].elements["LICFFA"].value.length == 0 && document.forms["frmInscript"].elements["PASSRUNNING"].value.length == 0){	
    					window.alert("Veuillez saisir le 'N° de licence FFA'  - ou -  le 'N° Pass' Running' !");
    					document.forms["frmInscript"].elements["LICFFA"].focus();	
    					ctl = "N";
    					return false;		
    	}	
	}
	else{
	document.forms["frmInscript"].elements["LICFFA"].value = "";
	document.forms["frmInscript"].elements["PASSRUNNING"].value = "";
	}*/
	
	var lic = document.forms["frmInscript"].elements["LICENCE"].options[document.forms["frmInscript"].elements["LICENCE"].selectedIndex].value;
	if (lic == "Non licencié(e)" || lic == "Autre" ){
			
	}
	else{
		VerifSaisie("NO_LICENCE", "your athletic license number!");
		if (ctl == "N"){ return false;}	
		
		if (document.forms["frmInscript"].elements["NO_LICENCE"].value.length < 5){
			window.alert("Your athletic license number must contain at least 5 digits!");
			document.forms["frmInscript"].elements["NO_LICENCE"].focus();	
			ctl = "N";
			return false;		
		}	
	}
	
	if (document.forms["frmInscript"].elements["PASSRUNNING"].value.length > 0){	
		document.forms["frmInscript"].elements["PASSRUNNING"].value = document.forms["frmInscript"].elements["PASSRUNNING"].value.toUpperCase();	
			nb = document.forms["frmInscript"].elements["PASSRUNNING"].value;
			nb = nb.substring(0,1)					
			if (nb != "T"){
					window.alert("Your Pass'Running number must start with a T !");
					document.forms["frmInscript"].elements["PASSRUNNING"].focus();	
					ctl = "N";
					return false;		
			}
			var ok = ""
			nb = document.forms["frmInscript"].elements["PASSRUNNING"].value;
			nb = nb.substring(1,7)	
			
    		while (nb.length > 0){
    			nbn = parseInt(nb.charAt(0))
    			if (isNaN(nbn)){
    				ok = "n"
    			}	
    			nb = nb.substring(1,nb.length)
    		}
    		if (ok == "n"){
    			window.alert("Your Pass'Running number is not valid !");
    			document.forms["frmInscript"].elements["PASSRUNNING"].focus();	
    			ctl = "N";
    			return false;
    		}	
			nb = document.forms["frmInscript"].elements["PASSRUNNING"].value;
			nb = nb.substring(1,7)	
			
			nb = Number(nb)
			
			if (nb > 300000){
    			window.alert("Your Pass'Running number is not valid !");
    			document.forms["frmInscript"].elements["PASSRUNNING"].focus();	
    			ctl = "N";
    			return false;
    		}	
	}	
	if (document.forms["frmInscript"].elements["CLUBFCSAD"].value.length > 0 && document.forms["frmInscript"].elements["LICFSPF"].value.length > 0){	
					window.alert("Please type in your FCSAD membership number'  - or -  'your FSPF membership number' !");
					document.forms["frmInscript"].elements["CLUBFCSAD"].focus();	
					ctl = "N";
					return false;		
	}		
	
	if (document.forms["frmInscript"].elements["CLUBFCSAD"].value.length > 0){		
		VerifSaisie("CLUBFCSAD", "your FCSAD membership number !");
		if (ctl == "N"){ return false;}	
		document.forms["frmInscript"].elements["FCSAD"].value="OUI";	
	}	
	else{
	document.forms["frmInscript"].elements["FCSAD"].value="";	
	}
	
	if (document.forms["frmInscript"].elements["LICFSPF"].value.length > 0){	
		
		VerifSaisie("LICFSPF", "your FSPF membership number !");
		if (ctl == "N"){ return false;}	
		document.forms["frmInscript"].elements["FSPF"].value="OUI";	
	}
	else{
	document.forms["frmInscript"].elements["FSPF"].value="";	
	}
	document.forms["frmInscript"].elements["STATUT_DEFENSE"].value="";	
	if (document.forms["frmInscript"].elements["STATUT_DEFENSE_MILITAIRE"].checked == true && document.forms["frmInscript"].elements["STATUT_DEFENSE_CIVIL"].checked == true){
	
	window.alert("Please check Armed Forces or Civil Defence !");
					document.forms["frmInscript"].elements["STATUT_DEFENSE_MILITAIRE"].focus();	
					ctl = "N";
					return false;		
	}		
	if (document.forms["frmInscript"].elements["STATUT_DEFENSE_MILITAIRE"].checked == true){
		document.forms["frmInscript"].elements["STATUT_DEFENSE"].value = document.forms["frmInscript"].elements["STATUT_DEFENSE_MILITAIRE"].value;	
	}	
	if (document.forms["frmInscript"].elements["STATUT_DEFENSE_CIVIL"].checked == true){
		document.forms["frmInscript"].elements["STATUT_DEFENSE"].value = document.forms["frmInscript"].elements["STATUT_DEFENSE_CIVIL"].value;	
	}	
	if (document.forms["frmInscript"].elements["STATUT_DEFENSE"].value == "" && document.forms["frmInscript"].elements["LICENCIE_FCSAD"].checked == true){
			window.alert("If you are FSCAD membership, Please check Armed Forces or Civil Defence !");
			document.forms["frmInscript"].elements["STATUT_DEFENSE_MILITAIRE"].focus();	
			ctl = "N";
			return false;		
	}
	
	/*document.forms["frmInscript"].elements["PUCE"].value = document.forms["frmInscript"].elements["PUCE"].value.toUpperCase();	
	if (document.forms["frmInscript"].elements["PUCE"].value.length > 0){	
		
		var puce;
		
		puce = document.forms["frmInscript"].elements["PUCE"].value
			
		if (puce.length < 7){
			alert("Your number of chip must comprise 7 characters ! ");
			document.forms["frmInscript"].elements["PUCE"].focus();	
			ctl = "N";
			return false;
		}
		
		ctlpuce1 = puce.substring(0,1);
		ctlpuce2 = puce.substring(1,2);
		
		ok = "n"
		nctlpuce = parseInt(ctlpuce1.charAt(0))
		
		if (isNaN(nctlpuce)){
				ok = "o"
		}
		
		nctlpuce = parseInt(ctlpuce2.charAt(0))
		
		if (isNaN(nctlpuce)){
				ok = "o"
		}
		if (ok == "n"){
			alert("Your number of chip must start with 2 letters !");
			document.forms["frmInscript"].elements["PUCE"].focus();	
			ctl = "N";
			return false;
		}		
	}*/
	
	/*if (document.forms["frmInscript"].elements["PREFERENTIEL1"].checked == true || document.forms["frmInscript"].elements["PREFERENTIEL2"].checked == true){
	if (btnradio2[0].checked){
		alert("All payments for preferential registrations must be made by cheque!");
			document.forms["frmInscript"].elements["PREFERENTIEL1"].focus();	
			ctl = "N";
			return false;
	}
	}*/
	
	var nbp = document.forms["frmInscript"].elements["TAILLETSHIRT"].options[document.forms["frmInscript"].elements["TAILLETSHIRT"].selectedIndex].value;
	if (nbp == "**"){
		window.alert("Please enter your T-shirt size!");
		document.forms["frmInscript"].elements["TAILLETSHIRT"].focus();	
		ctl = "N";
		return false;
	}
	
	
	if (ctl == "O"){
	
	 	document.forms["frmInscript"].action="ext_inscription_confirm.asp";
	  	document.forms["frmInscript"].submit();
		//alert("ok")
	  }
	  else{
	  	return false;
	  }
	
}

function verif_date(input){
	var regex = new RegExp("[/-]");
	var date = input.split(regex);
	var nbJours = new Array('',31,28,31,30,31,30,31,31,30,31,30,31);
	var result = true;

	if ( date['2']%4 == 0 && date['2']%100 > 0 || date['2']%400 == 0 )
	nbJours['2'] = 29;

		if( isNaN(date['2']) )
	result=false;

	if ( isNaN(date['1']) || date['1'] > 12 || date['1'] < 1 )
	result=false;

	if ( isNaN(date['0']) || date['0'] > nbJours[Math.round(date['1'])] || date['0'] < 1 )
	result=false;

	return result;
}



function ControleEmail(){
ctl = "O";
VerifSaisie("EMAIL", "Your e-mail addresses !");
	if (ctl == "N"){ return false;}	
	
	if (document.forms["frmInscript"].elements["EMAIL"].value.length > 0){
	document.forms["frmInscript"].elements["EMAIL"].value = document.forms["frmInscript"].elements["EMAIL"].value.toLowerCase();
	document.forms["frmInscript"].elements["CONF_EMAIL"].value = document.forms["frmInscript"].elements["CONF_EMAIL"].value.toLowerCase();
        var mail = document.forms["frmInscript"].elements["EMAIL"].value;
         var reg = /^[a-z0-9._-]+@[a-z0-9.-]{2,}[.][a-z]{2,4}$/	
   		ctl2 = reg.exec(mail)!=null
   		ctl = ctl2?"O":"N";
		if (ctl == "N"){ 
			window.alert("Your e-mail addresses appears to be incorrect !!!");
        		document.forms["frmInscript"].elements["EMAIL"].focus();         		
        		avalid = false;
			return false;	
		}
        
        
       								
    }
	
	if (document.forms["frmInscript"].elements["CONF_EMAIL"].value != document.forms["frmInscript"].elements["EMAIL"].value){
		window.alert("The e-mail address and confirmation are different !");
        	document.forms["frmInscript"].elements["CONF_EMAIL"].focus();        		
        	ctl = "N";
			return false;
	}
if (ctl == "O"){
	
	 	document.forms["frmInscript"].action="ext_inscription_email_envoi.asp";
		document.forms["frmInscript"].submit();
		//alert("ok")
	  }
	  else{
	  	return false;
	  }
}




TableauCategories = new Array(20)
TableauCategories[0]="?";
TableauCategories[1]="VH4";
TableauCategories[2]="VH3";
TableauCategories[3]="VH2";
TableauCategories[4]="VH1";
TableauCategories[5]="VF3";
TableauCategories[6]="VF2";
TableauCategories[7]="VF1";
TableauCategories[8]="SH";
TableauCategories[9]="SF";
TableauCategories[10]="EH";
TableauCategories[11]="EF";
TableauCategories[12]="JH";
TableauCategories[13]="JF";

function CtlCateg(btnradio1){
if (btnradio1[0].checked){		
    		sexe = "M"
	}	
	if (btnradio1[1].checked){		
    		sexe = "F"
	}	
	
if (document.forms["frmInscript"].elements["ANNAISS"].value.length > 0){	
		nb = document.forms["frmInscript"].elements["ANNAISS"].value		
		
		var ok = ""
		while (nb.length > 0){
			nbn = parseInt(nb.charAt(0))
			if (isNaN(nbn)){
				ok = "n"
			}	
			nb = nb.substring(1,nb.length)
		}
		if (ok == "n"){
			window.alert("Your year of birth  is not valid !");
			document.forms["frmInscript"].elements["ANNAISS"].focus();	
			ctl = "N";
			return false;
		}
		else{ 					
				
				if (document.forms["frmInscript"].elements["ANNAISS"].value.length < 2){
					window.alert("Please type in the year of birth with 2 numbers !");
					document.forms["frmInscript"].elements["ANNAISS"].focus();	
					ctl = "N";
					return false;		
				}	
				var annnaiss = parseInt(document.forms["frmInscript"].elements["ANNAISS"].value);
				annnaiss = annnaiss + 1900
				if (annnaiss < 1920){
					
					window.alert("Your year of birth is not valid !");
					document.forms["frmInscript"].elements["ANNAISS"].focus();	
					ctl = "N";
					return false;	
				}
				if (annnaiss > limiteage){
					
					window.alert("Your year of birth is not valid !");
					document.forms["frmInscript"].elements["ANNAISS"].focus();	
					ctl = "N";
					return false;	
				}
				/*if (annnaiss == limiteage){
					var moisnaiss = parseInt(document.forms["frmInscript"].elements["MMNAISS"].value);
					
					if (moisnaiss > mois_course){
						window.alert("Your date of birth is not valid !");
						document.forms["frmInscript"].elements["MMNAISS"].focus();	
						ctl = "N";
						return false;
					}
					if (moisnaiss == mois_course){
						var journaiss = parseInt(document.forms["frmInscript"].elements["JJNAISS"].value);
					
						if (journaiss > jour_course){
							window.alert("Your date of birth is not valid !");
							document.forms["frmInscript"].elements["JJNAISS"].focus();	
							ctl = "N";
							return false;
						}
					}	
				}*/				
		}		
	}	
	var cat = 0;
	var age = annee - annnaiss;
	var okcateg = "N";
	if (sexe == "M"){
		if (age >= 70){ cat = 1; okcateg = "O";}
		if (age >= 60 && age <= 69){ cat = 2; okcateg = "O"; }
		if (age >= 50 && age <= 59){ cat = 3; okcateg = "O";}	
		if (age >= 40 && age <= 49){ cat = 4; okcateg = "O";}	
		if (age >= 23 && age <= 39){ cat = 8; okcateg = "O";}	
		if (age >= 20 && age <= 22){ cat = 10; okcateg = "O";}	
		if (age >= 18 && age <= 19){ cat = 12; okcateg = "O";}	
							
	}
	
	if (okcateg == "N"){
		if (sexe == "F"){		
			if (age >= 60){ cat = 5; okcateg = "O"; }
			if (age >= 50 && age <= 59){ cat = 6; okcateg = "O";}	
			if (age >= 40 && age <= 49){ cat = 7; okcateg = "O";}	
			if (age >= 23 && age <= 39){ cat = 9; okcateg = "O";}	
			if (age >= 20 && age <= 22){ cat = 11; okcateg = "O";}	
			if (age >= 18 && age <= 19){ cat = 13; okcateg = "O";}	
		}
	}
	
	document.forms["frmInscript"].elements["CATEG"].value = TableauCategories[cat];
	
}

function VerifSaisie(champ, lebelle){	
if (document.forms["frmInscript"].elements[champ].value.length < 1){			
			window.alert("Please type in  " + lebelle );
			document.forms["frmInscript"].elements[champ].focus();
			ctl = "N";
			return ctl;		
	}	
}







function VerifDos(btnradio1, btnradio2){	
	
    		/*if (btnradio1[0].checked) {           			
				document.forms["frmInscript"].elements["DOSPREFHF"].value="";
				if (btnradio2[0].checked) {
				document.forms["frmInscript"].elements["DOSELITEHF"].value="ELITE HOMME";
				
				}
				if (btnradio2[1].checked) {
				document.forms["frmInscript"].elements["DOSELITEHF"].value="ELITE FEMME";
				
				}
							
    		}
			if (btnradio1[0].checked) {           			
				document.forms["frmInscript"].elements["DOSELITEHF"].value="";
				if (btnradio2[0].checked) {
				document.forms["frmInscript"].elements["DOSPREFHF"].value="PREFERENTIEL";
				
				}
				if (btnradio2[1].checked) {
				document.forms["frmInscript"].elements["DOSPREFHF"].value="PREFERENTIEL";
				
				}
							
    		}*/
    	
}

function CtlSaisie(champ){
	var midstring;
	var recupmidstring;
	var recupmidstring2;
	var finalstring = "";
	nb2 = champ;
	
		while (nb2.length > 0){
			nbn2 = nb2.charAt(0)
			switch (nbn2){
   				case '"' :
       				midstring = " ";
      				break;
				case "!" :
       				midstring = " ";
      				break;
				case "§" :
       				midstring = " ";
      				break;
				case "<" :
       				midstring = " ";
      				break;
				case ">" :
       				midstring = " ";
      				break;
				case "$" :
       				midstring = " ";
      				break;
				case "£" :
       				midstring = " ";
      				break;
				case "%" :
       				midstring = " ";
      				break;
				case "¤" :
       				midstring = " ";
      				break;
				case "µ" :
       				midstring = " ";
      				break;
				case "." :
       				midstring = " ";
      				break;
   				case "," :
       				midstring = " ";
      				break;   
				case ";" :
       				midstring = " ";
      				break;   
				case ":" :
       				midstring = " ";
      				break;   
				case "/" :
       				midstring = " ";
      				break; 
				case "\\" :
       				midstring = " ";
      				break;   
				case "?" :
       				midstring = " ";
      				break;  				  
				case "_" :
       				midstring = " ";
      				break; 
				case "'" :
       				midstring = " ";
      				break; 
				case "`" :
       				midstring = " ";
      				break;  
				case "^" :
       				midstring = " ";
      				break;
				case "¨" :
       				midstring = " ";
      				break;
				case "#" :
       				midstring = " ";
      				break;
				case "&" :
       				midstring = " ";
      				break;
				case "~" :
       				midstring = " ";
      				break;
				case "{" :
       				midstring = " ";
      				break;
				case "}" :
       				midstring = " ";
      				break;
				case "(" :
       				midstring = " ";
      				break;
				case ")" :
       				midstring = " ";
      				break;
				case "[" :
       				midstring = " ";
      				break;
				case "]" :
       				midstring = " ";
      				break;
				case "|" :
       				midstring = " ";
      				break;
				case "@" :
       				midstring = " ";
      				break;
				case "°" :
       				midstring = " ";
      				break;
				case "=" :
       				midstring = " ";
      				break;
				case "+" :
       				midstring = " ";
      				break;
				case "-" :
       				midstring = " ";
      				break; 
				case "*" :
       				midstring = " ";
      				break;
				case "é" :
       				midstring = "e";
      				break; 				
				case "è" :
       				midstring = "e";
      				break; 
				case "ê" :
       				midstring = "e";
      				break; 
				case "ë" :
       				midstring = "e";
      				break; 
				case "à" :
       				midstring = "a";
      				break; 
				case "ç" :
       				midstring = "c";
      				break; 
				case "ù" :
       				midstring = "u";
      				break; 
				case "û" :
       				midstring = "u";				
      				break; 
				case "ü" :
       				midstring = "u";
					break; 
				case "î" :
       				midstring = "i";
					break; 
				case "ï" :
       				midstring = "i";
					break; 
				case "ö" :
       				midstring = "o";
					break; 
				case "ô" :
       				midstring = "o";
      				break;    
   				default : midstring = nbn2;
			}
			recupmidstring2 = midstring
			if (recupmidstring == " "){
				if (midstring == " "){
					midstring = "";
				}
			}
			finalstring = finalstring + midstring
			nb2 = nb2.substring(1,nb2.length)
			recupmidstring = recupmidstring2
		}
		
	ctlchamp = new String(finalstring);
	return ctlchamp.toUpperCase()
}

TableauExpression = new Array(70)
TableauAbreviation = new Array(70)
var cptexpres = 67

//TableauExpression[1]="ALLEE";
TableauExpression[2]="AVENUE";
TableauExpression[3]="BOULEVARD";
TableauExpression[4]="CENTRE COMMERCIAL";
//TableauExpression[5]="CENTRE";
TableauExpression[6]="CHEMIN";
TableauExpression[7]="IMMEUBLE";
TableauExpression[8]="IMPASSE";
TableauExpression[9]="LIEU-DIT";
TableauExpression[10]="LOTISSEMENT";
//TableauExpression[11]="PASSAGE";
TableauExpression[12]="PLACE";
TableauExpression[13]="RESIDENCE";
TableauExpression[14]="ROND-POINT";
TableauExpression[15]="ROUTE";
TableauExpression[16]="SENTIER";
TableauExpression[17]="SQUARE";
//TableauExpression[18]="VILLAGE";
TableauExpression[19]="ZONE D'ACTIVITE";
TableauExpression[20]="ZONE INDUSTRIELLE";
TableauExpression[21]="ASSOCIATION";
TableauExpression[22]="AERODROME";
TableauExpression[23]="AEROPORT";
//TableauExpression[24]="BATAILLON";
TableauExpression[25]="BATIMENT";
TableauExpression[26]="BOITE POSTALE";
TableauExpression[27]="BIS";
TableauExpression[28]="COMMERCIAL";
TableauExpression[29]="COMPAGNIE";
TableauExpression[30]="DIVISION";
TableauExpression[31]="ETABLISSEMENT";
//TableauExpression[32]="ETAT MAJOR";
//TableauExpression[33]="GENDARMERIE";
TableauExpression[34]="GENERAL";
//TableauExpression[35]="GRANDES";
//TableauExpression[36]="GRANDE";
//TableauExpression[37]="GRANDS";
//TableauExpression[38]="GRAND";
TableauExpression[39]="HAUTES";
TableauExpression[40]="HAUTE";
TableauExpression[41]="HAUTS";
TableauExpression[42]="HAUT";
TableauExpression[43]="MILITAIRE";
//TableauExpression[44]="NATIONAL";
//TableauExpression[45]="NOTRE DAME";
TableauExpression[46]="NOUVEAU";
TableauExpression[47]="NOUVELLE";
//TableauExpression[48]="PETITES";
//TableauExpression[49]="PETITE";
//TableauExpression[50]="PETITS";
//TableauExpression[51]="PETIT";
TableauExpression[52]="PRESIDENT";
TableauExpression[53]="PROFESSEUR";
TableauExpression[54]="PROLONGEE";
TableauExpression[55]="PROPRIETE";
TableauExpression[56]="QUATER";
TableauExpression[57]="REGIMENT";
TableauExpression[58]="SAINTES";
TableauExpression[59]="SAINTS";
TableauExpression[60]="SAINT";
TableauExpression[61]="SOCIETE";
//TableauExpression[62]="TER";
//TableauExpression[63]="UNIVERSITE";
TableauExpression[64]="VELODROME";
//TableauExpression[65]="VIEILLES";
//TableauExpression[66]="VIEILLE";
//TableauExpression[67]="VIEUX";


//TableauAbreviation[1]="ALL";
TableauAbreviation[2]="AV";
TableauAbreviation[3]="BD";
TableauAbreviation[4]="CCAL";
TableauAbreviation[5]="CTRE";
TableauAbreviation[6]="CHEM";
TableauAbreviation[7]="IMM";
TableauAbreviation[8]="IMP";
TableauAbreviation[9]="LD";
TableauAbreviation[10]="LOT";
TableauAbreviation[11]="PAS";
TableauAbreviation[12]="PL";
TableauAbreviation[13]="RES";
TableauAbreviation[14]="RPT";
TableauAbreviation[15]="RTE";
TableauAbreviation[16]="SENT";
TableauAbreviation[17]="SQ";
TableauAbreviation[18]="VLGE";
TableauAbreviation[19]="ZA";
TableauAbreviation[20]="ZI";
TableauAbreviation[21]="ASSOC";
TableauAbreviation[22]="AERD";
TableauAbreviation[23]="AERP";
TableauAbreviation[24]="BTN";
TableauAbreviation[25]="BAT";
TableauAbreviation[26]="BP";
TableauAbreviation[27]="B";
TableauAbreviation[28]="CIAL";
TableauAbreviation[29]="CIE";
TableauAbreviation[30]="DIV";
TableauAbreviation[31]="ETS";
TableauAbreviation[32]="EM";
TableauAbreviation[33]="GEND";
TableauAbreviation[34]="GAL";
TableauAbreviation[35]="GDES";
TableauAbreviation[36]="GDE";
TableauAbreviation[37]="GDS";
TableauAbreviation[38]="GD";
TableauAbreviation[39]="HTES";
TableauAbreviation[40]="HTE";
TableauAbreviation[41]="HTS";
TableauAbreviation[42]="HT";
TableauAbreviation[43]="MIL";
TableauAbreviation[44]="NAL";
TableauAbreviation[45]="ND";
TableauAbreviation[46]="NOUV";
TableauAbreviation[47]="NOUV";
TableauAbreviation[48]="PTES";
TableauAbreviation[49]="PTE";
TableauAbreviation[50]="PTS";
TableauAbreviation[51]="PT";
TableauAbreviation[52]="PDT";
TableauAbreviation[53]="PR";
TableauAbreviation[54]="PROL";
TableauAbreviation[55]="PROP";
TableauAbreviation[56]="Q";
TableauAbreviation[57]="RGT";
TableauAbreviation[58]="STES";
TableauAbreviation[59]="STS";
TableauAbreviation[60]="ST";
TableauAbreviation[61]="SOC";
TableauAbreviation[62]="T";
//TableauAbreviation[63]="UNIV";
TableauAbreviation[64]="VELOD";
TableauAbreviation[65]="VIEL";
TableauAbreviation[66]="VIEL";
TableauAbreviation[67]="VX";


function CtlAdresse(champ){
	var lechamp;
	var ctlchamp;
	var posexpres = 0;
	var lenexpres = 0;
	lechamp = champ
	ctlexpres = "N"

	for (var j=1; j<cptexpres;j++) {			
			if ((lechamp.indexOf(TableauExpression[j])>=0)) {				
				posexpres = lechamp.indexOf(TableauExpression[j]);				
				lenexpres = TableauExpression[j].length ; 				 			
				ctlchamp = lechamp.substring(0,(posexpres));				
				ctlchamp = ctlchamp + TableauAbreviation[j];				
				ctlchamp = ctlchamp + lechamp.substring((posexpres + lenexpres),lechamp.length);
				lechamp = ctlchamp;					
        	}
			 
		

} 
	
	
		
	
	return lechamp
}

function ChercheLoc(){
	
	var pays = document.forms["frmInscript"].elements["PAYS"].options[document.forms["frmInscript"].elements["PAYS"].selectedIndex].value;
	if (pays == "FRANCE"){
		if (document.forms["frmInscript"].elements["CODEPOS"].value.length > 0){
			page = "localite.asp?CODE=" + document.forms["frmInscript"].elements["CODEPOS"].value;
			page = page + "&FORMUL=frmInscript&CHAMPS=VILLE";
  			window.open(page,"localite","toolbar=0,location=0,directories=0,menuBar=0,scrollbars=1,resizable=1,width=320,height=200,left=100,top=100");
  		}
  		else
  		{
  			alert("Please type in a post code !")
  		}
	}

}

function CtlInscritV(){
	
	ctl = "O";
	if (document.forms["frmInscript"].elements["ACCEPTE"].checked){ctl = "O";}
	else{ctl = "N";}

	if (ctl == "N"){	
		
			window.alert("Please check the box to access the registration page");
		
		
			document.forms["frmInscript"].elements["ACCEPTE"].focus();
			ctl = "N";
			return false;
	}
	
       	     
	
	if (ctl == "O"){		
		document.forms["frmInscript"].action="ext_inscription.asp";	
			document.forms["frmInscript"].submit();
			
	}
	  	else{
	  		return false;
	  	}
	 
}
function ControleInfoU(){
	ctl = "O";
	if (document.forms["frmUpload"].elements["IDREF"].value.length < 1){
		window.alert("Please enter your ID number !");
		document.forms["frmUpload"].elements["IDREF"].focus();
		ctl = "N";
		return false;		
	}
	if (document.forms["frmUpload"].elements["IDREF"].value.length < 6){
					window.alert("Your ID number must comprise 6 digits !");
					document.forms["frmInscript"].elements["ANNAISS"].focus();	
					ctl = "N";
					return false;		
				}
	ncoinsc = parseInt(document.forms["frmUpload"].elements["IDREF"].value);
	
		if(isNaN(ncoinsc)){
			window.alert("Your ID number must comprise 6 digits !");
			ctl = "N";
			return false;	
			
		}
	if (document.forms["frmUpload"].elements["DATENAISS"].value.length < 1){
		window.alert("Please enter your date of birth  !");
		document.forms["frmUpload"].elements["DATENAISS"].focus();
		ctl = "N";
		return false;		
	}
	
	
	if (ctl == "O"){
	
	 	document.forms["frmUpload"].action="upload_acces_ctl.asp";
	  	document.forms["frmUpload"].submit();
	  }
	  else{
	  	return false;
	  }
		
}

function ControleInfoUp(){	
	ctl = "O";	 
	if (document.forms["frmUpload"].elements["idref"].value.length < 1){
			window.alert("Your identification has expired; please log in again !");
			
		window.location="upload_acces_saisie.asp";
		return false;
	}
	
	 if (document.forms["frmUpload"].elements["certif"].checked){ctl = "O";}
	else{ctl = "N";}
	
	

	if (ctl == "N"){			
				window.alert("You must check a box to validate your request");
			
			document.forms["frmUpload"].elements["certif"].focus();
			ctl = "N";
			return false;
	}
	
	if (ctl == "O"){
		
	 	document.forms["frmUpload"].action="upload_saisie.asp";
	  	document.forms["frmUpload"].submit();
	  }
	  else{
	  	return false;
	  }
}

function ControleInfoUpload(){
	
	ctl = "O";
	
	if (document.forms["frmUpload"].elements["idref"].value.length < 1){
		
			window.alert("Your identification has expired; please log in again !");
			
		window.location="upload_acces_saisie.asp";
		return false;
	}
	
	
	if (document.forms["frmUpload"].elements["justificatif"].value.length < 1){
		
			window.alert("Please select a medical certificate (or licence) to send !");
			
		document.forms["frmUpload"].elements["justificatif"].focus();
		ctl = "N";
		return false;		
	}
	
	
	if (document.forms["frmUpload"].elements["justificatif"].value.length > 0){
      	browsejpeg = document.forms["frmUpload"].elements["justificatif"].value.toUpperCase().indexOf("JPEG") ;    
      	browsejpg = document.forms["frmUpload"].elements["justificatif"].value.toUpperCase().indexOf("JPG") ;   
   		browsegif = document.forms["frmUpload"].elements["justificatif"].value.toUpperCase().indexOf("GIF") ; 
		browsepdf = document.forms["frmUpload"].elements["justificatif"].value.toUpperCase().indexOf("PDF") ;   
   		if (browsejpeg == -1 & browsejpg == -1 & browsegif == -1 & browsepdf == -1){
			window.alert("Please select a jpg, jpeg, gif or pdf file");	
			
    		document.forms["frmUpload"].elements["justificatif"].focus();
    		return false;
		}
     }
	 
	
	if (ctl == "O"){
				
					document.getElementById("message").style.visibility="visible";			
			
			
	 	document.forms["frmUpload"].action="upload_envoi.asp";
	  	document.forms["frmUpload"].submit();
	  }
	  else{
	  	return false;
	  }
}



function ControleInfoCm(){
	ctl = "O";
	if (document.forms["frmUpload"].elements["IDREF"].value.length < 1){
		
			window.alert("Please enter your ID number !");
			
		document.forms["frmUpload"].elements["IDREF"].focus();
		ctl = "N";
		return false;		
	}
	if (document.forms["frmUpload"].elements["DATENAISS"].value.length < 1){
			window.alert("Please enter your date of birth  !");
			
		document.forms["frmUpload"].elements["DATENAISS"].focus();
		ctl = "N";
		return false;		
	}
	
	
	if (ctl == "O"){
	
	 	document.forms["frmUpload"].action="verif_cm_ctl.asp";
	  	document.forms["frmUpload"].submit();
	  }
	  else{
	  	return false;
	  }
		
}





function ControleInfoContact(){
ctl = "O";
	
	
	if (document.forms["frmEcrire"].elements["EMAIL"].value.length < 1){
     
			window.alert("Please type in your e-mail address !");
		
        	document.forms["frmEcrire"].elements["EMAIL"].focus();        		
        	ctl = "N";
			return false;
        								
    }
	if (document.forms["frmEcrire"].elements["EMAIL"].value.length > 0){
        var mail = document.forms["frmEcrire"].elements["EMAIL"].value;
        document.forms["frmEcrire"].elements["EMAIL"].value = document.forms["frmEcrire"].elements["EMAIL"].value.toLowerCase();
        var mail = document.forms["frmEcrire"].elements["EMAIL"].value;
         var reg = /^[a-z0-9._-]+@[a-z0-9.-]{2,}[.][a-z]{2,4}$/	
   		ctl2 = reg.exec(mail)!=null
   		ctl = ctl2?"O":"N";
		if (ctl == "N"){ 
			window.alert("Your e-mail addresses appears to be incorrect !");
        		document.forms["frmEcrire"].elements["EMAIL"].focus();          		
        		avalid = false;
			return false;	
		}
		
										
    }
	if (document.forms["frmEcrire"].elements["MESSAGE"].value.length < 1){
		
		window.alert("Please type in your message");
		
		document.forms["frmEcrire"].elements["MESSAGE"].focus();
		ctl = "N";
		return false;		
	}
	if (ctl == "O"){
		//alert("ok")
	 	document.forms["frmEcrire"].action="contact_envoi.asp";
	  	document.forms["frmEcrire"].submit();
	  }
	  else{
	  	return false;
	  }
	
}
//-->

