
function show_navigation_items(show_item) {
    show_item = show_item === undefined ? true : false;
    K.getv(".depthchoice").forEach(function (o) {
        //K.visible(o, "hide");
        K.get(o).hidden = !show_item;
    });
    ["textshow", "next", "previous", "fit", "linkshow"].forEach(function (o) {
        K.get("#"+o).hidden = !show_item;
    });
}


function get_height(name) {
    let div = K.get(name);
    let result = 0;
    if (div !== null) {
        result = K.height(div);
    }
    return result;
}

function frame_resize() {
    let nav = K.get("#nav");
    let nav_height = (nav ? get_height(nav) : 0);
    let content_height = window.innerHeight
        - get_height("#title") - nav_height - get_height("#status") + 1;
    K.height("#middle", content_height);
}



window.addEventListener("load", function (event) {
    window.addEventListener("resize", function (e) {
        frame_resize();
    });

    frame_resize();
    if (typeof resize_toc === "function") resize_toc(true);
    
    //let endspace_height = "calc(110% - " + K.height("#title")
    //    + " - " + K.height("#nav") + ")";
    //K.style(".endspace", "height", endspace_height);

});
