function expand() { document.getElementById("bar").style.height = "100%"; }
function collapse() { document.getElementById("bar").style.height = "0px"; }
function myFunction() {
    if (document.getElementById('bar').clientHeight == 0) { expand(); }
    else { collapse(); }
}