<%! // Multilevel directory path for index pages
void writePath(File dir, String prefix) {
    boolean topLevel = fileVariables.get(dir) == null;
    if(!topLevel) writePath(dir.getParentFile(), prefix + "../");
    if(!topLevel) out.print(" / ");
    if(prefix.length() > 0) out.print("<a href=\"" + prefix + engine.getIndexPageName() + engine.getPageExtension() + "\">");
    else out.print("<a href=\"" + indexPage + "\">");
    if(topLevel) { 
      String s = album.get("rootName");
      out.print((s.length() > 0)? s:"..");
    }
    else {
      cTitle=((Map)fileVariables.get(dir)).get("title");
      if(cTitle.length() > 0) out.print(cTitle);
      else out.print(dir.getName().replace('_',' '));
    }
    out.print("</a>");
  }
%>
<%
  if(album.get("rootName") == null) album.put("rootName", title);
  writePath(imageDirectory, "");
%>