﻿function addLoadEvent(func) {
    if (func) {
        var oldonload = window.onload;
        if (typeof window.onload != 'function') {
            window.onload = func;
        } else {
            window.onload = function() {
                if (oldonload) {
                    oldonload();
                }
                func();
            }
        }
    }
}

function montre(id) {
    var d = document.getElementById(id);
    var dDiv = document.getElementById(id+'Div');
    if (d==null) {
	document.getElementById('theContent').style.zIndex = 10000; // Move content to foreground
    }
    
    for (var i = 0; i<=4; i++) {
        if (document.getElementById('smenu' + i)) {
            document.getElementById('smenu' + i).style.visibility = 'hidden';
            document.getElementById('smenu' + i + 'Div').style.height='0px';
        }
    }
    if (d) {
        dDiv.style.height='200px';
        d.style.visibility = 'visible';
        document.getElementById('theContent').style.zIndex = 1; // Move content to background
    }
}

//window.onload = montre;
addLoadEvent(montre);