function hide_all_divs(max_ids){ for(x=1;x<=max_ids;x++){ document.getElementById("data_body_" + x).style.display = "none"; document.getElementById("data_cat_" + x).className = "col_cat"; } } function collapse_features(div_id){ hide_all_divs(27); document.getElementById("data_body_" + div_id).style.display = "block"; document.getElementById("data_cat_" + div_id).className = "col_cat_down"; }