If there can't be more than 5 (or even if there could be) i personally wouldn't use a leading 0 in the IDs, there is no need.
But if you want leading 0s then your original method (not including the if statement) would be most efficient in terms of processing time.
If there is no possibility in having over 5 items, there is no need what-so-ever to have an if statement like you suggested in your last post. What i would suggest is wrapping the whole control in an if:
<div id="nav_main"><!-- Begin Nav Main -->
<ul id="Menu1">
<% control Menu(1) %>
<% if Pos < 6 %>
<li id="nav{$Pos}" class="$LinkingMode"><a href="$Link" title="Go to the "{$Title}" page">$MenuTitle</a></li>
<% end_if %>
<% end_control %>
</ul>
</div><!-- /End Nav Main -->
Which means no matter how many top-level pages the user adds, only the first five would be echoed on site. This is best if someone other than you is going to manage the site to stop them accidentally adding menu items and breaking the site.
If you were using CSS3 (which doubt you are - because it isnt supported by IE6) you can use nth items which would mean no need to give each an individual ID (thus reducing mark-up) [http://www.smashingmagazine.com/2009/08/17/taming-advanced-css-selectors/ - section 6].
Hard coding your navigation is a very bad idea, it means it is not flexable and the user can't edit it through the CMS. You aren't seperating content and layout (which is the whole point!).
If i understand what you are trying to do correctly (split the top level navigation into two areas), I would personally do the above method i specified for the first 5 links, and then for the 'side nav' (as i will call it) do:
<div id="nav_main"><!-- Begin Nav Main -->
<ul id="Menu1">
<% control Menu(1) %>
<% if Pos > 5 %>
<li id="nav{$Pos}" class="$LinkingMode"><a href="$Link" title="Go to the "{$Title}" page">$MenuTitle</a></li>
<% end_if %>
<% end_control %>
</ul>
</div><!-- /End Nav Main -->
It is probably best to keep the IDs on the li elements so that if anyone ever needs to maintain your site (or even if you come back to it after some time), it is as straight forward and consistent as possible.
It would also be possible to create your own page control HorizontalMenu and SideMenu which could just return the first 5 and all others (respectively) which would be more efficient than just running through all the menu items and ignoring the ones outside of the if statement. I would do it something like this:
Class Page_Controller extends ... {
function HorizontalMenu() {
$result = DataObject::get("SiteTree", "\"ShowInMenus\" = 1 AND \"ParentID\" = 0", '','','5');
$visible = array();
// Remove all entries the can not be viewed by the current user
// We might need to create a show in menu permission
if(isset($result)) {
foreach($result as $page) {
if($page->can('view')) {
$visible[] = $page;
}
}
}
return new DataObjectSet($visible);
}
}
That function gets up to 5 of the menu items, then you could run through the control as <% control HorizontalMenu %> with no need for an if < 6 condition. Much more efficient.
For the other menu i would modify it to return all but the first 5 items, can't think exactly how i would do it right now, but it wouldnt be impossible.
Now, i think that is enough help for now! Once you get some working code, post it back here so everyone can benefit! :D
PS: You need to think about how your site/design is going to cope if the user changes the order of the items in the menu... Will this badly effect the design impact?