I have to apologize to you semibold: my reply was harsh.
I do stick to my point and I think Vaska makes it quite clear with its comment... javascript ain't something you pick up in an evening. I do understand your frustration but the only way you will achieve your goal is by, probably, just doing some very basic jquery tutorial and forget about your "ultimate goal" in order to master some basic techniques... You can't start running a marathon one day just because you feel like it... (man my analogy is weak...)
Or wait for us (any person from the community) to come back to that script and fix it...
Or you can become a hero and fix it for everyone...
The menu you're trying to achieve is not actually easily done. You need to be able to know that no sections have been activated (clicked) in order to be able to close all the menus, but keep track of the fact that the user has clicked a menu and keep it opened when the page is reloaded... the thing is, when a page is reloaded, the javascript variables are all reinitialized... no state persist. So you need to either make your menu state persist between pages (using PHP probably) or use something already provided by indexhibit in order to know that the menu is active. By default, indexhibit insert an "active" class in its menu, so the present script is using it to know which section needs to be open. The problem is that this "active state" is also present the first time you access the site; you get a default section opened... I'm not sure if this would work, but it might be worth trying...
1. create a new section.
2. configure it so that it doesn't display itself in the menu.
3. put your main page in it.
What I expect you would get is an all closed menu on the first access. When you click a menu, it will behave like you expect it.
If you provide a link to your top page, your menu will all be collapsed...
I hope this gives you enough pointers to get your thing going on.