
		var t_menu = new Array();
		var liste_menu = new Array();
		var extention = ".bmp";
		var chemin = "menu/";
		
		function dessus(cell){
			//cell.bgColor = "#FFFFFF";
		}
		function partir(cell){
			//cell.bgColor = cell.parentNode.parentNode.parentNode.bgColor;
		}
		
		function reduire(cell){
		//réduit le menu déroulant si on quitte sur le menu
			var id_menu = cell.id;
			t_menu[id_menu].ouvrir = -1;
		}
		
		function developper(cell){
		//dévellope le menu déroulant si on passe sur le menu
			var id_menu = cell.id;
			t_menu[id_menu].ouvrir = 1;
			if  ((t_menu[id_menu].type_menu == 1) || (t_menu[id_menu].type_menu == 2))
				document.getElementById("basongelet_" + id_menu).style.display = "block";
		}
		
		function reduire2(cell){
		//réduit le menu déroulant si on quitte sur le menu déroulant
			var id_menu = cell.id.substring(6, cell.id.length);
			t_menu[id_menu].ouvrir = -1;
		}
		
		function developper2(cell){
		//devellope le menu déroulant si on passe sur le menu déroulant
			var id_menu = cell.id.substring(6, cell.id.length);
			t_menu[id_menu].ouvrir = 1;
 //     document.write("<TABLE WIDTH='100%' HEiGHT='100%'><TR><TD>" + t_menu[id_menu].ouvrir + "</TD></TR></TABLE>");
			if  ((t_menu[id_menu].type_menu == 1) || (t_menu[id_menu].type_menu == 2))
				document.getElementById("basongelet_" + id_menu).style.display = "block";
		}

		function reduire3(cell){
		//réduit le menu déroulant si on quitte sur l'ombre sous le menu
			var id_menu = cell.id.substring(11, cell.id.length);
			t_menu[id_menu].ouvrir = -1;
		}
		
		function developper3(cell){
		//devellope le menu déroulant si on passe sur l'ombre sous le menu
			var id_menu = cell.id.substring(11, cell.id.length);
			t_menu[id_menu].ouvrir = 1;
			if  ((t_menu[id_menu].type_menu == 1) || (t_menu[id_menu].type_menu == 2))
				document.getElementById("basongelet_" + id_menu).style.display = "block";
		}
		
		function affmenu(){
		
		for (a=0 ; a<liste_menu.length ; a++)
		{
			var idmenu = liste_menu[a];
			//si on ouvre le menu et qu'il n'est pas complètement déroulé
			//ou si on l'enroule et qu'il n'est pas complètement enroulé alors on fait bouger le menu déroulant
			if ((t_menu[idmenu].ouvrir == 1)&&(t_menu[idmenu].nbrvar < t_menu[idmenu].nbrvarmax))
			{
	                        t_menu[idmenu].ypos_menu += t_menu[idmenu].vary;
	                        t_menu[idmenu].xpos_menu += t_menu[idmenu].varx;
				document.getElementById(idmenu).style.left = t_menu[idmenu].xpos_menu + "px";
				document.getElementById(idmenu).style.top =  t_menu[idmenu].ypos_menu + "px";
				t_menu[idmenu].nbrvar += 1;
			}
			if ((t_menu[idmenu].ouvrir == -1)&&(t_menu[idmenu].nbrvar > 0))
			{
	                        t_menu[idmenu].ypos_menu -= t_menu[idmenu].vary;
	                        t_menu[idmenu].xpos_menu -= t_menu[idmenu].varx;
				document.getElementById(idmenu).style.top = t_menu[idmenu].ypos_menu + "px";
				document.getElementById(idmenu).style.left = t_menu[idmenu].xpos_menu + "px";
				t_menu[idmenu].nbrvar -= 1;
			}
			if ((t_menu[idmenu].nbrvar >= t_menu[idmenu].nbrvarmax)&&(t_menu[idmenu].ouvrir == 1))
			{//completement développé
				t_menu[idmenu].ouvrir = 0;
				t_menu[idmenu].nbrvar = t_menu[idmenu].nbrvarmax;
			}
			if ((t_menu[idmenu].nbrvar <= 0)&&(t_menu[idmenu].ouvrir == -1))
			{//complètement réduit
				t_menu[idmenu].ouvrir = 0;
				t_menu[idmenu].nbrvar = 0;
				document.getElementById("basongelet_" + idmenu).style.display = "none";
			}
		}
		}
		
		
		
		
		
		function menu(nom, larg, haut, x, y, type_menu, larg_m, haut_m, x_m, y_m, varx, vary, nbrvmax, url){
			var strtemp;
    					
    		if ((type_menu == 1)||(type_menu == 3))
			{// si le menu à créer se déroule vers le bas
      			//crée le menu
      			strtemp = '<DIV id="princ_' + nom + '" STYLE="position: absolute; left:' + x + '; top:' + y + '; width:' + larg + '; height:' + haut + '; z-index:4" onmouseover="developper2(this);" onmouseout="reduire2(this);">';;
				strtemp += '<table border="0" cellpadding="0" cellspacing="0" style="border-collapse: collapse" id="tab_princ' + nom + '" width="100%" height="100%">';
				strtemp += '<tr><td width="10" background="'+chemin+'bord_haut_7'+extention+'">&nbsp;</td>';
        		strtemp += '<TD bgcolor="#8BBFB8" align="center"><b>';
        		strtemp += '<font face="Arial" size="2" color="#FFFFFF">';
        		if (url == "")
        			strtemp += nom;
        		else
        			strtemp += '<a href="' + url + '" style="text-decoration: none">' + nom + '</a>';
        		strtemp += '</font></b></TD>';
        		strtemp += '<td width="10" background="'+chemin+'bord_haut_3'+extention+'">&nbsp;</td></tr><tr>';
        		strtemp += '<td background="'+chemin+'bord_haut_6'+extention+'"><font size="1">&nbsp;</font></td>';
        		strtemp += '<td background="'+chemin+'bord_haut_5'+extention+'" height="17"><font size="1">&nbsp;</font></td>'
        		strtemp += '<td background="'+chemin+'bord_haut_4'+extention+'"><font size="1">&nbsp;</font></td></tr></table>';
    			strtemp += '<TR><TD></TD></TR></TABLE></DIV>'
    			document.write(strtemp);
    			
				//crée le menu déroulant
				strtemp = '<DIV id="' + nom + '" STYLE="position: absolute; left:' + x_m + 'px; top:' + y_m + 'px; width:' + larg_m + '; height:' + haut_m + '; z-index:3" onmouseover="developper(this);" onmouseout="reduire(this);">';
				strtemp += '<table border="0" cellpadding="0" cellspacing="0" style="border-collapse: collapse" id="tab_' + nom + '" width="100%" height="100%">';
				strtemp += '<tr height="100%"><td background="'+chemin+'onguelet_haut_7'+extention+'" width="16"></td><td bgcolor="#8BBFB8"></td>';
				strtemp += '<td  background="'+chemin+'onguelet_haut_3'+extention+'" width="15"></td></tr>';
				for (a=1 ; a<=menu.arguments.length-14 ; a=a+2)
				{
					strtemp += '<tr ><td background="'+chemin+'onguelet_haut_7'+extention+'" width="16"></td>';
					strtemp += '<td bgcolor="#8BBFB8" align="center"><b><font face="Arial" size="2" color="#FFFFFF">'
					strtemp += '<a href="' + menu.arguments[13 + a + 1] + '" style="text-decoration: none">' + menu.arguments[13 + a] + '</a>';
					strtemp += '</font></b></td><td background="'+chemin+'onguelet_haut_3'+extention+'" width="15"></td></tr>';
				}
				strtemp += '<tr><td background="'+chemin+'onguelet_haut_6'+extention+'"><font size="1">&nbsp;</font></td>';
				strtemp += '<td background="'+chemin+'onguelet_haut_5'+extention+'" height="17"><font size="1">&nbsp;</font></td>';
      			strtemp += '<td background="'+chemin+'onguelet_haut_4'+extention+'"><font size="1">&nbsp;</font></td></tr></table>';
      			strtemp += '<TR><TD></TD></TR></TABLE></DIV>'
      			document.write(strtemp);
    			
    			//crée l'ombre sous le menu
                        strtemp = '<DIV id="basongelet_' + nom + '" style="position: absolute; left: ' + (x_m+1) + 'px; top: ' + (y+haut-7)+ '; width:' + (larg_m-3) + 'px; height:7px;z-index: 5;display: none;" onmouseover="developper3(this);" onmouseout="reduire3(this);">';
strtemp += '<TABLE  border="0" cellpadding="0" cellspacing="0" style="border-collapse: collapse" width="100%" height="100%">';

    	//		strtemp = '<TABLE border="0" cellpadding="0" cellspacing="0" style="position: absolute; left: ' + (x_m+1) + 'px; top: ' + (y+haut-7)+ '; border-collapse: collapse; z-index: 5;display: none" width="' + (larg_m-3) + 'px" id="basongelet_' + nom + '" height="7px" onmouseover="developper3(this);" onmouseout="reduire3(this);">';
				strtemp += '<tr><td width="12" background="'+chemin+'ombre_onguelet_haut_1'+extention+'">';
				strtemp += '<span style="font-size: 2pt">&nbsp;</span></td>';
				strtemp += '<td background="'+chemin+'ombre_onguelet_haut_2'+extention+'"><span style="font-size: 2pt">&nbsp;</span></td>';
				strtemp += '<td width="9" background="'+chemin+'ombre_onguelet_haut_3'+extention+'">';
				strtemp += '<span style="font-size: 2pt">&nbsp;</span></td></tr></TABLE></DIV>';
    			document.write(strtemp);

			}
			else
			if ((type_menu == 2)||(type_menu == 4))
			{//si le menu à créer se déroule vers la gauche
      		//crée le menu
      			strtemp = '<DIV id="princ_' + nom + '" STYLE="position: absolute; left:' + x + '; top:' + y + '; width:' + larg + '; height:' + haut + '; z-index:4" onmouseover="developper2(this);" onmouseout="reduire2(this);">';
				strtemp += '<table border="0" cellpadding="0" cellspacing="0" style="border-collapse: collapse" id="tab_princ' + nom + '" width="100%" height="100%">';
				strtemp += '<tr><td background="'+chemin+'bord_gauche_1'+extention+'"><span style="font-size: 1">&nbsp;</span></td>';
				strtemp += '<td width="13" height="4" background="'+chemin+'bord_gauche_2'+extention+'"><span style="font-size: 1">&nbsp;</span></td></tr>';
        		strtemp += '<tr><td bgcolor="#8BBFB8" align="center" height="100%"><b>';
        		strtemp += '<font face="Arial" size="2" color="#FFFFFF">';
        		if (url == "")
        			strtemp += nom;
        		else
        			strtemp += '<a href="' + url + '" style="text-decoration: none">' + nom + '</a>';
			strtemp += '</font></b></td>';
        		strtemp += '<td width="13" background="'+chemin+'bord_gauche_3'+extention+'">&nbsp;</td></tr>';
        		strtemp += '<tr><td background="'+chemin+'bord_gauche_5'+extention+'"><span style="font-size: 1">&nbsp;</span></td>';
        		strtemp += '<td background="'+chemin+'bord_gauche_4'+extention+'" width="13" height="4"><span style="font-size: 1">&nbsp;</span></td></tr></table>';
    			strtemp += '<TR><TD></TD></TR></TABLE></DIV>'
    			document.write(strtemp);
    			
				//crée le menu déroulant
				strtemp = '<DIV id="' + nom + '" STYLE="position: absolute; left: ' + x_m + 'px; top: ' + y_m + 'px; width:' + larg_m + '; height:' + (haut_m+5) + '; z-index:3" onmouseover="developper(this);" onmouseout="reduire(this);">';
				strtemp += '<table border="0" cellpadding="0" cellspacing="0" style="border-collapse: collapse" id="tab_' + nom + '" width="100%" height="100%">';
				strtemp += '<tr><td background="'+chemin+'onguelet_gauche_1'+extention+'"></td>';
				strtemp += '<td background="'+chemin+'onguelet_gauche_2'+extention+'" height="14" width="20"></td></tr>';
				for (a=1 ; a<=menu.arguments.length-14 ; a=a+2)
				{
					strtemp += '<td bgcolor="#8BBFB8" align="right"><b><font face="Arial" size="2" color="#FFFFFF">'
					strtemp += '<a href="' + menu.arguments[13 + a + 1] + '" style="text-decoration: none">' + menu.arguments[13 + a] + '</a>';
					strtemp += '</font></b></td><td background="'+chemin+'onguelet_gauche_3'+extention+'"></td></tr>';
				}
				strtemp += '<td background="'+chemin+'onguelet_gauche_5'+extention+'"><font size="1">&nbsp;</font></td>';
				strtemp += '<td background="'+chemin+'onguelet_gauche_4'+extention+'" height="13"><font size="1">&nbsp;</font></td></tr></table>';
      			strtemp += '<TR><TD></TD></TR></TABLE></DIV>'
      			document.write(strtemp);
    			
    			//crée l'ombre sous le menu
                        strtemp = '<DIV id="basongelet_' + nom + '" style="position: absolute; left: ' +  (x+larg-7) + 'px; top: ' + (y_m+1)+ '; width:7px; height:' + (haut_m+4) + 'px;z-index: 5;display: none;" onmouseover="developper3(this);" onmouseout="reduire3(this);">';
strtemp += '<TABLE  border="0" cellpadding="0" cellspacing="0" style="border-collapse: collapse" width="100%" height="100%">';

    		//	strtemp = '<TABLE border="0" cellpadding="0" cellspacing="0" style="position: absolute; left: ' + (x+larg-7) + 'px; top: ' + (y_m+1)+ '; border-collapse: collapse; z-index: 5;display: none" width="7" id="basongelet_' + nom + '" height="' + (haut_m+4) + '" onmouseover="developper3(this);" onmouseout="reduire3(this);">';
				strtemp += '<tr><td height="11" background="'+chemin+'ombre_onguelet_gauche_1'+extention+'">';
				strtemp += '<span style="font-size: 2pt">&nbsp;</span></td></tr>';
				strtemp += '<tr><td background="'+chemin+'ombre_onguelet_gauche_2'+extention+'"><span style="font-size: 2pt">&nbsp;</span></td></tr>';
				strtemp += '<tr><td height="11" background="'+chemin+'ombre_onguelet_gauche_3'+extention+'">';
				strtemp += '<span style="font-size: 2pt">&nbsp;</span></td></tr></TABLE></DIV>';
    			document.write(strtemp);
			}
			
			this.nom = nom;
			this.largeur = larg;
			this.hauteur = haut;
			this.xpos = x;
			this.ypos = y;
			this.type_menu = type_menu;
			this.largeur_menu = larg_m;
			this.hauteur_menu = haut_m;
			this.xpos_menu = x_m;
			this.ypos_menu = y_m;
			this.varx = varx;
			this.vary = vary;
			this.nbrvar = 0;
			this.nbrvarmax = nbrvmax;
			this.ouvrir = 0;
			
			liste_menu.push(nom);

		}
function show_props(obj,obj_name){
  var result="";
  for(var i in obj)
    result+= obj_name+"."+i+" = "+
             obj[i]+"\n";
  return result;
}

