
            function calculateCollapsibleContentHeights() {
                var allHeights = 0;
                
                var contents = document.getElementsByClassName("content");
                var j, h;

                for (j = 0; j < contents.length; j++) {
                  h = contents[j].scrollHeight;
                  allHeights += h;
                }
                
                var coll = document.getElementsByClassName("content-collapsible");
                var i;

                for (i = 0; i < coll.length; i++) {
                    coll[i].addEventListener("click", function() {
                      this.classList.toggle("expanded");
                      var content = this.nextElementSibling;
                      if (content.style.maxHeight == allHeights + "px"){
                        content.style.maxHeight = "0px";
                      } else {
                        content.style.maxHeight = allHeights + "px";
                      }
                  });
                }
            }
