[jQuery] Ok... so I've got this horizontal menu html... how to add "selected" class?

[jQuery] Ok... so I've got this horizontal menu html... how to add "selected" class?


Hi, all...
I'm dipping my toes into the water of horizontal menus for the first time.
I've got some same html I'm using for the menus, but now I need to be
able to dynamically change the "selected" class for the ul's and li's in
use.
<ul id="maintab">
<li class="selected"><a href="#">Home</a></li>
<li><a href="#">DHTML</a></li>
<li><a href="#">CSS</a></li>
<li><a href="#">Forums</a></li>
<li><a href="#">Gif Optimizer</a></li>
</ul>
<div id="tabcontent" class="clearfix">
<!--Sub Content #1 -->
<ul class="selected">
<li><a href="#">Home</a></li>
<li><a href="#">New</a></li>
<li><a href="#">Revised</a></li>
</ul>
I tried to come up with some jQ code to do it, but couldn't get anything to
work
(I'm not gonna show that mess, either ;o)
I know it's simple, but I can't get the syntax right.
Also, the example only show one sub-menu... how would the other sub-menu's
be targeted in the main menu?
Would someone lend a hand?
Rick