// JavaScript Document

    var intCount = 0;
    
    //-Donnée du menu
    function DataMenu(nb)
    {
    if (nb=="1")
            {divID=menu.addParent("QU'EST-CE QUE L'AGREPI");}
    else
            {menu.addParent("QU'EST-CE QUE L'AGREPI");}
			menu.addChild("37 ans d'AGREPI","PRE_37ANSDAGREPI.htm");
			menu.addChild("L'Agrément aujourd'hui et demain","PRE_Agrement.htm");
			menu.addChild("Qui Sont les Agrépistes","PRE_LesAgrepistes.htm");
		
    if (nb=="2")
            {divID=menu.addParent("ORGANISATION");}
    else
            {menu.addParent("ORGANISATION");}
		menu.addChild("Conseil d'administration","ORG_Bureau.htm");
			menu.addChild("Groupes Régionaux","ORG_GroupesRegionaux.htm");
			menu.addChild("Statuts","ORG_Statuts.htm");
			menu.addChild("Règlement Intérieur","ORG_ReglementInterieur.htm");
	
    if (nb=="3")
            {divID=menu.addParent("ACTIVITES");}
    else
            {menu.addParent("ACTIVITES");}
		  menu.addChild("Commissions Techniques","ACT_CommissionsTechniques.htm");
			menu.addChild("Commission Emploi", "ACT_CommissionEmploi.htm");
			menu.addChild("Accords", "ACT_Accords.htm");
			menu.addChild("Chartes", "ACT_Chartes.htm");

    if (nb=="4")
            {divID=menu.addParent("TRAVAUX EN COURS");}
    else
            {menu.addParent("TRAVAUX EN COURS");}
		  menu.addChild("A lire sans attendre","ACT_travaux_en_cours.htm#alire");
			menu.addChild("Groupes de travail", "ACT_travaux_en_cours.htm#grptravail");
			menu.addChild("Etudes es cours", "ACT_travaux_en_cours.htm#etudesencours");
		
		menu.addParent2("COMMUNICATION", "ACT_Communication.htm");
    
    if (nb=="6")
            {divID=menu.addParent("EVENEMENTS");}
    else
            {menu.addParent("EVENEMENTS");}
			menu.addChild("Manifestations et événements incontournables","EVN_EvenementsIncontournables.htm");
			
    if (nb=="7")
            {divID=menu.addParent("LE JOURNAL");}
    else
            {menu.addParent("LE JOURNAL");}
		menu.addChild("Télécharger le dernier numéro","NEWS_Telechargement.htm");

    if (nb=="8")
            {divID=menu.addParent("EXPRIMEZ-VOUS");}
    else
            {menu.addParent("EXPRIMEZ-VOUS");}
			menu.addChild("Participer au forum","EXPParticipez_au_FORUM.htm");

    if (nb=="9")
            {divID=menu.addParent("DOCUMENTS");}
    else
            {menu.addParent("DOCUMENTS");}
			menu.addChild("Consulter","DOC_consulter.htm");
			menu.addChild("Télécharger","DOC_telecharger.htm");
			

		menu.addParent2("CONTACT","CTCT_Message.htm");
    }

    //-Fonction de création de menu dynamique------------------------- 
    function DynamicMenu() 
		{
        var id = "Menu" + intCount++;
        document.write('<DIV Id="' + id + '"></DIV>');
    
        this.div = document.getElementById(id);
        this.currentChild = null;
    
        this.addParent = DynamicMenu_addParent;
        this.addParent2 = DynamicMenu_addParent2;
        this.addChild = DynamicMenu_addChild;
    }

		//-Fonction d'ajout d'entrées principales-------------------------
    function DynamicMenu_addParent(strName) 
		{
        var strID = 'ID' + intCount++; 
    
        var strTemp = '<DIV ID="' + strID + '" CLASS="parent"';
        strTemp += ' onClick="expandCollapse(this);">';
        strTemp += '<IMG SRC="images/left.gif" Height="12">';
        strTemp += '&nbsp;' + strName ;
        strTemp += '<DIV STYLE="display: none" CLASS="child"></DIV>';
        strTemp += '</DIV>';
    
        this.div.innerHTML += strTemp;
        this.currentChild = document.getElementById(strID);
		return strID;
    }

		//-Fonction d'ajout d'entrées principales avec liens seul----
    function DynamicMenu_addParent2(strName,lien) 
		{
        var strID = 'ID' + intCount++; 
    
        var strTemp = '<DIV ID="' + strID + '" CLASS="parent"';
        strTemp += ' onClick="document.location=\'' + lien + '\';">';
        strTemp += '<IMG SRC="images/left.gif" Height="12">';
        strTemp += '&nbsp;' + strName ;
        strTemp += '<DIV STYLE="display: none" CLASS="child"></DIV>';
        strTemp += '</DIV>';
    
        this.div.innerHTML += strTemp;
        this.currentChild = document.getElementById(strID);
		return strID;
    }

		//-Fonction d'ajout de liens dans le menu-------------------------
    function DynamicMenu_addChild(strName,strURL) 
		{
        	var strTemp ='';
					
				if (strURL.length==0)
				{
				 	 var strID = 'ID' + intCount++;	
				 	 strTemp = '<DIV ID="' + strID + '" CLASS="parent" align="left"';
					strTemp += ' onClick="expandCollapse(this);">';
					strTemp += '<IMG SRC="images/left.gif" Height="12">';
					strTemp += '&nbsp;' + strName ;
					strTemp += '<DIV STYLE="display: none" CLASS="child"></DIV>';
					strTemp += '</DIV>';
					if (document.all) {
						this.currentChild.children[1].innerHTML += strTemp;
					} else {
						this.currentChild.childNodes[2].innerHTML += strTemp;
					}
					this.currentChild = document.getElementById(strID);
					
				}
				else
				{
					strTemp= '<A HREF="' + strURL + '"'
							  + ' onClick="cancelBubble(arguments[0]);">' 
							  + strName + '</A><BR>';
				
					if (document.all) 
					{
						this.currentChild.children[1].innerHTML += strTemp;
					}
					else 
					{
						this.currentChild.childNodes[2].innerHTML += strTemp;
					}
    			}
   		}

		//-inhibe la cascade d'évènements au DIV conteneur----------------
		function cancelBubble(netEvent) 
		{
        if (document.all) {
            window.event.cancelBubble = true;
        } else {
            netEvent.cancelBubble = true;
        }
    }
		
		//-Contracte ou expanse le menu-----------------------------------
    function expandCollapse(objElement) {
        if (document.all) {
            var imgIcon = objElement.children[0];
            objElement = objElement.children[1];
        } else {
            var imgIcon = objElement.childNodes[0];
            objElement = objElement.childNodes[2];
        }    
    
        if (objElement.style.display == "none") {  
            objElement.style.display = "block" ;
            imgIcon.src = "images/bottom.gif" ;
        } else {
            objElement.style.display = "none" ;
            imgIcon.src = "images/left.gif" ;
        }
				if (document.all) {
            window.event.cancelBubble = true;
        } else {
            netEvent.cancelBubble = true;
        }
    }

    function Initialise(objElement) {
        if (document.all) {
            var imgIcon = objElement.children[0];
            objElement = objElement.children[1];
        } else {
            var imgIcon = objElement.childNodes[0];
            objElement = objElement.childNodes[2];
        }    
    
        if (objElement.style.display == "none") {  
            objElement.style.display = "block" ;
            imgIcon.src = "images/bottom.gif" ;
        } else {
            objElement.style.display = "none" ;
            imgIcon.src = "images/left.gif" ;
        }
    }
 "none") {  
            objElement.style.display = "block" ;
            imgIcon.src = "images/bottom.gif" ;
        } else {
            objElement.style.display = "none" ;
            imgIcon.src = "images/left.gif" ;
        }
    }
