function getWindowHeight() {
 var windowHeight = 0;
   if (typeof(window.innerHeight) == 'number') {
        windowHeight = window.innerHeight;
   }
        else {
          if (document.body && document.body.clientHeight) {
            windowHeight = document.body.clientHeight;
        }
        else {
          if (document.documentElement && document.documentElement.clientHeight) {
            windowHeight = document.documentElement.clientHeight;
          }
        }
   }
 return windowHeight;
}

function setFooter() {
  if (document.getElementById) {
     var windowHeight = getWindowHeight();
     if (windowHeight > 0) {
         var Menu = document.getElementById('menu');
         var Bloc = document.getElementById('bloc');
         var Mention = document.getElementById('mention');
         if ((windowHeight/2) - 180 >= 0) {
          if ((document.all) && (navigator.appVersion.indexOf("Mac",0)<0)) {
                Menu.style.position = 'absolute';
                Menu.style.top = (document.body.scrollTop + (windowHeight/2) - 130) + 'px';
                Bloc.style.position = 'absolute';
                Bloc.style.top = (document.body.scrollTop + (windowHeight/2) + 23) + 'px';
                Mention.style.position = 'relative';
                Mention.style.top = (document.body.scrollTop + windowHeight + 55) + 'px';
                }
          else {
                Menu.style.position = 'fixed';
                Menu.style.top = ((windowHeight/2) - 130) + 'px';
                Bloc.style.position = 'fixed';
                Bloc.style.top = ((windowHeight/2) + 23) + 'px';
                Mention.style.position = 'fixed';
                Mention.style.top = (windowHeight - 55) + 'px';
                }
         }
         else {
            Menu.style.position = 'static';
            Bloc.style.position = 'static';
            Mention.style.position = 'static';
         }
     }
  }
}
window.onload = function() {
        setFooter();
}
window.onresize = function() {
        setFooter();
}
window.onscroll = function() {
        setFooter();
}

