var G_chapters = new Array();
G_chapters [0] = 'specisme';
G_chapters [1] = 'changer';
G_chapters [2] = 'complement';
// G_chapters [3] = 'pub';
// G_chapters [4] = 'conclusion';

function hide (chapter) {

    if(document.getElementById( chapter )) {
        document.getElementById( chapter ).style.display = "none";
    }
}

function show (chapter) {

    if(document.getElementById( chapter )) {
        document.getElementById( chapter ).style.display = "block";
    }
}

function hideAllChapter () {

    window.scrollTo(0, 0);
    for (var iChapter in G_chapters) {
        hide(G_chapters[iChapter]);
    }
}

function toogleChapter (chapter) {

    if(document.getElementById( chapter )) {
        if(document.getElementById( chapter ).style.display != "block") {
            hideAllChapter();
            show( chapter );
        }
        else {
            hideAllChapter();
        }
    }
}

function toogleVisibility (divId) {

    if(document.getElementById( divId )) {
        if(document.getElementById( divId ).style.display != "block") {
            show( divId );
        }
        else {
            hide( divId );
        }
    }
}

