%# "Don't go around saying the world owes you a living.  The world owes
%# you nothing.  It was here first."
%# 		-- Mark Twain

<ul style='padding-left: 20px'>
% my $postfix;
% my $last_section = '';
% while (my ($k, $v) = splice(@$Map, 0, 2)) {
%   my $sum = (($v =~ s/(\(\d+\))$//) ? $1 : '');
%   my ($section, $label) = ($1, $2) if loc($v) =~ /^(?:(.+)?-)?([^-]+)$/;
%   if ($section and $last_section ne $section) {
%      if ($last_section) {
</ul></li>
%      }
<li><strong><em><% $section %></em></strong><br><ul style="padding-left: 10px">
%      $last_section = $section;
%   }
<li><nobr>
%   if ($k eq '') { $postfix = $v; next }
%   if ($k eq $Skip) {
	<% $label %>
%   } elsif ($k eq $Show or $canon->($k) eq $canon->($URL)) {
	<a style='color: black; font-weight: bold' href="<% $Show ? (($ARGS{url} || $url) . "?Show=$k") : (($k=~/\?/) ? "$k;" : "$k?") %><% $ARGS{Begin} ? ";Begin=$ARGS{Begin}" : '' %><% $ARGS{User} ? ";User=$ARGS{User}" : '' %><% $ARGS{Group} ? ";Group=$ARGS{Group}" : '' %><% $postfix %>"><% $label %></a> <% $sum %>
%  } else {
	<a style='text-decoration: underline' href="<% $Show ? (($ARGS{url} || $url) . "?Show=$k") : (($k=~/\?/) ? "$k;" : "$k?") %><% $ARGS{Begin} ? ";Begin=$ARGS{Begin}" : '' %><% $ARGS{User} ? ";User=$ARGS{User}" : '' %><% $ARGS{Group} ? ";Group=$ARGS{Group}" : '' %><% $postfix %>"><% $label %></a> <% $sum %>
%  }
</nobr></li>
% }
</ul>
<%INIT>
my $url = $r->uri;
$url =~ s{//+}{/}g;
my $image = '';
my $canon = sub {
    my $rv = File::Spec->canonpath($_[0]);
    $rv =~ s/index\.html$//;
    $rv =~ s{[\\/]+$}{};
    return $rv;
};
</%INIT>
<%ARGS>
$Map	=> []
$Name	=> 'Map'
$Show	=> ''
$URL	=> ''
$Skip	=> ''
$ImagePath => ''
</%ARGS>
