Hi, I've already done this, but without creating any function.
A first solution would be to have two different classes for your level(1) pages. Let's say, for instance the "Menu1" page type, and the "Menu2" page type. Then, for your first navigation bar, your code would be :
<% control Menu(1) %>
<% if ClassName = Menu1 %>
<a href=$Link>$Title</a>
<% else %>
<% end_if %>
<% end_control %>
... and same thing with <% if ClassName = Menu2 %> for your second nav bar.
A second solution would be to create a tickable box in the cms that the user checks if he wants the page to show up in the first nav bar. Let's call it "ShowInMenuOne". Your code becomes :
<% control Menu(1) %>
<% if ShowInMenuOne %>
<a href=$Link>$Title</a>
<% else %>
<% end_if %>
<% end_control %>
for the first nav bar and
<% control Menu(1) %>
<% if ShowInMenuOne %>
<% else %>
<a href=$Link>$Title</a>
<% end_if %>
<% end_control %>
For the second nav bar.
I'm sure it's not the most intelligent way to handle your problem, but it works !