

First off, this only supports the primary menu items, and if you can avoid it, I highly recommend you to use ul/li selectors. In some wacky universe out there, spanning horizonal menus across your page is desired and achievable by formatting the array of links return by menu_primary_links() function.

The snippit generates active states which follow through from top level menus as well as sub menu's, picking out the first and last links in each list.
First, create a region in page.tpl.php. In the example below, the region is named $primary_nav. This region name will also appear in the template.php file. The division tag 'primarynav' is the CSS construct that is used to style the menu's.