Well, Ajax needs JavaScript as well
Yes, users who disabled JavaScript would in fact be locked out, as the initial view would have the CSS attribute hidden (the workaround we use in coppermine's config by having it unhidden by default and hide it with the use of JavaScript onload would cause an unwanted visual effects). As a workaround, two options seem possible: have the blocks that are suppossed to be unexpanded in the first place twice: once inside the regular HTML code (with all the JavaScript triggers) and one within a <noscript> section.
Second option would be to store a flag in the cookie that "tells" the script if the user has enabled or disabled JavaScript and generate the output accordingly. Subsequently, on a first visit, the sub-cats would be expanded and a JavaScript detection script would run and write the results into a cookie. Subsequent page visits would be looking into the cookie and create the output as it sees fit.
Here's some pseudo code for option one:
<script type="text/javascript">
function expand(section) {
document.getElementById(section).style.display = 'block';
}
</script>
[...]
<div>
Parent category markup that is suppossed to show no matter what
<script type="text/javascript">
// only write the expand link into the document if JavaScript is turned on to avoid non-JavaScript users from being confused
document.write("<a href=\"javascript:expand('subcat1');\">expand subcategory</a>");
</script>
</div>
<div name="subcat1" id="subcat1" style="display:none">
Child category markup
</div>
<noscript>
<div>
Child category markup
</div>
</noscript>