@@-- Builds an index for split pages.
@@-- If there are more entries than the maximum allowed, the first, last, and
@@-- currententries are always displayed; extra entries are replaced with "..."
@@-- and are associated to $2
@@--
@@-- Parameters: $1= Number of visible index entries
@@--             $2 (optional) = Href to use for "..." entries.
@@--                             (none by default)
@@--
@@-- Can be used with splitters:
@@--   primary index  : Alpha, Alpha.Bounded, Uniform.Alpha, Uniform,
@@--                    Uniform.Overlapping
@@--   secondary index: Alpha.Bounded

@@TABLE@@
   @@IF@@ @_TABLE_LINE_@ = 1 or @_TABLE_LINE_@ = @_HREFS_V'LENGTH_@ or (@_PAGE_INDEX_@ <= @_"/"(2):$1_@ and @_TABLE_LINE_@ <= @_"-"(2):$1_@) or (@_PAGE_INDEX_@ > @_"/"(2):"-"($1):"*"(2):HREFS_V'LENGTH_@ and @_TABLE_LINE_@ > @_"+"(2):"-"($1):HREFS_V'LENGTH_@)
      @@IF@@ @_TABLE_LINE_@ = @_PAGE_INDEX_@
         <font color="red">@_INDEXES_V_@</font>
      @@ELSE@@
         <a href="@_HREFS_V_@">@_INDEXES_V_@</a>
      @@END_IF@@

   @@ELSIF@@ @_TABLE_LINE_@ > @_"+"(2):"/"(2):"-"($1):"*"(2):PAGE_INDEX_@ and @_TABLE_LINE_@ <= @_"+"($1):"-"(2):"/"(2):"-"($1):"*"(2):PAGE_INDEX_@
      @@IF@@ @_TABLE_LINE_@ = @_PAGE_INDEX_@
         <font color="red">@_INDEXES_V_@</font>
      @@ELSE@@
         <a href="@_HREFS_V_@">@_INDEXES_V_@</a>
      @@END_IF@@

   @@ELSIF@@ @_TABLE_LINE_@ = 2 or @_TABLE_LINE_@ = @_"-"(1):INDEXES_V'LENGTH_@
     @@IF@@ @_EXIST:$2_@
       <a href="@_$2_@">...</a>
     @@ELSE@@
       ...
     @@END_IF@@
   @@END_IF@@
@@END_TABLE@@
