I'm trying to selectively color the background of the item selected. What am I missing in my sample code above?

I'm only trying to colorize 4 of the 10 menu options, and only one should be colorized at a time. They're in my dispatch table in the production code (not an array like the sample test above; I created that to try to isolate the problem).

The problem I've noticed, happens when you select a second-level citizen from the secondary menu. For example, if you click on docs and then click on faq from there, the relationship to 'docs' is no longer maintained, and you lose the purple "tab" that goes to 'docs'.

The first-level menu is generated dynamically, using an array and checking $action (coming out of my dispatch table) against the items in that array, and applying the appropriate css style inline for that element only.

This is how the first-level citizens works right now, and you can see that it does indeed work.

What I'm trying to figure out, is how to create/maintain a relationship between the second-level citizens and their parent dispatch actions.

What is the easiest/most flexible way of creating these menus in a way that maintains these relationships and allows me to keep the parent menu's tab colored, when I'm selecting children items of that parent?

When putting a smiley right before a closing parenthesis, do you:

Use two parentheses: (Like this: :) )
Use one parenthesis: (Like this: :)
Reverse direction of the smiley: (Like this: (: )
Use angle/square brackets instead of parentheses
Use C-style commenting to set the smiley off from the closing parenthesis
Make the smiley a dunce: (:>
I disapprove of emoticons
Other