<!--
function CreerMenu(profondeur, titre1, titre2, titre3, titre4) {
	this.nb = 0; 
	this.prof = profondeur;
	this.titre1 = titre1;
	this.titre2 = titre2;
	this.titre3 = titre3;
	this.titre4 = titre4;
	this.Add = AddObjet;
	this.AffOne = Aff_One_Menu;
}
function AddObjet(deep, txt, sId) {
	var rub = new Object;
	rub.deep = deep;
	rub.txt = txt;
	if (sId == "") // si pas d'id spécifié alors prends le text comme valeur
		rub.id = txt;
	else
		rub.id = sId;
	this[this.nb] = rub;
	this.nb ++;
}
function Aff_One_Menu( iMenu ) {
	var Z, ii; 
	var el = document.forms['ff'].elements["list" + iMenu];
	el.options.length = 0;			
	el.options[0] = new Option(this.titre1);
	ii = 1 ;

	if(iMenu == 1) {		
		for (var i = 0; i < this.nb; i++) {
			var t = this[i].txt;
			if (this[i].deep == 1) {							
				if(t != this.titre1) { // valeur != default alors new option					
					el.options[ii] = new Option(t, i);
					el.options[ii].value += "*" + this[i].id; //t;
					if(document.forms['ff'].sellist[0].value == this[i].id) el.selectedIndex = ii;
					ii++;
				}
			}
		}
	}
	else {
		el = document.forms['ff'].elements["list" + iMenu];
		el.options.length = 0;	
		el.options[0] = new Option(eval("menu.titre" + iMenu));
		el.selectedIndex = 0;
	}
}
function add() { document.forms['ff'].elements["list"].options[0] = new Option("ADD", "", true, true); }
function Clic(no) {
	var val = document.forms['ff'].elements["list" + no].options[document.forms['ff'].elements["list" + no].selectedIndex].value;	
	val = val.substring(0, val.indexOf('*'));
	if (val != "" && val != null && no < menu.prof) {
		var deep = menu[val].deep;
		var no2 = 1;
		for (var noX = (no + 1); noX <= menu.prof; noX++) {
			var el = document.forms['ff'].elements["list" + noX];
			el.options.length = 0;			
			el.options[0] = new Option(eval("menu.titre" + noX));
			el.selectedIndex = 0;
		}
		val++;		
		for (var i = val; i < menu.nb; i++) {
			var m = menu[i].txt;
			if(m != eval("menu.titre" + (no + 1))) // valeur != default alors new option			
				if (menu[i].deep == deep + 1) { 
					var el = document.forms['ff'].elements["list" + (no + 1)];					
					el.options[no2] = new Option(m, i);
					el.options[no2].value += "*" + menu[i].id; //+ m;
					if(document.forms['ff'].sellist[no].value == menu[i].id) el.selectedIndex = no2;
					no2++;
				} else  if (menu[i].deep == deep) i = menu.nb;		
		}
		Clic(no + 1);
		val--;
	} else {
		if (val == "" || val == null) { // réinitialise select
			for (var noX = (no + 1); noX <= menu.prof; noX++) {
				var el = document.forms['ff'].elements["list" + noX];
				el.options.length = 0;			
				el.options[0] = new Option(eval("menu.titre" + noX));
				el.selectedIndex = 0;
			}
		}	
	}
}
// -->