
function getInitMcHeight() {

         initMcHeight = document.getElementById("main_content").offsetHeight;

}


function sameHeightCols() {

         var menuBox = document.getElementById("menu_box");
         var mainContent = document.getElementById("main_content");
         var mainContentMiddle = document.getElementById("main_content_middle");
         var mainContentTop = document.getElementById("main_content_top");
         var mainContentBottom = document.getElementById("main_content_bottom");

         if  (menuBox.offsetHeight + 10  > initMcHeight) { /* hauteur menu + marge haut > hauteur contenu prinicpal */
             mainContentMiddle.style.height = menuBox.offsetHeight - mainContentTop.offsetHeight - mainContentBottom.offsetHeight - 6 +"px";
         }

}


if (window.addEventListener) {
   window.addEventListener("load", getInitMcHeight, false);
   window.addEventListener("load", sameHeightCols, false);
   window.addEventListener("resize", sameHeightCols, false);
}
else if (document.addEventListener) {
        document.addEventListener("load", getInitMcHeight, false);
        document.addEventListener("load", sameHeightCols, false);
        document.addEventListener("resize", sameHeightCols, false);
}
else if (window.attachEvent) {
        window.attachEvent("onload", sameHeightCols);
        window.attachEvent("onload", getInitMcHeight);
        window.attachEvent("onresize", sameHeightCols);
}




