function nl2br(texte){
	return texte.replace(/\n/g,"<br />\n");
}

function html_entities(text){
	var taille = text.length ;
	var res = '' ;
	var s_chars = Array(34,39,38,60,62,8482,338,339,352,353,376,710,732,8194,8195,8364);//pour ceux qui ne sont pas consécutifs.
	for( var i = 0 ;i < taille ; i++){
		var cc ;
		var spe = false ;
		
		cc= text.charCodeAt(i);
		c = text.charAt(i);
		for(var j = 0 ; j< s_chars.length;j++){
			if(cc==s_chars[i])
				spe = true ;
		}
		
		if(cc<=255 && cc>=160)
			spe = true ;
			
		if(cc<=8201 && cc>=8250)
			spe = true ;
		
		if(spe ==true)
			s='&#'+cc+';';
		else s = c ;
		
		res +=s ;
	}
	
	return res ;
}


function is_entier(val){
	re = new RegExp(/^\d+$/);
	return re.exec(val)!=null ;
}
//définition des méthodes de Champ
//donne la valeur d'un champ
function Champ_getVal(){
//	alert(this.prefixe+" "+this.nom);
if(document.getElementsByName(this.prefixe+'['+this.nom+']').item(0) != null)
	return document.getElementsByName(this.prefixe+'['+this.nom+']').item(0).value ;
}

//affecte la valeur d'un champ
function Champ_setVal(val){
	if(document.getElementsByName(this.prefixe+'['+this.nom+']') != null)
	if(document.getElementsByName(this.prefixe+'['+this.nom+']').length!=0)
		document.getElementsByName(this.prefixe+'['+this.nom+']').item(0).value = val ;
}

function Champ_init(){
	this.setVal(this.init_val);
}

//return true si le champ est vide sinon false
function Champ_vide(){
	return this.getVal() == '' ;
}

function Champ_controler(){
	if( (!this.etre_vide)&&this.vide() ){
		this.erreur = 'est vide' ;
		return false ;
	}	
	return true ;
}

//une classe champs le champs qui correspond est prefix[nom] nom_user est le nom affiché à l'utilisateur. Exemple: 'civilite' pour nom (pas accent ni majuscules) 'Civilité' pour nom_user
function Champ( nom , nom_user){
	this.prefixe = '' ;
	this.nom = nom ;
	this.nom_user = nom_user;
	
	this.erreur = '' ; // ce sera une partie du message d'erreur, ils auron la forme Le champ 'nom_user' est 'erreur' . (notez que le point est rajouté pas besoin de le mettre dans erreur mais vous devrez mettre le "est ou "n'est pas"
	this.errone = false ;//on ne s'en sert pas à l'interieur de la classe mais ca peut servir si on diffère le contrôle d'erreur de l'affichage
	
	this.init_val ='' ;//valeur initiale du champs (quand on charge la page)
	this.etre_vide = true ;//si oui ou non le champs peut être vide
	
	//on initialise les méthodes
	this.getVal = Champ_getVal ;
	this.setVal = Champ_setVal ;
	this.init = Champ_init ;
	this.vide = Champ_vide ;
	
	this.controler = Champ_controler ;
}












function ChampEntier_controler(){
	if(!this.Champ_controler() )//la méthode mère est appelée 
		return false ;
		
	if(  is_entier(this.getVal()) && !this.vide()){//est-ce un entier ?
		var val = parseInt( this.getVal(),10 ) ;
		
		if(this.min < this.max ){//y'a-t-il une limite ?
			if(val<this.min){
				this.erreur = 'est inferieur à  ' + this.min ;
				return false ;
			}
			
			if (val>this.max){
				this.erreur = 'est superieur à  ' + this.max ;
				return false ;
			}
			//on est bon
			return true ;
		}
		else return true ;//si pas de limites on retourne true
	}
	else{
		this.erreur = "n'est pas un nombre"
		return false ;
	}
}


//les champs pour les entiers entiers
function ChampEntier(nom,nom_user){

	//on hérite de champ ;
	this.Champ = Champ ;
	this.Champ(nom,nom_user) ;
	
	this.min = 0;
	this.max = -1 ;
	//si on ne veut pas controler les valeurs on met min>max
	
	this.Champ_controler = this.controler ;
	this.controler = ChampEntier_controler ;
	
}










function ChampChaine_controler(){	
	if(!this.Champ_controler())//la méthode mère est appelée 
		return false ;
	if(!this.vide()){
		//on controle la taille
	if( this.min>0)//il y a une limte su la taille minimum
		if( this.getVal().length < this.min){//la chaine est trop petite
				this.erreur = 'est trop court' ;
				return false ;
		}
	
		if( this.max>0)//il y a une limte su la taille maximun
			if( this.getVal().length > this.max){//la chaine est trop grande
				this.erreur = 'est trop long' ;
				return false ;
		}
			
		//la chaine est correcte 
		return true ;
	}
	else
		return true ;
}

//les champs pour les chaines
function ChampChaine(nom,nom_user){
	//on hérite de champ ;
	this.Champ = Champ ;
	this.Champ(nom,nom_user) ;
	
	this.min = 0;
	this.max = 0 ;
	//si on ne veut pas controler les valeurs on met 0
	
	this.Champ_controler = this.controler ;
	this.controler = ChampChaine_controler ;
}


function findPosY(obj) {
	var curleft = curtop = 0;
	if (obj.offsetParent) {
		curleft = obj.offsetLeft
		curtop = obj.offsetTop
		while (obj = obj.offsetParent) {
			curleft += obj.offsetLeft
			curtop += obj.offsetTop
		}
	}

	return curtop ;

	//return curleft;
	//si on cherche le même mais pour x c'est pas bien dur
}


//une classe formulaire qui peut controller les champs mettre les valeurs dedans ...
function Formulaire_addChamp(champ){
	champ.prefixe = this.prefixe ;
	this.champs.push(champ) ;
}

function Formulaire_init(){
	var nb_champs = this.champs.length ;
	for(var i =0; i<nb_champs ; i++){
		this.champs[i].init();
	}
}

function Formulaire_controler(){
	var nb_champs = this.champs.length ;
	
	this.no_erreur = true ;
	this.messages = '' ;
	
	for(var i=0 ; i<nb_champs ; i++){
		var champ = this.champs[i];
		//alert(champ.nom);//c'est pour débuger
		if(! champ.controler()){
			this.no_erreur = false ;
			champ.errone = true ;
		}
		else champ.errone = false ;
	}
	
	return this.no_erreur ;
}

function Formulaire_getErreurTxt(){
	var nb_champs = this.champs.length ;
	var message = '' ;
	for(var i=0 ; i<nb_champs ; i++){
		var champ = this.champs[i];
		if(champ.errone){
			message +='Le champ \''+champ.nom_user +'\' '+ champ.erreur +'.\n' ;
		}
	}
	
	message += this.messages ;
	
	return message ;
}

function Formulaire_getChamp(nom){
	var nb_champs = this.champs.length ;
	for(var i =0; i<nb_champs ; i++){
		if(this.champs[i].nom == nom)
			return this.champs[i];
	}
}

function Formulaire_submit(){
	if(this.controler()){
		this.soumettre();
	}
	else{
		var msg = 'Attention :\n' + this.getErreurTxt() ;
		if(this.utiliser_messagebox){
			alert(msg) ;
		}
		else{
			var span = document.getElementById('formulaire_erreur');
			span.innerHTML = nl2br(html_entities(msg));
			alert ('Attention il y a des erreurs !');
			//finalement ca va être en haut de page
			window.scrollTo(0,0);
			//on scroll sur le <span id="formulaire_erreur"
			/*
			var posy;
			posy=findPosY(span);
			window.scrollTo(0,posy);
			*/
		}
	}
}

function Formulaire_soumettre(){
	clearInputConnection(getByName('connection[password]'),'******');
	document.getElementById('champ_action').value = this.action ;
	document.getElementById('formulairePrincipal').submit() ;
}

function Formulaire(action,prefixe){

	this.action = action ;
	this.prefixe =prefixe ;
	this.no_erreur = false ;//true si il n'y a pas d'erreur
	this.messages = '' ;
	this.champs = Array() ;
	this.utiliser_messagebox = false ;
	
	//les méthodes
	this.addChamp = Formulaire_addChamp ;
	this.init = Formulaire_init ;
	this.controler = Formulaire_controler ;
	this.getErreurTxt = Formulaire_getErreurTxt ;
	this.getChamp = Formulaire_getChamp ;
	this.soumettre = Formulaire_soumettre ;
	this.submit = Formulaire_submit ;
	
}


function Liste_controler(){
	return true ;
}

function Liste_getVal(){
	if(document.getElementsByName(this.prefixe+'['+this.nom+']').length==0)
		alert(this.prefixe+ " "+this.nom+" Erreur!");
	var box = document.getElementsByName(this.prefixe+'['+this.nom+']').item(0) ;
	if(box.selectedIndex >= 0 && box.selectedIndex < box.options.length)
		return box.options[box.selectedIndex].value ;
	else
		return null;
}

function Liste_setVal(val){
	//alert(this.prefixe+ " "+this.nom+" = "+val);
	if(val == 0 )
		val="0";

	var box = document.getElementsByName(this.prefixe+'['+this.nom+']').item(0) ;
	var nu_index = -1;
	if(box != null)
	{
		var text = "val : "+val+"\n" ;
		for(var i = 0 ; i < box.length ; i++ ){
			box.options[i].selected=false ;
			text += i+" : "+box.options[i].value+"\n";
			if(box.options[i].value==val )
				nu_index = i ;
		}

		text+="nu_index : "+nu_index+"\n";
		//alert(text);

		if(nu_index>=0){
			box.selectedIndex=nu_index ;
			box.options[nu_index].selected=true ;
			box.value=box.options[nu_index].value ;
		}
	}
	
}

function Liste(nom,nom_user){
	this.Champ = Champ ;
	this.Champ(nom,nom_user);
	
	this.Champ_controler = this.controler ;
	this.contoler = Liste_controler ;
	
	this.getVal = Liste_getVal ;
	this.setVal = Liste_setVal ;
	
}



function ListeMultiple_controler(){
	return true ;
}

function ListeMultiple_getVal(){
	var box = document.getElementsByName(this.prefixe+'_'+this.nom+'[]').item(0) ;
	
	var res = Array();
	if(box!=null){
		for(var i = 0 ; i < box.options.length ; i++ ){
			if(box.options[i].selected)
				 res.push(box.options[i].value );
		}
	}

	return res ;
}

function valueInArray(value,the_array){
	for(var i = 0 ; i < the_array.length ; i++ ){
		if(the_array[i]==value)
			return true ;
	}
	return false ;
}

function ListeMultiple_setVal(val){
	var box = document.getElementsByName(this.prefixe+'_'+this.nom+'[]').item(0) ;
	
	if(box!=null){
		for(var i = 0 ; i < box.options.length ; i++ ){
			box.options[i].selected = valueInArray(box.options[i].value,val);
		}
	}
}

function ListeMultiple(nom,nom_user){
	this.Champ = Champ ;
	this.Champ(nom,nom_user);
	
	this.Champ_controler = this.controler ;
	this.contoler = ListeMultiple_controler ;
	
	this.getVal = ListeMultiple_getVal ;
	this.setVal = ListeMultiple_setVal ;
	
}


function RadioButton_getVal(){
	var liste = document.getElementsByName(this.prefixe+'['+this.nom+']') ;

	if(liste != null)
	{
		for(var i = 0 ; i< liste.length ; i++ ){
			if(liste[i].checked )
				return liste[i].value ;
		}
	}
	
	return '' ;
}

function RadioButton_setVal(val){
	var liste = document.getElementsByName(this.prefixe+'['+this.nom+']') ;
	if(liste != null)
	{
		for(var i = 0 ; i< liste.length ; i++ ){
			if(liste[i].value==val)
				liste[i].checked = "checked" ;
			else liste[i].checked = null ;
		}
	}
}

function RadioButton(nom,nom_user){

	//on hérite de champ ;
	this.Champ = Champ ;
	this.Champ(nom,nom_user) ;
	
	this.Champ_getVal = this.getVal ;
	this.Champ_setVal = this.setVal ;
	this.getVal = RadioButton_getVal ;
	this.setVal = RadioButton_setVal ;
	
}


function CheckBox_setVal(val){
	//alert(this.prefixe+ "[" +this.nom+"]="+val);
	//_alert(document.getElementsByName(this.prefixe+'['+this.nom+']').item(0));
	if(document.getElementsByName(this.prefixe+'['+this.nom+']').item(0) != null)
	{
		if(val == true || val == 'on' )
			document.getElementsByName(this.prefixe+'['+this.nom+']').item(0).checked = true ;
		else document.getElementsByName(this.prefixe+'['+this.nom+']').item(0).checked = false ;
	}
}

function CheckBox_getVal(){
	if(document.getElementsByName(this.prefixe+'['+this.nom+']').item(0) != null)
	{
		if(document.getElementsByName(this.prefixe+'['+this.nom+']').item(0).checked)
			return 'on';
	}
		return '' ;
}

function CheckBox(nom,nom_user){

	//on hérite de champ
	this.Champ = Champ ;
	this.Champ(nom,nom_user) ;
	
	//on redéfini setVal()
	this.Champ_setVal = this.setVal ;
	this.setVal = CheckBox_setVal;
	
	//et set val 
	this.Champ_getVal = this.getVal ;
	this.getVal = CheckBox_getVal;
}


function changerEtatDivTotal(){
	var div = document.getElementById("div_adhesion_total") ;
	var input = document.getElementsByName("adhesion[accepte]")[0];

	if(!input.checked){
		div.style.display = 'none' ;
	}else div.style.display = 'block' ;

	
}



function switcher_img(nom_check_box,nom_img){
	if(document.getElementsByName(nom_check_box)[0].checked){
		var imgs = document.getElementsByName(nom_img);
		for(var i =0 ; i< imgs.length ; i++ ){
			imgs[i].src='gfx/oui.png';
		}
	}else{
		var imgs = document.getElementsByName(nom_img);
		for(var i =0 ; i< imgs.length ; i++ ){
			imgs[i].src='gfx/non.png';
		}
		
	}
}


function switcher_img_v2(nom_check_box,class_td){
	$('.' + class_td).each( function(i)
	{
		if(document.getElementsByName(nom_check_box)[0].checked)
		{
			$(this).removeClass('pictoRougeTableauDevenirMembre');
			$(this).addClass('pictoVertTableauDevenirMembre');
		}
		else
		{
			$(this).removeClass('pictoVertTableauDevenirMembre');
			$(this).addClass('pictoRougeTableauDevenirMembre');
		}	
	});
}

function switcherImg(checkbox, img)
{
	chk=$('#'+checkbox).get(0);

	if(chk.checked)
		chk.checked = false;
	else
		chk.checked = true;

	if(chk.checked)
		img.src = '/_gfx/pictoVertTableauDevenirMembre.gif';
	else
		img.src = '/_gfx/pictoRougeTableauDevenirMembre.gif';
}

function calculerSomme(){
	var somme = 0 ;
	
	if(document.getElementsByName('adhesion[adhesion_base]')[0].checked)
		somme+=39;


	//le module de candidature spontane
	if(document.getElementsByName('adhesion[mod_candidature]')[0].checked)
		somme+=9;
	
	//le module cadre export
	if(document.getElementsByName('adhesion[mod_cadre_export]')[0].checked)
		somme+=9;
	
	return somme ;
}

function recalculerTotal(){
	var somme = calculerSomme() , reduc = 0; 

	//maintenant on calcul la rÃ©duction
	var code = document.getElementsByName('adhesion[code_reduction]')[0].value ;
	reduc = parseFloat(getReduction(code,somme));

	if(reduc > 0){
		somme-=reduc ;
		document.getElementById('adhesion_reduction').innerHTML = '( reduction comprise )';
	}
	else document.getElementById('adhesion_reduction').innerHTML = '' ;
	
	document.getElementById('adhesion_somme_totale').innerHTML = ''+somme.toFixed(2).replace('.',',') ;
}


function recalculerTotalNew(){
	var somme = calculerSomme() , reduc = 0; 

	//maintenant on calcul la rÃ©duction
	var code = document.getElementsByName('adhesion[code_reduction]')[0].value ;
	reduc = parseFloat(getReduction(code,somme));

	if(reduc > 0){
		somme-=reduc ;
		document.getElementById('adhesion_reduction').innerHTML = '( reduction comprise )';
	}
	else document.getElementById('adhesion_reduction').innerHTML = '' ;

	var p2x = document.getElementsByName('adhesion[p2x]')[0].checked ;
	if(p2x)
	{
		sommeDiv = somme / 2;
		document.getElementById('adhesion_somme_totale').innerHTML = ''+sommeDiv.toFixed(2).replace('.',',') ;
		document.getElementById('adhesion_somme_paiement1').innerHTML = ''+sommeDiv.toFixed(2).replace('.',',') ;
		document.getElementById('adhesion_somme_paiement2').innerHTML = ''+sommeDiv.toFixed(2).replace('.',',') ;
		$('.adh_box_total_col2').css('padding-top', '5px');
		$('.adh_box_total_col2').css('height', '55px');
		$('.adh_price_details').show();
		$('#adh_price_x2').show();
	}
	else
	{
		document.getElementById('adhesion_somme_totale').innerHTML = ''+somme.toFixed(2).replace('.',',') ;
		$('.adh_box_total_col2').css('padding-top', '18px');
		$('.adh_box_total_col2').css('height', '44px');
		$('.adh_price_details').hide();
		$('#adh_price_x2').hide();
	}
}



function Formulaire_candidat_adhesion_controler(){
	var no_err = true ;

	if(!this.Formulaire_controler())
		no_err = false;
	
	var code = document.getElementsByName('adhesion[code_reduction]')[0].value ;
	var somme = calculerSomme();
	var reduc = getReduction(code,total);
	var total ;
	if(reduc>0)
		total = somme - reduc ;
	else
		total = somme ;

	if(reduc==-1 && code !=''){
		this.messages+="Le code de r&eacute;duction est incorrect !\n";
		no_err = false;
	}

	if(total==0){
		this.messages+="Vous n'avez coch&eacute; aucune case !\n";
		no_err = false;
	}
	
	var p2x =  document.getElementsByName('adhesion[p2x]')[0] ;

	if(total < 9  && p2x.checked ){
		this.messages+="Vous ne pouvez pas payer en plusieurs fois si le total est inf&eacute;rieur &agrave; "+9+" &euro; !\n";
		no_err = false;
		p2x.checked = false ;
	}
	
	/*
	if(reduc > 0  && p2x.checked ){
		this.messages+="Vous ne pouvez pas payer en plusieurs fois si vous b&eacute;n&eacute;ficiez d'une r&eacute;duction\n";
		no_err = false;
		p2x.checked = false ;
	}
	// */

	return no_err ;
}

function Formulaire_candidat_adhesion(action,prefixe){

	//on hÃ©rite de formulaire
	this.Formulaire = Formulaire ;
	this.Formulaire(action,prefixe) ;

	
	this.Formulaire_controler = this.controler ;
	this.controler = Formulaire_candidat_adhesion_controler;
}	

function getReduction(id,total){	
	var xhr_object = null; 
 
	if(window.XMLHttpRequest) // Firefox 
	   xhr_object = new XMLHttpRequest(); 
	else if(window.ActiveXObject) // Internet Explorer 
	   xhr_object = new ActiveXObject("Microsoft.XMLHTTP"); 
	else { // XMLHttpRequest non supportÃ© par le navigateur 
	   return -2 ; 
	} 
 	var url = "reduction.php?id="+id+"&total="+total ;

	xhr_object.open("GET", url, false); 
	xhr_object.send(null); 
	if(xhr_object.readyState == 4){
		var elem = xhr_object.responseXML.getElementsByTagName('reduction').item(0) ;
		var total_calc = elem.firstChild.data ;
		return total_calc ;
	}
	else return -3 ;
}
function setValeurPourActionSuivante(action,action_suivante){
	document.getElementById('champ_action').value=action;
	document.getElementById('champ_action_suivante').value=action_suivante;
	document.getElementById('formulairePrincipal').submit();
}
function ItemList_add(item){
	this.la_liste.push(item);
}

function ItemList_del(item){
	var n = this.index(item);
	if(n!=-1)
		this.la_liste.splice(n,1);
}

function ItemList_index(item){
	for( i = 0 ; i < this.la_liste.length ; i++){
		if(this.la_liste[i]==item)
			return i ;
	}

	return -1 ;
}

function ItemList_swap(item){
	n = this.index(item) ;
	if(n!=-1)
		this.la_liste.splice(n,1);
	else this.add(item);
}

function ItemList_contains(item){
	if(this.index(item)!= -1)
		return true ;
	else return false ;
}

function ItemList_dump(){
	var contenu = "" ;
	var premier = true ;
	for( i = 0 ; i < this.la_liste.length ; i++){
		if(premier)
			premier=false ;
		else contenu += this.sep ;
		contenu += + this.la_liste[i] ;
	}
	return contenu ;
}


function ItemList(){
	this.la_liste = new Array();
	this.index = ItemList_index ;
	this.add = ItemList_add ;
	this.del = ItemList_del ;
	this.contains = ItemList_contains ;
	this.dump = ItemList_dump ;
	this.swap = ItemList_swap ;
}

function SizeLimit_taille_du_texte(){
	return document.getElementById(this.id_champ).value.length ;
}

function SizeLimit_tronquer(){
	var str ;
	str = document.getElementById(this.id_champ).value ;

	if(str.length > this.len)
		document.getElementById(this.id_champ).value = str.substring(0,this.len) ;
	}

function SizeLimit_texte_modif(){
	document.getElementById(this.id_txt).innerHTML = '' + ( this.len - this.taille_du_texte() ) ;
	this.tronquer();
}

function SizeLimit(id_champ,id_txt,len){
	this.id_champ = id_champ ;
	this.id_txt = id_txt ;
	this.len = len ;
	this.taille_du_texte = SizeLimit_taille_du_texte ;
	this.tronquer = SizeLimit_tronquer ;
	this.texte_modif = SizeLimit_texte_modif ;
}
var f_connection = new Formulaire('connection','connection');
f_connection.utiliser_messagebox = true;
f_connection.addChamp(new ChampChaine('login','Login') );
f_connection.getChamp('login').etre_vide=false;
f_connection.getChamp('login').min=0;
f_connection.getChamp('login').max=0;

f_connection.addChamp(new ChampChaine('password','Mot de passe') );
f_connection.getChamp('password').etre_vide=false;
f_connection.getChamp('password').min=3;
f_connection.getChamp('password').max=0;


var f_candidat_recherche_offre = new Formulaire('candidat_faire_recherche_offre','recherche_offre');
f_candidat_recherche_offre.utiliser_messagebox = false;
f_candidat_recherche_offre.addChamp(new CheckBox('cherche_emploi','Recherche un emploi') );

f_candidat_recherche_offre.addChamp(new CheckBox('cherche_stage','Recherche un stage') );

f_candidat_recherche_offre.addChamp(new CheckBox('cherche_vie','Recherche un VIE') );

f_candidat_recherche_offre.addChamp(new Liste('langue1','Première langue') );
f_candidat_recherche_offre.getChamp('langue1').etre_vide=false;

f_candidat_recherche_offre.addChamp(new Liste('langue2','Seconde langue') );
f_candidat_recherche_offre.getChamp('langue2').etre_vide=false;

f_candidat_recherche_offre.addChamp(new ListeMultiple('region','Région') );
f_candidat_recherche_offre.getChamp('region').etre_vide=true;

f_candidat_recherche_offre.addChamp(new ListeMultiple('pays','Pays') );
f_candidat_recherche_offre.getChamp('pays').etre_vide=true;

f_candidat_recherche_offre.addChamp(new Champ('keywords','Mots Clef') );
f_candidat_recherche_offre.getChamp('keywords').etre_vide=true;

f_candidat_recherche_offre.addChamp(new Champ('date','Date de parution') );
f_candidat_recherche_offre.getChamp('date').etre_vide=true;


var f_etablissement_informations = new Formulaire('etablissement_ajouter_etablissement','etablissement');
f_etablissement_informations.utiliser_messagebox = false;
f_etablissement_informations.addChamp(new Champ('responsable_nom','Nom du contact') );
f_etablissement_informations.getChamp('responsable_nom').etre_vide=true;

f_etablissement_informations.addChamp(new Champ('responsable_fonction','Fonction du contact') );
f_etablissement_informations.getChamp('responsable_fonction').etre_vide=true;

f_etablissement_informations.addChamp(new Champ('responsable_tel','TÃ©lÃ©phone du contact') );
f_etablissement_informations.getChamp('responsable_tel').etre_vide=true;

f_etablissement_informations.addChamp(new Champ('responsable_mail','Email du responsable du compte') );
f_etablissement_informations.getChamp('responsable_mail').etre_vide=true;

f_etablissement_informations.addChamp(new Champ('responsable_mail_conf','Confirmez l\'Email du responsable') );
f_etablissement_informations.getChamp('responsable_mail_conf').etre_vide=true;

f_etablissement_informations.addChamp(new Champ('responsable_password','Mot de passe du responsable') );
f_etablissement_informations.getChamp('responsable_password').etre_vide=true;

f_etablissement_informations.addChamp(new Champ('responsable_password_conf','Confirmez le mot de passe du responsable') );
f_etablissement_informations.getChamp('responsable_password_conf').etre_vide=true;

f_etablissement_informations.addChamp(new Champ('etablissement_nom','Nom de l\'etablissement') );
f_etablissement_informations.getChamp('etablissement_nom').etre_vide=true;

f_etablissement_informations.addChamp(new Liste('etablissement_type','Type d\'etablissement') );
f_etablissement_informations.getChamp('etablissement_type').etre_vide=true;

f_etablissement_informations.addChamp(new Champ('etablissement_rue','adresse de l\'etablissement') );
f_etablissement_informations.getChamp('etablissement_rue').etre_vide=true;

f_etablissement_informations.addChamp(new Champ('etablissement_ville','ville de l\'etablissement') );
f_etablissement_informations.getChamp('etablissement_ville').etre_vide=true;

f_etablissement_informations.addChamp(new Champ('etablissement_cp','Code postal de l\'etablissement') );
f_etablissement_informations.getChamp('etablissement_cp').etre_vide=true;

f_etablissement_informations.addChamp(new Liste('etablissement_region','RÃ©gion de l\'etablissement') );
f_etablissement_informations.getChamp('etablissement_region').etre_vide=true;

f_etablissement_informations.addChamp(new Champ('etablissement_tel','TÃ©lÃ©phone de l\'etablissement') );
f_etablissement_informations.getChamp('etablissement_tel').etre_vide=true;

f_etablissement_informations.addChamp(new Champ('etablissement_mail','Email de l\'etablissement') );
f_etablissement_informations.getChamp('etablissement_mail').etre_vide=true;

f_etablissement_informations.addChamp(new Champ('etablissement_site','Site internet de l\'etablissement') );
f_etablissement_informations.getChamp('etablissement_site').etre_vide=true;

f_etablissement_informations.addChamp(new Champ('etablissement_mail_stages','Adresse mail pour les offres de stages.') );
f_etablissement_informations.getChamp('etablissement_mail_stages').etre_vide=true;

f_etablissement_informations.addChamp(new Champ('etablissement_description','Description de l\'etablissement') );
f_etablissement_informations.getChamp('etablissement_description').etre_vide=true;

f_etablissement_informations.addChamp(new RadioButton('newsletter','Newsletter') );
f_etablissement_informations.getChamp('newsletter').etre_vide=true;

f_etablissement_informations.addChamp(new RadioButton('newsletter_etablissement','Newsletter Ã©tablissement') );
f_etablissement_informations.getChamp('newsletter_etablissement').etre_vide=true;

f_etablissement_informations.addChamp(new Liste('responsable_civilite','CivilitÃ© du responsable') );
f_etablissement_informations.getChamp('responsable_civilite').etre_vide=true;



function initialiserLesChamps() {

f_connection.getChamp('login').init_val = 'E-mail';
f_connection.getChamp('password').init_val = '******';
f_connection.init();

f_candidat_recherche_offre.getChamp('cherche_emploi').init_val = false;
f_candidat_recherche_offre.getChamp('cherche_stage').init_val = false;
f_candidat_recherche_offre.getChamp('cherche_vie').init_val = false;
f_candidat_recherche_offre.getChamp('langue1').init_val = '';
f_candidat_recherche_offre.getChamp('langue2').init_val = '';
f_candidat_recherche_offre.getChamp('region').init_val = [0] ;
f_candidat_recherche_offre.getChamp('pays').init_val = [0] ;
f_candidat_recherche_offre.getChamp('keywords').init_val = 'Mots clés';
f_candidat_recherche_offre.getChamp('date').init_val = '';
f_candidat_recherche_offre.init();

f_etablissement_informations.getChamp('responsable_nom').init_val = 'Nom';
f_etablissement_informations.getChamp('responsable_fonction').init_val = 'Fonction';
f_etablissement_informations.getChamp('responsable_tel').init_val = '';
f_etablissement_informations.getChamp('responsable_mail').init_val = 'E-mail';
f_etablissement_informations.getChamp('responsable_mail_conf').init_val = '';
f_etablissement_informations.getChamp('responsable_password').init_val = 'Mot de Passe';
f_etablissement_informations.getChamp('responsable_password_conf').init_val = '';
f_etablissement_informations.getChamp('etablissement_nom').init_val = 'Nom de l\'établissement';
f_etablissement_informations.getChamp('etablissement_type').init_val = '';
f_etablissement_informations.getChamp('etablissement_rue').init_val = '';
f_etablissement_informations.getChamp('etablissement_ville').init_val = '';
f_etablissement_informations.getChamp('etablissement_cp').init_val = '';
f_etablissement_informations.getChamp('etablissement_region').init_val = '';
f_etablissement_informations.getChamp('etablissement_tel').init_val = '';
f_etablissement_informations.getChamp('etablissement_mail').init_val = '';
f_etablissement_informations.getChamp('etablissement_site').init_val = '';
f_etablissement_informations.getChamp('etablissement_mail_stages').init_val = '';
f_etablissement_informations.getChamp('etablissement_description').init_val = '';
f_etablissement_informations.getChamp('newsletter').init_val = '1';
f_etablissement_informations.getChamp('newsletter_etablissement').init_val = '1';
f_etablissement_informations.getChamp('responsable_civilite').init_val = '';
f_etablissement_informations.init();

}
