  var buttons = new Array();
  var btnList = new Array(new Array("Accueil", 50, 180, 250, "Default.aspx"),
        new Array("Diaporamas & Vid&eacute;os", 50, 180, 250, "Diaporamas_Videos.aspx"),
        new Array("Blog", 50, 180, 250, "Blog.aspx"),
        new Array("Le programme MSP", 50, 180, 250, "http://www.microsoft.com/france/etudiants/student-partners/default.aspx"),
        new Array("Contact", 50, 180, 250, "Contact.aspx"));
  
  function menuInit() {
      if (!ActiveXObject)
          return;
            barreMenu.innerHTML = "";
            for (var i = 1; i <= btnList.length; i++) {
                barreMenu.innerHTML += '<div style="position: relative;float:left;"><div class="bg" id="divf'+i+'"></div><div class="txt" id="divs'+i+'"><a class="lien" href="'+btnList[i-1][4]+'">'+btnList[i-1][0]+'</a></div></div>';
            }

            var curl = window.location.href;
            for (var i = 1; i <= btnList.length; i++) {
                if (curl.indexOf(btnList[i - 1][4]) != -1 || (i==1 && curl.indexOf('/',8)==curl.length-1))
                    buttons[i - 1] = new button("divf" + i, "divs" + i, i - 1, 50,180,250, true);
                else
                    buttons[i - 1] = new button("divf" + i, "divs" + i, i - 1, btnList[i - 1][1], btnList[i - 1][2], btnList[i - 1][3], false);
            }
        }

        function button(obj1, obj2, nb, r, g, b, fixed) {
            this.fixed = fixed;
            this.obj1 = document.getElementById(obj1);
            this.obj2 = document.getElementById(obj2);

          //  this.obj1.filters[0].addAmbient(200, 20, 255, 15);
            this.obj1.filters[0].addAmbient(30, 100, 255, 25);
            if(fixed)
                this.obj1.filters[0].addPoint(100, 90, 80, r, g, b, 100);
            else
                this.obj1.filters[0].addPoint(-100, -100, 0, r, g, b, 100);

            if (!fixed) {
                this.obj2.attachEvent("onmousemove", function() { mousehandler(nb); });
                this.obj2.attachEvent("onmouseout", function() { unlight(nb); });
                this.obj2.attachEvent("onmouseover", function() { enlight(nb); });
            }
            
            this.val = 0;
            this.animating = 0;
            this.t = null;
            this.lock = false;

        }


        function mousehandler(nb) {
            var o = buttons[nb];
            if (o.fixed)
                return;
            if (o.lock)
                return;
            x = window.event.x - o.obj1.offsetLeft;
            o.lock = true;
            setTimeout("doUnlock(" + nb + ")", 30);
            var o = buttons[nb];
            if (o.val < 100) {
                enlight(nb, true);
            }
            o.obj1.filters[0].movelight(1, x, 90, 80, true);
            
        }


        function doUnlock(nb) {

            var o = buttons[nb];
            o.lock = false;
        }
        
        function unlight(nb, c) {
            var o = buttons[nb];
            clearTimeout(o.t);
            if (o.animating == 1 && !c)
                return;

            if (o.val > 0) {
                o.val = 0;
                o.obj1.filters[0].changeStrength(1, o.val, true);
             //   o.animating = 1;
            //    o.t = setTimeout("unlight('" + nb + "',true)", 50);
            }
            else {
                o.val = 0;
                o.animating = 0;
            }

        }
        function enlight(nb, c) {
            var o = buttons[nb];
            clearTimeout(o.t);
            if (o.animating == 2 && !c)
                return;
            if (o.val < 100) {
                o.val = 100;
                o.obj1.filters[0].changeStrength(1, o.val, true);
              //  o.animating = 2;
             //   o.t = setTimeout("enlight('" + nb + "',true)", 20);
            }
            else {
                o.animating = 0;
                o.val = 100;
            }
        }

