[jQuery] Accordion-Like Menu: Setting class on active Item

[jQuery] Accordion-Like Menu: Setting class on active Item


Hi
I tried to put together an easy accordion-like effect:
http://www.smartforce.ch/jquery/ShowHide.html
There is one problem: the selected-class will not be removed if all
items are closed (again). The class ".selected" should be removed if
no div is visible. How do I achieve this? "toggleClass" did not help
either.
Thank you very much for your help!