Index: zpt/toc_figures.zpt
===================================================================
--- zpt/toc_figures.zpt	(revision 91)
+++ zpt/toc_figures.zpt	(revision 91)
@@ -0,0 +1,14 @@
+<tal:block tal:define="docinfo options/docinfo; pageinfo options/pageinfo;  
+  pn python:int(pageinfo['tocPN']); tocsize python:int(docinfo['tocSize_figures']); grpsize python:int(pageinfo['tocPageSize']);
+  maxpn python:int(tocsize/grpsize);">
+  <div class="thumbruler">
+    <span tal:condition="python:(pn>1)">
+      <a tal:attributes="href python:here.getLink(param='tocPN',val=pn-1)">&lt;</a>
+    </span>
+    <span tal:content="string:$pn of $maxpn"/>
+    <span>
+    <a tal:attributes="href python:here.getLink(param='tocPN',val=pn+1)">&gt;</a>
+  </span>
+</div>
+  <div tal:content="structure python:here.getTocPage(mode='figures',pageinfo=pageinfo,docinfo=docinfo)"/>
+</tal:block>
Index: zpt/toc_text.zpt
===================================================================
--- zpt/toc_text.zpt	(revision 91)
+++ zpt/toc_text.zpt	(revision 91)
@@ -0,0 +1,14 @@
+<tal:block tal:define="docinfo options/docinfo; pageinfo options/pageinfo;  
+  pn python:int(pageinfo['tocPN']); tocsize python:int(docinfo['tocSize_text']); grpsize python:int(pageinfo['tocPageSize']);
+  maxpn python:int(tocsize/grpsize);">
+  <div class="thumbruler">
+    <span tal:condition="python:(pn>1)">
+      <a tal:attributes="href python:here.getLink(param='tocPN',val=pn-1)">&lt;</a>
+    </span>
+    <span tal:content="string:$pn of $tocsize"/>
+    <span>
+    <a tal:attributes="href python:here.getLink(param='tocPN',val=pn+1)">&gt;</a>
+  </span>
+</div>
+  <div tal:content="structure python:here.getTocPage(mode='text',pageinfo=pageinfo,docinfo=docinfo)"/>
+</tal:block>
Index: zpt/toc_thumbs.zpt
===================================================================
--- zpt/toc_thumbs.zpt	(revision 91)
+++ zpt/toc_thumbs.zpt	(revision 91)
@@ -0,0 +1,31 @@
+<div tal:define="docinfo options/docinfo; pageinfo options/pageinfo;  
+  start pageinfo/start; end pageinfo/end; rows pageinfo/rows; cols pageinfo/cols;
+  current pageinfo/current; grpsize pageinfo/groupsize">
+
+<div class="thumbruler">
+  <span tal:condition="python:(start>1)">
+    <a tal:attributes="href python:here.getLink(param='start',val=max(start-grpsize,1))">&lt;</a>
+  </span>
+  <select tal:attributes="onChange python:'location.href=\''+here.getLink(param='start',val=None)+'&start=\'+this.options[this.selectedIndex].value'">
+    <option tal:repeat="grp python:range(pageinfo['numgroups'])" 
+      tal:attributes="selected python:(start==grp*grpsize+1); value python:(grp*grpsize+1)"
+      tal:content="python:(grp*grpsize+1)"/>
+  </select>
+  <span tal:condition="python:(start+grpsize<int(docinfo['numPages']))">
+    <a tal:attributes="href python:here.getLink(param='start',val=start+grpsize)">&gt;</a>
+  </span>
+</div>
+<table>
+  <tr tal:repeat="row python:range(rows)">
+    <tal:block tal:repeat="idx python:range(start+row*cols,start+(row+1)*cols)">
+      <td align="center" tal:condition="python:(idx<=end)"
+		  	tal:attributes="class python:here.getStyle(idx,current,'thumb')">
+		<a tal:attributes="href python:here.getLink(param='pn',val=idx)">
+		  <img class="thumbimg" border="0" tal:attributes="src string:${docinfo/imageURL}&pn=$idx&dw=100&dh=100"/>
+		  <div class="thumbcap" tal:content="idx"/>
+		</a>
+	  </td>
+    </tal:block>
+  </tr>
+</table>
+</div>
Index: zpt/viewer_main.zpt
===================================================================
--- zpt/viewer_main.zpt	(revision 89)
+++ zpt/viewer_main.zpt	(revision 91)
@@ -2,5 +2,5 @@
     "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
 <html xmlns="http://www.w3.org/1999/xhtml"
- tal:define="docinfo options/docinfo; pageinfo options/pageinfo; viewMode options/viewMode">
+ tal:define="docinfo options/docinfo; pageinfo options/pageinfo; viewMode pageinfo/viewMode; tocMode pageinfo/tocMode">
 <head>
   <meta http-equiv="Content-Type" content="text/html; charset=utf-8">
@@ -13,9 +13,8 @@
   <tr>
     <td width="300px" valign="top">
-      <tal:block tal:replace="structure python:here.template.thumbs_main(docinfo=docinfo,pageinfo=pageinfo)" /> 
+      <tal:block tal:replace="structure python:getattr(here.template, 'toc_%s'%tocMode)(docinfo=docinfo,pageinfo=pageinfo)"/> 
     </td>
     <td width="100%" valign="top">
-      <tal:block tal:condition="python:viewMode=='images'" tal:content="structure python:here.template.page_main_images(docinfo=docinfo,pageinfo=pageinfo,viewMode=viewMode,mk=options['mk'])" />
-      <tal:block tal:condition="python:viewMode.startswith('text')" tal:content="structure python:here.template.page_main_text(docinfo=docinfo,pageinfo=pageinfo,viewMode=viewMode,mk=options['mk'])" />
+      <tal:block tal:content="structure python:getattr(here.template, 'page_main_%s'%viewMode)(docinfo=docinfo,pageinfo=pageinfo,mk=options['mk'])"/>
     </td>
   </tr>
