function addOnLoad(){

	form_pseudo = document.getElementById('pseudo');//
	form_mdp = document.getElementById('mdp');//
	form_mdp2 = document.getElementById('mdp2');//
	form_email = document.getElementById('email');
	form_nom = document.getElementById('nom');//
	form_prenom = document.getElementById('prenom');//
	form_civilite = document.getElementById('sexe');
	form_dnaiss = document.getElementById('dnaiss');	
	form_situation = document.getElementById('situation');
	form_profession = document.getElementById('profession');
	form_pays = document.getElementById('pays');
	form_region = document.getElementById('region');
	form_departement = document.getElementById('departement');
	form_codepostal = document.getElementById('codepostal');
	form_adresse = document.getElementById('adresse');//	
	form_ville = document.getElementById('ville');
	form_grande_ville = document.getElementById('grande_ville');
	form_villenord = document.getElementById('villenord');
	form_villepicard = document.getElementById('villepicard');
	form_activite1 = document.getElementById('activite1');
	form_activite2 = document.getElementById('activite2');
	form_activite3 = document.getElementById('activite3');		
	form_description = document.getElementById('description');//
	form_lettre = document.getElementById('lettre');//
	form_accept = document.getElementById('accept');

	form_region.disabled = true;
	form_departement.disabled = true;
	form_codepostal.disabled = true;
	form_grande_ville.disabled = true;
	//alert("AddOnLoad");	
}

function addOnLoadFlash() {

	form_pseudo = document.getElementById('pseudo');//
	form_mdp = document.getElementById('mdp');//
	form_mdp2 = document.getElementById('mdp2');//
	form_email = document.getElementById('email');
	form_pays = document.getElementById('pays');
	form_region = document.getElementById('region');
	form_departement = document.getElementById('departement');		
	form_codepostal = document.getElementById('codepostal');	
	form_ville = document.getElementById('ville');
	form_grande_ville = document.getElementById('grande_ville');	
	form_villenord = document.getElementById('villenord');
	form_villepicard = document.getElementById('villepicard');
	form_accept = document.getElementById('accept');

	form_region.disabled = true;
	form_departement.disabled = true;
	form_codepostal.disabled = true;
	form_grande_ville.disabled = true;

}

function CheckFormFlash(){

	if(form_pseudo.value==''){
		alert('Merci de remplir le pseudo');
		form_pseudo.focus();
		form_pseudo.style.backgroundColor='#FFBFC1';
		return false;
	} else {
		if(form_pseudo.value.length < 5 || form_pseudo.value.length > 25) {
			alert("Votre pseudo doit être composé de 5 à 25 caractères");
			form_pseudo.focus();
			form_pseudo.style.backgroundColor='#FFBFC1';
			return false;
		} else {
			form_pseudo.style.backgroundColor='';
		}
	}
	
	if(form_mdp.value==''){
		alert('Merci de remplir le mot de passe');
		form_mdp.focus();
		form_mdp.style.backgroundColor='#FFBFC1';
		return false;
	} else {
		if(form_mdp.value.length < 4 || form_mdp.value.length > 15) {
			alert("Votre mot de passe doit être composé de 4 à 15 caractères");
			form_mdp.focus();
			form_mdp.style.backgroundColor='#FFBFC1';
			return false;
		} else {
			form_mdp.style.backgroundColor='';
		}
	}
	
	
	if(form_mdp.value != form_mdp2.value){
		alert('Confirmation de mot de passe incorrecte');
		form_mdp2.focus();
		form_mdp2.style.backgroundColor='#FFBFC1';
		form_mdp.style.backgroundColor='#FFBFC1';
		return false;
	} else {
		form_mdp2.style.backgroundColor='';
		form_mdp.style.backgroundColor='';
	}

	if(!isEmail(form_email)){
		alert('Merci de remplir un email valide');
		form_email.focus();
		form_email.style.backgroundColor='#FFBFC1';
		return false;
	} else {
		form_email	.style.backgroundColor='';
	}

	if(form_pays.value == ''){
		alert('Merci de sélectionner un pays');
		form_pays.focus();
		form_pays.style.backgroundColor='#FFBFC1';
		return false;
	} else {
		form_pays.style.backgroundColor='';
	}

	if(form_pays.value == 'france'){
		if(form_region.value == ''){
			alert('Merci de sélectionner une région');
			form_region.focus();
			form_region.style.backgroundColor='#FFBFC1';
			return false;
		} else {
			form_region.style.backgroundColor='';
		}

		if(form_departement.value == ''){
			alert('Merci de sélectionner un département');
			form_departement.focus();
			form_departement.style.backgroundColor='#FFBFC1';
			return false;
		} else {
			form_departement.style.backgroundColor='';
		}
	
		if(form_codepostal.value == ''){
			alert('Merci de sélectionner un code postal');
			form_codepostal.focus();
			form_codepostal.style.backgroundColor='#FFBFC1';
			return false;
		} else {
			form_codepostal.style.backgroundColor='';
		}
	
		if(form_grande_ville.value == ''){
			alert('Merci de sélectionner une grande ville');
			form_grande_ville.focus();
			form_grande_ville.style.backgroundColor='#FFBFC1';
			return false;
		} else {
			form_grande_ville.style.backgroundColor='';
		}
	}

	if(form_ville.value == ''){
		alert('Merci de sélectionner une ville');
		form_ville.focus();
		form_ville.style.backgroundColor='#FFBFC1';
		return false;
	} else {
		form_ville.style.backgroundColor='';
	}
		
	if(form_villenord.value == '' && form_villepicard.value == ''){
		alert('Merci de sélectionner une ville au Nord à laquelle vous êtes attachée');
		form_villenord.focus();
		form_villenord.style.backgroundColor='#FFBFC1';
		return false;
	}
	else {
		form_villenord.style.backgroundColor='';
		form_villepicard.style.backgroundColor='';
	}	

	if(form_villenord.value != '' && form_villepicard.value != ''){
		alert('Merci de sélectionner une ville du Nord-Pas-de-Calais ou de Picardie à laquelle vous êtes attachée');
		form_villenord.focus();
		form_villenord.style.backgroundColor='#FFBFC1';
		form_villepicard.style.backgroundColor='#FFBFC1';
		return false;
	}
	
	if(form_accept.checked == false){
		alert('Merci d\'accepter les conditions d\'utilisation');
		form_accept.focus();
		form_accept.style.backgroundColor='#FFBFC1';
		return false;
	} else {
		form_accept.style.backgroundColor='';
	}
	
	document.getElementById('form1').submit();
	return true;
	
}



//+++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++
//							 				CHECK FORM FUNCTIONS
//+++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++

function checkForm(){

	if(form_pseudo.value==''){
		alert('Merci de remplir le pseudo');
		form_pseudo.focus();
		form_pseudo.style.backgroundColor='#FFBFC1';
		return false;
	} else {
		if(form_pseudo.value.length < 5 || form_pseudo.value.length > 25) {
			alert("Votre pseudo doit être composé de 5 à 25 caractères");
			form_pseudo.focus();
			form_pseudo.style.backgroundColor='#FFBFC1';
			return false;
		} else {
			form_pseudo.style.backgroundColor='';
		}
	}
	
	if(form_mdp.value==''){
		alert('Merci de remplir le mot de passe');
		form_mdp.focus();
		form_mdp.style.backgroundColor='#FFBFC1';
		return false;
	} else {
		if(form_mdp.value.length < 4 || form_mdp.value.length > 15) {
			alert("Votre mot de passe doit être composé de 4 à 15 caractères");
			form_mdp.focus();
			form_mdp.style.backgroundColor='#FFBFC1';
			return false;
		} else {
			form_mdp.style.backgroundColor='';
		}
	}

	if(form_mdp.value != form_mdp2.value){
		alert('Confirmation de mot de passe incorrecte');
		form_mdp2.focus();
		form_mdp2.style.backgroundColor='#FFBFC1';
		form_mdp.style.backgroundColor='#FFBFC1';
		return false;
	} else {
		form_mdp2.style.backgroundColor='';
		form_mdp.style.backgroundColor='';
	}

	if(!isEmail(form_email)){
		alert('Merci de remplir un email valide');
		form_email.focus();
		form_email.style.backgroundColor='#FFBFC1';
		return false;
	}
	else {
		form_email	.style.backgroundColor='';
	}

	if(!form_pays || form_pays.value == ''){
		alert('Merci de sélectionner un pays');
		form_pays.focus();
		form_pays.style.backgroundColor='#FFBFC1';
		return false;
	}
	else {
		form_pays.style.backgroundColor='';
	}
	
	
	if(form_pays.value == 'france'){
		if(form_region.value == ''){
			alert('Merci de sélectionner une région');
			form_region.focus();
			form_region.style.backgroundColor='#FFBFC1';
			return false;
		} else {
			form_region.style.backgroundColor='';
		}

		if(form_departement.value == ''){
			alert('Merci de sélectionner un département');
			form_departement.focus();
			form_departement.style.backgroundColor='#FFBFC1';
			return false;
		} else {
			form_departement.style.backgroundColor='';
		}
	
		if(form_codepostal.value == ''){
			alert('Merci de sélectionner un code postal');
			form_codepostal.focus();
			form_codepostal.style.backgroundColor='#FFBFC1';
			return false;
		} else {
			form_codepostal.style.backgroundColor='';
		}
	
		if(form_grande_ville.value == ''){
			alert('Merci de sélectionner une grande ville');
			form_grande_ville.focus();
			form_grande_ville.style.backgroundColor='#FFBFC1';
			return false;
		} else {
			form_grande_ville.style.backgroundColor='';
		}
	}

	if(form_ville.value == ''){
		alert('Merci de sélectionner une ville');
		form_ville.focus();
		form_ville.style.backgroundColor='#FFBFC1';
		return false;
	} else {
		form_ville.style.backgroundColor='';
	}
			
	if(form_villenord.value == '' && form_villepicard.value == ''){
		alert('Merci de sélectionner une ville au Nord à laquelle vous êtes attachée');
		form_villenord.focus();
		form_villenord.style.backgroundColor='#FFBFC1';
		return false;
	}
	else {
		form_villenord.style.backgroundColor='';
		form_villepicard.style.backgroundColor='';
	}	

	if(form_villenord.value != '' && form_villepicard.value != ''){
		alert('Merci de sélectionner une ville du Nord-Pas-de-Calais ou de Picardie à laquelle vous êtes attachée');
		form_villenord.focus();
		form_villenord.style.backgroundColor='#FFBFC1';
		form_villepicard.style.backgroundColor='#FFBFC1';
		return false;
	}
	
	form_activite1V = form_activite1.value;
	form_activite2V = form_activite2.value;
	form_activite3V = form_activite3.value;
	if(form_activite2V!= '' || form_activite3V != ''){
		if( ((form_activite1V == form_activite2V) && (form_activite1V != "" || form_activite2V != "")) || ((form_activite1V == form_activite3V) && (form_activite1V != "" || form_activite3V != "")) || ((form_activite3V == form_activite2V) && (form_activite3V != "" || form_activite2V != ""))){
			alert('Les activités ne peuvent pas être identiques');
			form_activite1.style.backgroundColor='#FFBFC1';
			form_activite2.style.backgroundColor='#FFBFC1';
			form_activite3.style.backgroundColor='#FFBFC1';
			return false;
		}
	}
	form_activite1.style.backgroundColor='';
	form_activite2.style.backgroundColor='';
	form_activite3.style.backgroundColor='';
	
	if(form_accept.checked == false){
		alert('Merci d\'accepter les conditions d\'utilisation');
		form_accept.focus();
		form_accept.style.backgroundColor='#FFBFC1';
		return false;
	}
	else {
		form_accept.style.backgroundColor='';
	}
	
	document.getElementById('form1').submit();
	return true;
	
}
