var compteur_defil_menu;
var menuSup;
var position_cadre;

function init(menuId) {
	if (eval(menuId) > 1) {
		document.getElementById('menuNiveau' + eval(menuId-1)).style.marginLeft=6;
		document.getElementById('menuNiveau' + eval(menuId-1)).style.clip = "rect(0, 202, 100, 0)";
	}
	menuSup = document.getElementById('menuNiveau' + menuId);
	compteur_defil_menu = -202;
	position_cadre = 6;
}

function afficher(menuId){
	for(var j=2; j<=eval(menuId) ; j++) {
		document.getElementById('menuNiveau' + j).style.display="block";
	}
}

function defiler(){

		if (compteur_defil_menu <=position_cadre) {
			
			menuSup.style.marginLeft=compteur_defil_menu;
			menuSup.style.clip = "rect(0, 202, 100, " + -compteur_defil_menu + ")";
			compteur_defil_menu = compteur_defil_menu+5;
			setTimeout('defiler()',1);
		}
		else {
			menuSup.style.marginLeft = position_cadre;
			menuSup.style.clip = "rect(0, 202, 100, " + -position_cadre + ")";
		}
}
