
// affiche / masque le menu de connexion
function switchlogmenu() {
  var logpannel = document.getElementById( "logpannel" );
  if( logpannel.style.height === "auto" ) {
    logpannel.style.height = "18px";
  }
  else {
    logpannel.style.height = "auto";
    if( document.getElementById( "logmenuemail" ) ) {
      document.getElementById( "logmenuemail" ).focus();
    }
  }
}


// évènements communs à toutes les pages
addEvent( window , "load", function() {
  
  var i;
  
  for( i in document.getElementById( "mainmenubar" ).childNodes ) {
    
    addEvent( document.getElementById( "mainmenubar" ).childNodes[i], "mouseover", function() {
      if( this.className !== "active" ){ this.className = "over"; }
    });
    
    addEvent( document.getElementById( "mainmenubar" ).childNodes[i], "mousedown", function() {
      if( this.className !== "active" ){ this.className = "click"; }
    });
    
    addEvent( document.getElementById( "mainmenubar" ).childNodes[i], "mouseup", function() {
      if( this.className !== "active" ){ this.className = "over"; }
    });
    
    addEvent( document.getElementById( "mainmenubar" ).childNodes[i], "mouseout", function() {
      if( this.className !== "active" ){ this.className = ""; }
    });
  }
  
  addEvent( document.getElementById( "mainmenufirst" ), "mouseover", function() {
    if( this.className !== "active" ) {
      this.className = "over";
      document.getElementById( "mainmenuleftborder" ).className = "over";
    }
  });
  
  addEvent( document.getElementById( "mainmenufirst" ), "mousedown", function() {
    if( this.className !== "active" ) {
      this.className = "click";
      document.getElementById( "mainmenuleftborder" ).className = "click";
    }
  });
  
  addEvent( document.getElementById( "mainmenufirst" ), "mouseup", function() {
    if( this.className !== "active" ) {
      this.className = "over";
      document.getElementById( "mainmenuleftborder" ).className = "over";
    }
  });
  
  addEvent( document.getElementById( "mainmenufirst" ), "mouseout", function() {
    if( this.className !== "active" ) {
      this.className = "";
      document.getElementById( "mainmenuleftborder" ).className = "";
    }
  });
  
  addEvent( document.getElementById( "footerfacebook" ), "mouseover", function() {
    this.src = "/img/footer/facebookon.gif";
  });
  
  addEvent( document.getElementById( "footerfacebook" ), "mouseout", function() {
    this.src = "/img/footer/facebookoff.gif";
  });
  
  addEvent( document.getElementById( "footertwitter" ), "mouseover", function() {
    this.src = "/img/footer/twitteron.gif";
  });
  
  addEvent( document.getElementById( "footertwitter" ), "mouseout", function() {
    this.src = "/img/footer/twitteroff.gif";
  });
  
  addEvent( document.getElementById( "footerlinkedin" ), "mouseover", function() {
    this.src = "/img/footer/linkedinon.gif";
  });
  
  addEvent( document.getElementById( "footerlinkedin" ), "mouseout", function() {
    this.src = "/img/footer/linkedinoff.gif";
  });
  
  addEvent( document.getElementById( "footergoogle" ), "mouseover", function() {
    this.src = "/img/footer/googleon.gif";
  });
  
  addEvent( document.getElementById( "footergoogle" ), "mouseout", function() {
    this.src = "/img/footer/googleoff.gif";
  });
  
  if( document.getElementById( "pseudoinput" ) ) {
    
    addEvent( document.getElementById( "pseudoinput" ), "focus", function() {
      document.getElementById( "pseudonote" ).style.visibility = "visible";
    });
    
    addEvent( document.getElementById( "pseudoinput" ), "blur", function() {
      document.getElementById( "pseudonote" ).style.visibility = "hidden";
    });
  }
});


