	function Deplacer(l1,l2) {
		
		for (var i=0;i<l1.options.length;i++)
		{
			if(l1.options[i].selected)
			{	
				
				// vérifier qu'il n'existe pas déjà
				var trouve=false;
				for (j=0;j<l2.options.length;j++)
				{
					if (l2.options[j].value==l1.options[i].value)
						trouve=true;
				}
				if (!trouve)
				{  
					o=new Option(l1.options[i].text,l1.options[i].value);
					l2.options[l2.options.length]=o;
				}

			}	
		}
	}
	
	function Supprimer(list,list2) {
		if (list.options.selectedIndex>=0){
			temp_champ=list.options.value;
			list.options[list.options.selectedIndex]=null;
			for (var i=0;i<list2.options.length;i++)
			{
				if(list2.options[i].value==temp_champ)
				{
						list2.options[i].selected=null;
				}
			}		
			
		} else {
			alert("Suppression impossible : aucune ligne sélectionnée");
		}
	
}

	function Monter(l) {
		var indice=l.selectedIndex
		if (indice<0) {
			alert("Aucune ligne n'est sélectionnée");
		}
		if (indice>0) {	// Il reste une ligne au-dessus
			tjs_swap(l,indice,indice-1);
		}
	}
	
	function Descendre(l) {
		var indice=l.selectedIndex
		if (indice<0) {
			alert("Aucune ligne n'est sélectionnée");
		}
		if (indice<l.options.length-1) {	// Il reste une ligne en-dessous
			tjs_swap(l,indice,indice+1);
		}
	}


	function tjs_swap(l,i,j) {
		var valeur=l.options[i].value;
		var texte=l.options[i].text;
		l.options[i].value=l.options[j].value;
		l.options[i].text=l.options[j].text;
		l.options[j].value=valeur;
		l.options[j].text =texte;
		l.selectedIndex=j
	}
	
	function Valider_ordre_champs(l,c,cv)
	{ 		
		var i =0;
		for(i=0;i<l.options.length;i++){
			l.options[i].selected=true;
		}
		c.value=cv;
		
	}
	

	
	function Valider_libelle(f){
		if(f.label.value==""){
			alert("Vous devez renseigner un libellé pour ce champ");
			return false;
		}else{
			f.choix.value="modifier"
			f.submit();
		}
	}
