//Lancement du script if(typeof Prototype == 'undefined') { throw('IdepTool_Menu : Veuillez importer la classe "Prototype"'); } if(typeof Scriptaculous == 'undefined') { throw('IdepTool_Menu : Veuillez importer la classe "Scriptaculous"'); } Event.observe(window, 'load', idepTool_MenuInit); function idepTool_MenuInit(){ new IdepToolMenu('menuLeft'); } //Début de la classe var IdepToolMenu = Class.create(); IdepToolMenu.prototype = { //Liste des variables var_MenuId : false, var_ClassEncours : 'rubrique_active', var_ClassTop : 'menuLeft', var_Current : false, var_CurrentStart : false, var_iBtn : 1, durationUp : 0.8, durationDown : 0.4, //Constructeur initialize : function(menu){ this.var_MenuId = menu; var arrayElt = $$('#' + this.var_MenuId + ' li a'); if(arrayElt.length){ arrayElt.each( this.initMenu.bind(this) ); this.initCurrentMenu(); } }, //Initialisation des liens initMenu : function(item, index){ var arrayAncetre = Element.ancestors(item); if(!arrayAncetre[1].hasAttribute('id') || arrayAncetre[1].getAttribute('id')!= this.var_MenuId){ if(parseInt(arrayAncetre[1].style.top) != '-6000' || this.var_MenuId != this.var_ClassTop){ new Element.hide(arrayAncetre[1]); var arrayChild = Element.childElements(arrayAncetre[2]); for(var i=0;i