rem: var panels = document.getElementsByClassName("category_panel"); for(var i=0; i<panels.length; i++) { var fullId = panels[i].id; var index = fullId.lastIndexOf('_'); var catId = fullId.substring(0, index); hideCategory(catId); }  function chooserModeChanged() { var radioPanel = document.getElementById("viewchoiceRadioPanel"); var radioButtons = radioPanel.getElementsByTagName("input"); for(var i=0; i<radioButtons.length; i++) { if(radioButtons[i].type == "radio") { var panelId  = "module_table_" + radioButtons[i].value; var panel = document.getElementById(panelId); if(radioButtons[i].checked && panel != null) { Element.show(panel); } else { Element.hide(panel); } } } }  function toggleExpansionState( categoryIdentifier) { var id= "expansion_state_" + categoryIdentifier; var hiddenField = document.getElementById(id); hiddenField.value = (hiddenField.value == "true" ? "false" : "true"); }  } 
add: var panels = document.getElementsByClassName("category_panel"); for(var i=0; i<panels.length; i++) { var fullId = panels[i].id; var index = fullId.lastIndexOf('_'); var catId = fullId.substring(0, index); hideCategory(catId); } } 
context: 	function closeAll() {      var panels = document.getElementsByClassName("category_panel");      for(var i=0; i<panels.length; i++) {        var fullId = panels[i].id;        var index = fullId.lastIndexOf('_');        var catId = fullId.substring(0, index);        hideCategory(catId);      }            function chooserModeChanged() {	          var radioPanel = document.getElementById("viewchoiceRadioPanel");        var radioButtons = radioPanel.getElementsByTagName("input");        for(var i=0; i<radioButtons.length; i++) {          if(radioButtons[i].type == "radio") {            var panelId  = "module_table_" + radioButtons[i].value;            var panel = document.getElementById(panelId);            if(radioButtons[i].checked && panel != null) {              Element.show(panel);            }            else {              Element.hide(panel);            }        }      }    }        function toggleExpansionState( categoryIdentifier)    {      var id= "expansion_state_" + categoryIdentifier;      var hiddenField = document.getElementById(id);      hiddenField.value = (hiddenField.value == "true" ? "false" : "true");    }		}
meta: 9897	/local1/tlutelli/issta_data/temp/all_js/javascript/2006_temp/2006/9897/aa3cfe0355bb63a18f28f853c13d4daf996b9768/collapsiblePanel.js/buggy/website/js/collapsiblePanel.js