function toggleSS(id, boo){
  if (document.getElementById(id)){
    document.getElementById(id).disabled = !boo;
  }
}
function toggleCodes(){
  toggleSS("hide-codes", this.checked);
}
function toggleExcerpts(){
  toggleSS("hide-excerpts", this.checked);
}
function toggleSummaries(){
  toggleSS("hide-summaries", this.checked);
}

function handleToggles(){
  document.getElementById("toggle-codes").onchange = toggleCodes; // handle the onchange event
  document.getElementById("toggle-excerpts").onchange = toggleExcerpts;
  document.getElementById("toggle-summaries").onchange = toggleSummaries;
}

window.onload = handleToggles;

