<% 
  int cellWidth = maxThumbWidth * thumbsRatio / 100 + 4;
  int cellHeight = maxThumbHeight * thumbsRatio / 100 + 4;
  String tTitle;

  out.println("<TABLE style=\"height:" + (cellHeight + 8) + "px;\" cellspacing=\"2\" cellpadding=\"2\"><TR> <!-- Thumblist -->");

  for(i = imageNum - thumbsCount - 1; i < (imageNum + thumbsCount); i++) {

    out.print("<TD width=\"" + cellWidth + "\" align=\"center\" valign=\"middle\" style=\"border:0px\"");

    if(i >= 0 && i < files.length) {
      Map vars = (Map)fileVariables.get(files[i]);

      tTitle = vars.get("comment");
      if(tTitle != void && tTitle != null && tTitle.length() > 0) tTitle = stripHTML(tTitle);
      else tTitle = vars.get("fileName");

      if(i + 1 != imageNum) out.print(" class=\"thumb\"><A href=\"" + vars.get("currentPage") + "\">");
      else out.print(" class=\"cthumb\">");

      if(vars.get("iconPath") == null) {
        out.print("<IMG src=\"" + vars.get("thumbPath") + "\" class=\"image\" "); 
        out.print("title=\"" + tTitle + "\" width=\"" + ((emSquareThumbs? maxThumbWidth:vars.get("thumbWidth")) * thumbsRatio / 100) + "\" height=\"" + ((emSquareThumbs? maxThumbWidth:vars.get("thumbHeight")) * thumbsRatio / 100) + "\" alt=\"\" align=\"absmiddle\">");
      }
      else {
        out.print("<IMG src=\"" + vars.get("iconPath") + "\" border=\"0\" ");
        out.print("title=\"" + tTitle + "\" width=\"" + (64 * thumbsRatio / 100) + "\" height=\"" + (64 * thumbsRatio / 100) + "px\" alt=\"\" align=\"absmiddle\">");
      }
      if(i + 1 != imageNum) out.print("</A>");
    }
    else
      out.print(">&nbsp;");

    out.println("</TD>");
  }

  out.println("</TR></TABLE>");
%>
