﻿/*
 * Gestion du menu
  */
var adHiders = [false, false]; //Globale

var ryb = document.getElementById('ryb');
var bcList;
var bcTimeout;

if(ryb != null) {
 bcList = ryb.getElementsByTagName('ul')[0];

 ryb.onmouseover = function() {
  adHiders[1] = true;

  bcList.style.display = 'block';
 };

 ryb.onmouseout = function() {
  clearTimeout(bcTimeout);
  adHiders[1] = false;
  bcTimeout = setTimeout('if(!adHiders[1]) { bcList.style.display = "none"; } ', 700);
 };
}


var admin = document.getElementById('admin');
var ctList;
var ctTimeout;

if(admin != null) {
 ctList = admin.getElementsByTagName('ul')[0];

 admin.onmouseover = function() {
  adHiders[2] = true;
  ctList.style.display = 'block';
 };

 admin.onmouseout = function() {
  adHiders[2] = false;
  clearTimeout(ctTimeout);
  ctTimeout = setTimeout('if(!adHiders[2]) { ctList.style.display = "none"; }', 700);
 };
}


var contacts = document.getElementById('contacts');
var dtList;
var dtTimeout;

if(contacts != null) {
 dtList = contacts.getElementsByTagName('ul')[0];

 contacts.onmouseover = function() {
  adHiders[2] = true;
  dtList.style.display = 'block';
 };

 contacts.onmouseout = function() {
  adHiders[2] = false;
  clearTimeout(ctTimeout);
  dtTimeout = setTimeout('if(!adHiders[2]) { dtList.style.display = "none"; }', 700);
 };
}