How to theme only top level menu? I have the following menus

about us
    company
    menu 2
our work
    menu 1
    menu 2
news
contact
jobs


I like to insert an extra li between each top level menus (about us, our work, news, contact, jobs) to make them look like "about us   |   our work   |   news   | contact   |   jobs "

I looked at template.php and I have themename_menu_link, but I don't know how to compare the variable to check if it is a top level menu or not.
The only way I can think of is as follows:

template.php

&lt;?php

function YOURTHEME_menu_tree__YOURMENUNAME(&amp;$variables) {
    global $cur_level;
    $cur_level++;
    return '&lt;ul class="menu level-' . $cur_level . '"&gt;' . $variables['tree'] . '&lt;/ul&gt;';
}

?&gt;


page.tpl.php

&lt;?php print render(menu_tree('YOURMENUNAME')) ?&gt;


This will give each level an unique class for it's level. Though, there is one big problem with this approach, and that is that menu_tree is working from the bottom up. So you will end up in the following level classes:

ul .level-3
li
li
    ul .level-2
    li 
    li
        ul .level-1
        li
    li
li


So, you can never actually be sure about which classname the top level will have, only if you know for sure that there will always be an X count of levels.

Edit
So, just to be clear about my solution here above, this is the only way I can think of doing this programatically at theme level. If you could use a module like Nice Menu's (like suggested above) you should really be using that, since this is more a kind of workaround than a real solution to Drupal's sturdy menu system...