// Toggles the display of the element with the given id
function toggle(id) {
  var elem = document.getElementById(id);
  if(elem.style.display != 'none') {
    elem.style.display = 'none';
  } else {
    elem.style.display = '';
  }
}