Index: zpt/common_template.zpt
===================================================================
--- zpt/common_template.zpt	(revision 528)
+++ zpt/common_template.zpt	(revision 532)
@@ -12,5 +12,9 @@
                 bib docinfo/bib | nothing; bibType docinfo/bibType | nothing;
                 formattedLabel python:here.metadataService.getBibFormattedLabel(bibdata=bib);">
-    <div tal:condition="not:formattedLabel">
+    <div class="logo" tal:condition="exists:here/template/logo.png">
+      <img tal:attributes="src here/template/logo.png/absolute_url"/>
+    </div>
+    <div class="title-block">
+    <div class="title" tal:condition="not:formattedLabel">
       <tal:block tal:condition="python:docinfo['creator'] or docinfo['title']">
         <i tal:content="docinfo/creator" />,
@@ -20,13 +24,21 @@
         tal:content="string:[no bibliographical information for this document (type ${bibType})]" />
     </div>
-    <div tal:condition="formattedLabel" tal:content="structure formattedLabel" />
-    <div class="doclinks">
-      <a tal:condition="python:viewMode!='index'" tal:attributes="href python:here.getLink('viewMode','index')">Bibliographical
-        information</a>
-      <a tal:condition="python:viewMode!='text'" tal:attributes="href python:here.getLink('viewMode','text')">Page view</a>
-      <a tal:condition="python:viewMode!='thumbs'" tal:attributes="href python:here.getLink('viewMode','thumbs')">Thumbnail overview</a>
+    <div class="title" tal:condition="formattedLabel" tal:content="structure formattedLabel" />
+    <ul class="view-switcher">
+      <li tal:attributes="class python:here.getStyle(viewMode, 'text')"><a tal:omit-tag="python:viewMode=='text'"
+        tal:attributes="href python:here.getLink('viewMode','text')">Text</a></li>
+      <li tal:attributes="class python:here.getStyle(viewMode, 'images')"><a tal:omit-tag="python:viewMode=='images'"
+        tal:attributes="href python:here.getLink('viewMode','images')">Image</a></li>
+      <li tal:attributes="class python:here.getStyle(viewMode, 'xml')"><a tal:omit-tag="python:viewMode=='xml'"
+        tal:attributes="href python:here.getLink('viewMode','xml')">XML</a></li>
+      <li tal:attributes="class python:here.getStyle(viewMode, 'thumbs')"><a tal:omit-tag="python:viewMode=='thumbs'"
+        tal:attributes="href python:here.getLink('viewMode','thumbs')">Thumbnail overview</a></li>
+      <li tal:attributes="class python:here.getStyle(viewMode, 'index')"><a tal:omit-tag="python:viewMode=='index'"
+        tal:attributes="href python:here.getLink('viewMode','index')">Document information</a></li>
+    </ul>
     </div>
   </metal:block>
   <!-- /head -->
+
 
   <!-- page ruler with previous/next page buttons -->
@@ -38,25 +50,20 @@
               leftest python:test(flowLtr,first,last); rightest python:test(flowLtr,last,first);">
     <form class="autosubmit" tal:attributes="action viewerUrl">
-      <input type="hidden" tal:define="params python:here.getParams('pn', None)"
-        tal:repeat="param params" tal:attributes="name param; value python:params[param]" />
-      page <a tal:condition="leftest"
-        tal:attributes="href python:here.getLink('pn',leftest)">|&lt;</a> <span
-        tal:condition="not:leftest">|&lt;</span> <a tal:condition="left"
-        tal:attributes="href python:here.getLink('pn',left)">&lt;</a> <span
-        tal:condition="not:left">&lt;</span> <input class="autosubmit" size="3"
-        type="text" name="pn" tal:attributes="value pn" /> <span class="originalPage"
-        title="Original page number"
-        tal:define="originalPage pageinfo/pageNumberOrig | nothing"
-        tal:condition="python:originalPage!=None"> (<span
-        tal:replace="originalPage" /><span
-        tal:define="originalPageNorm pageinfo/pageNumberOrigNorm | nothing"
-        tal:condition="python:originalPageNorm!=None"> [<span
-          tal:replace="originalPageNorm" />]
-      </span>)
-      </span> <input type="submit" value="Go" /> of <span tal:replace="numPages" /> <a
-        tal:condition="right" tal:attributes="href python:here.getLink('pn',right)">&gt;</a>
-      <span tal:condition="not:right">&gt;</span> <a tal:condition="rightest"
-        tal:attributes="href python:here.getLink('pn',rightest)">&gt;|</a> <span
+      <input type="hidden" tal:define="params python:here.getParams('pn', None)" tal:repeat="param params"
+        tal:attributes="name param; value python:params[param]" />
+        <span class="ruler-main">page <a tal:condition="leftest"
+        tal:attributes="href python:here.getLink('pn',leftest)">|&lt;</a> <span tal:condition="not:leftest">|&lt;</span> <a
+        tal:condition="left" tal:attributes="href python:here.getLink('pn',left)">&lt;</a> <span tal:condition="not:left">&lt;</span>
+        <input class="autosubmit" size="3" type="text" name="pn" tal:attributes="value pn" /> <span class="originalPage"
+        title="Original page number" tal:define="originalPage pageinfo/pageNumberOrig | nothing"
+        tal:condition="python:originalPage!=None"> (<span tal:replace="originalPage" /><span
+          tal:define="originalPageNorm pageinfo/pageNumberOrigNorm | nothing" tal:condition="python:originalPageNorm!=None">
+            [<span tal:replace="originalPageNorm" />]
+        </span>)
+        </span> <input type="submit" value="Go" /> of <span tal:replace="numPages" /> <a tal:condition="right"
+        tal:attributes="href python:here.getLink('pn',right)">&gt;</a> <span tal:condition="not:right">&gt;</span> <a
+        tal:condition="rightest" tal:attributes="href python:here.getLink('pn',rightest)">&gt;|</a> <span
         tal:condition="not:rightest">&gt;|</span>
+      </span> <!-- ruler-main -->
     </form>
   </metal:block>
@@ -65,19 +72,13 @@
   <!-- toc ruler (using getBatch) with previous/next toc page buttons -->
   <metal:block metal:define-macro="toc_ruler">
-    <form class="autosubmit" tal:attributes="action viewerUrl"
-      tal:define="startParam startParam | string:start">
-      <input type="hidden" tal:define="params python:here.getParams(startParam, None)"
-        tal:repeat="param params" tal:attributes="name param; value python:params[param]" />
-      <a tal:condition="batch/prevStart"
-        tal:attributes="href python:here.getLink(startParam,batch['prevStart'])">&lt;</a>
-      <span tal:condition="not:batch/prevStart">&lt;</span>
+    <form class="autosubmit" tal:attributes="action viewerUrl" tal:define="startParam startParam | string:start">
+      <input type="hidden" tal:define="params python:here.getParams(startParam, None)" tal:repeat="param params"
+        tal:attributes="name param; value python:params[param]" /> <a tal:condition="batch/prevStart"
+        tal:attributes="href python:here.getLink(startParam,batch['prevStart'])">&lt;</a> <span tal:condition="not:batch/prevStart">&lt;</span>
       <select class="autosubmit" tal:attributes="name startParam">
-        <option tal:repeat="grp batch/batches"
-          tal:attributes="selected python:(start==grp['start']); value grp/start"
+        <option tal:repeat="grp batch/batches" tal:attributes="selected python:(start==grp['start']); value grp/start"
           tal:content="string:${grp/start} - ${grp/end}" />
-      </select>
-      <input type="submit" value="Go" /> <a tal:condition="batch/nextStart"
-        tal:attributes="href python:here.getLink(startParam,batch['nextStart'])">&gt;</a>
-      <span tal:condition="not:batch/nextStart">&gt;</span>
+      </select> <input type="submit" value="Go" /> <a tal:condition="batch/nextStart"
+        tal:attributes="href python:here.getLink(startParam,batch['nextStart'])">&gt;</a> <span tal:condition="not:batch/nextStart">&gt;</span>
     </form>
   </metal:block>
@@ -86,19 +87,14 @@
   <metal:block metal:define-macro="toc_ruler_thumbs">
     <form class="autosubmit" tal:attributes="action viewerUrl">
-      <input type="hidden" tal:define="params python:here.getParams('start',None)"
-        tal:repeat="param params" tal:attributes="name param; value python:params[param]" />
-      <a tal:condition="left" tal:attributes="href python:here.getLink('start',left)">&lt;</a>
-      <span tal:condition="not:left">&lt;</span>
-      <select class="autosubmit" name="start"
-        tal:define="ofs python:test(pageinfo['pageZero'],0,1)">
+      <input type="hidden" tal:define="params python:here.getParams('start',None)" tal:repeat="param params"
+        tal:attributes="name param; value python:params[param]" /> <a tal:condition="left"
+        tal:attributes="href python:here.getLink('start',left)">&lt;</a> <span tal:condition="not:left">&lt;</span> <select
+        class="autosubmit" name="start" tal:define="ofs python:test(pageinfo['pageZero'],0,1)">
         <tal:block>
-          <option tal:repeat="grp pageBatch/batches"
-            tal:attributes="selected python:start==grp['start']; value grp/start;"
+          <option tal:repeat="grp pageBatch/batches" tal:attributes="selected python:start==grp['start']; value grp/start;"
             tal:content="string:${grp/start} - ${grp/end}" />
         </tal:block>
-      </select>
-      <input type="submit" value="Go" /> <a tal:condition="right"
-        tal:attributes="href python:here.getLink('start',right)">&gt;</a> <span
-        tal:condition="not:right">&gt;</span>
+      </select> <input type="submit" value="Go" /> <a tal:condition="right" tal:attributes="href python:here.getLink('start',right)">&gt;</a>
+      <span tal:condition="not:right">&gt;</span>
     </form>
   </metal:block>
@@ -106,24 +102,21 @@
   <!-- toc type switcher -->
   <metal:block metal:define-macro="toc_switcher">
-    <ul class="switcher">
-      <li tal:attributes="class python:test(tocMode=='thumbs', 'sel', None)">
-        <a tal:attributes="href python:here.getLink('tocMode','thumbs')">Thumbnails</a>
-      </li>
-      <li tal:attributes="class python:test(tocMode=='text', 'sel', None)"
-        tal:condition="python:docpath and docinfo.get('numTocEntries', None)">
-        <a tal:attributes="href python:here.getLink('tocMode','text')">Content</a>
-      </li>
-      <li tal:attributes="class python:test(tocMode=='figures', 'sel', None)"
-        tal:condition="python:docpath and docinfo.get('numFigureEntries', None)">
-        <a tal:attributes="href python:here.getLink('tocMode','figures')">Figures</a>
-      </li>
-      <li tal:attributes="class python:test(tocMode=='concordance', 'sel', None)"
-        tal:condition="python:docpath and docinfo.get('pageNumbers', None)">
-        <a tal:attributes="href python:here.getLink('tocMode','concordance')">Concordance</a>
-      </li>
-      <li tal:attributes="class python:test(tocMode=='none', 'sel', None)">
-        <a tal:attributes="href python:here.getLink('tocMode','none')">None</a>
-      </li>
-    </ul>
+    <div class="toc-switcher">
+      <ul>
+        <li tal:attributes="class python:here.getStyle(tocMode, 'none')"><span><a tal:omit-tag="python:tocMode=='none'"
+            tal:attributes="href python:here.getLink('tocMode','none')">None</a></span></li>
+        <li tal:attributes="class python:here.getStyle(tocMode, 'concordance')"
+          tal:condition="python:docpath and docinfo.get('pageNumbers', None)"><span><a
+            tal:omit-tag="python:tocMode=='concordance'" tal:attributes="href python:here.getLink('tocMode','concordance')">Concordance</a></span></li>
+        <li tal:attributes="class python:here.getStyle(tocMode, 'figures')"
+          tal:condition="python:docpath and docinfo.get('numFigureEntries', None)"><span><a
+            tal:omit-tag="python:tocMode=='figures'" tal:attributes="href python:here.getLink('tocMode','figures')">Figures</a></span></li>
+        <li tal:attributes="class python:here.getStyle(tocMode, 'text')"
+          tal:condition="python:docpath and docinfo.get('numTocEntries', None)"><span><a
+            tal:omit-tag="python:tocMode=='text'" tal:attributes="href python:here.getLink('tocMode','text')">Content</a></span></li>
+        <li tal:attributes="class python:here.getStyle(tocMode, 'thumbs')"><span><a
+            tal:omit-tag="python:tocMode=='thumbs'" tal:attributes="href python:here.getLink('tocMode','thumbs')">Thumbnails</a></span></li>
+      </ul>
+    </div>
   </metal:block>
 
Index: zpt/layer_text_search.zpt
===================================================================
--- zpt/layer_text_search.zpt	(revision 526)
+++ zpt/layer_text_search.zpt	(revision 532)
@@ -16,8 +16,6 @@
     <ul>
       <metal:block metal:define-macro="layer_select_li">
-        <li tal:condition="python:query">
-          <input type="checkbox" class="autosubmit" name="viewLayer" value="search"
-            tal:attributes="checked python:'search' in viewLayers" /> Search hits
-        </li>
+        <li tal:condition="python:query"><input type="checkbox" class="autosubmit" name="viewLayer" value="search"
+          tal:attributes="checked python:'search' in viewLayers" /> Search hits</li>
       </metal:block>
     </ul>
@@ -48,36 +46,23 @@
       <h4>Search</h4>
       <form tal:attributes="action viewerUrl">
-        <input type="hidden"
-          tal:define="params python:here.getParams(params={'query':None,'queryType':None,'viewLayer':None})"
-          tal:repeat="param params"
-          tal:attributes="name param; value python:params[param]" />
+        <input type="hidden" tal:define="params python:here.getParams(params={'query':None,'queryType':None,'viewLayer':None})"
+          tal:repeat="param params" tal:attributes="name param; value python:params[param]" />
         <!-- make sure we have one viewLayer=search -->
         <tal:block tal:repeat="vl viewLayers">
-          <input type="hidden" name="viewLayer" tal:attributes="value vl"
-            tal:condition="python:vl != 'search'" />
+          <input type="hidden" name="viewLayer" tal:attributes="value vl" tal:condition="python:vl != 'search'" />
         </tal:block>
         <input type="hidden" name="viewLayer" value="search" />
         <!-- query text -->
-        <input type="text" name="query" tal:attributes="value query" /> <input
-          type="submit" value="Search" /> <a
+        <input type="text" name="query" tal:attributes="value query" /> <br /> <input type="submit" value="Search" /> <a
           tal:attributes="href python:here.getLink('query',None)">Clear</a>
         <ul>
-          <li>
-            <input type="radio" name="queryType" value="fulltext"
-              tal:attributes="checked python:queryType=='fulltext'" /> Exact
-          </li>
-          <li>
-            <input type="radio" name="queryType" value="fulltextMorph"
-              tal:attributes="checked python:queryType=='fulltextMorph'" /> All forms
-          </li>
-          <li>
-            <input type="radio" name="queryType" value="ftIndex"
-              tal:attributes="checked python:queryType=='ftIndex'" /> Fulltext index
-          </li>
-          <li>
-            <input type="radio" name="queryType" value="ftIndexMorph"
-              tal:attributes="checked python:queryType=='ftIndexMorph'" /> Morphological
-            index
-          </li>
+          <li><input type="radio" name="queryType" value="fulltext" tal:attributes="checked python:queryType=='fulltext'" />
+            Exact</li>
+          <li><input type="radio" name="queryType" value="fulltextMorph"
+            tal:attributes="checked python:queryType=='fulltextMorph'" /> All forms</li>
+          <li><input type="radio" name="queryType" value="ftIndex" tal:attributes="checked python:queryType=='ftIndex'" />
+            Fulltext index</li>
+          <li><input type="radio" name="queryType" value="ftIndexMorph"
+            tal:attributes="checked python:queryType=='ftIndexMorph'" /> Morphological index</li>
         </ul>
       </form>
Index: zpt/toc_concordance.zpt
===================================================================
--- zpt/toc_concordance.zpt	(revision 526)
+++ zpt/toc_concordance.zpt	(revision 532)
@@ -6,39 +6,34 @@
 </head>
 <body>
-  <!-- block used for main content area -->
-  <div class="toc-concordance" metal:define-macro="main"
-    tal:define="start pageinfo/start; tocsize docinfo/numPages; grpsize pageinfo/tocPageSize;
+  <div class="toc-container" metal:define-macro="main">
+    <div metal:use-macro="here/template/common_template/macros/toc_switcher" />
+    <!-- block used for main content area -->
+    <div class="tocbody concordance"
+      tal:define="start pageinfo/start; tocsize docinfo/numPages; grpsize pageinfo/tocPageSize;
                 pageNumbers docinfo/pageNumbers | nothing;
                 batch python:here.getBatch(start=start,size=grpsize,end=tocsize,data=pageNumbers);">
-    <div metal:use-macro="here/template/common_template/macros/toc_switcher" />
-    <div class="ruler">
-      <metal:block metal:use-macro="here/template/common_template/macros/toc_ruler" />
-    </div>
-    <div class="content">
-      <table tal:condition="pageNumbers">
-        <tr>
-          <th>Scan</th>
-          <th>Original</th>
-        </tr>
-        <tr tal:repeat="toc batch/this">
-          <tal:block tal:define="pn toc/pn | nothing">
-            <td>
-              <a tal:condition="pn"
-                tal:attributes="href python:here.getLink('pn', toc['pn'])"
-                tal:content="toc/pn" title="Scan number">ScanNo</a>
-            </td>
-            <td>
-              <span class="originalPage" title="Original page number"
-                tal:define="originalPage toc/no | nothing"
-                tal:condition="python:originalPage!=None"><span
-                tal:replace="originalPage" /><span
-                tal:define="originalPageNorm toc/non | nothing"
-                tal:condition="python:originalPageNorm!=None"> [<span
-                  tal:replace="originalPageNorm" />]
-              </span></span>
-            </td>
-          </tal:block>
-        </tr>
-      </table>
+      <div metal:use-macro="here/template/common_template/macros/toc_switcher" />
+      <div class="ruler">
+        <metal:block metal:use-macro="here/template/common_template/macros/toc_ruler" />
+      </div>
+      <div class="content">
+        <table tal:condition="pageNumbers">
+          <tr>
+            <th>Scan</th>
+            <th>Original</th>
+          </tr>
+          <tr tal:repeat="toc batch/this">
+            <tal:block tal:define="pn toc/pn | nothing">
+              <td><a tal:condition="pn" tal:attributes="href python:here.getLink('pn', toc['pn'])" tal:content="toc/pn"
+                title="Scan number">ScanNo</a></td>
+              <td><span class="originalPage" title="Original page number" tal:define="originalPage toc/no | nothing"
+                tal:condition="python:originalPage!=None"><span tal:replace="originalPage" /><span
+                  tal:define="originalPageNorm toc/non | nothing" tal:condition="python:originalPageNorm!=None"> [<span
+                    tal:replace="originalPageNorm" />]
+                </span></span></td>
+            </tal:block>
+          </tr>
+        </table>
+      </div>
     </div>
   </div>
Index: zpt/toc_figures.zpt
===================================================================
--- zpt/toc_figures.zpt	(revision 526)
+++ zpt/toc_figures.zpt	(revision 532)
@@ -6,14 +6,17 @@
 </head>
 <body>
-  <!-- block used for main content area -->
-  <div class="toc-figures" metal:define-macro="main"
-    tal:define="start pageinfo/start; tocsize docinfo/numFigureEntries; grpsize pageinfo/tocPageSize;
+  <div class="toc-container" metal:define-macro="main">
+    <div metal:use-macro="here/template/common_template/macros/toc_switcher" />
+    <!-- block used for main content area -->
+    <div class="tocbody figures"
+      tal:define="start pageinfo/start; tocsize docinfo/numFigureEntries; grpsize pageinfo/tocPageSize;
                 batch python:here.getBatch(start=start,size=grpsize,end=tocsize);">
-    <div metal:use-macro="here/template/common_template/macros/toc_switcher"/>
-    <div class="ruler">
-        <metal:block metal:use-macro="here/template/common_template/macros/toc_ruler"/>
+      <div metal:use-macro="here/template/common_template/macros/toc_switcher" />
+      <div class="ruler">
+        <metal:block metal:use-macro="here/template/common_template/macros/toc_ruler" />
+      </div>
+      <div class="content"
+        tal:content="structure python:here.getTocPage(mode='figures',start=start,pageinfo=pageinfo,docinfo=docinfo)" />
     </div>
-    <div class="content"
-      tal:content="structure python:here.getTocPage(mode='figures',start=start,pageinfo=pageinfo,docinfo=docinfo)" />
   </div>
   <!-- /toc -->
Index: zpt/toc_text.zpt
===================================================================
--- zpt/toc_text.zpt	(revision 526)
+++ zpt/toc_text.zpt	(revision 532)
@@ -6,16 +6,17 @@
 </head>
 <body>
-  <!-- block used for main content area -->
-  <div class="toc-text" metal:define-macro="main"
-    tal:define="start pageinfo/start; tocsize docinfo/numTocEntries; grpsize pageinfo/tocPageSize;
+  <div class="toc-container" metal:define-macro="main">
+    <div metal:use-macro="here/template/common_template/macros/toc_switcher" />
+    <!-- block used for main content area -->
+    <div class="tocbody text"
+      tal:define="start pageinfo/start; tocsize docinfo/numTocEntries; grpsize pageinfo/tocPageSize;
                 batch python:here.getBatch(start=start,size=grpsize,end=tocsize);">
-    <div metal:use-macro="here/template/common_template/macros/toc_switcher"/>
-    <div class="ruler">
-        <metal:block metal:use-macro="here/template/common_template/macros/toc_ruler"/>
+      <div class="ruler">
+        <metal:block metal:use-macro="here/template/common_template/macros/toc_ruler" />
+      </div>
+      <div class="content" tal:content="structure python:here.getTocPage(mode='text',start=start,pageinfo=pageinfo,docinfo=docinfo)" />
     </div>
-    <div class="content"
-      tal:content="structure python:here.getTocPage(mode='text',start=start,pageinfo=pageinfo,docinfo=docinfo)" />
   </div>
-  <!-- toc -->
+    <!-- toc -->
 </body>
 </html>
Index: zpt/toc_thumbs.zpt
===================================================================
--- zpt/toc_thumbs.zpt	(revision 528)
+++ zpt/toc_thumbs.zpt	(revision 532)
@@ -6,7 +6,9 @@
 </head>
 <body>
-  <!-- block used for main content area -->
-  <div class="toc-thumbs" metal:define-macro="main"
-    tal:define="start pageinfo/start;
+  <div class="toc-container" metal:define-macro="main">
+    <div metal:use-macro="here/template/common_template/macros/toc_switcher" />
+    <!-- block used for main content area -->
+    <div class="tocbody thumbs"
+      tal:define="start pageinfo/start;
                 grpsize pageinfo/groupsize;
                 numgroups pageinfo/numgroups;
@@ -15,28 +17,27 @@
                 left python:test(flowLtr,pageBatch['prevStart'],pageBatch['nextStart']);
                 right python:test(flowLtr,pageBatch['nextStart'],pageBatch['prevStart']);">
-    <div metal:use-macro="here/template/common_template/macros/toc_switcher"/>
 
-    <div class="content">
-      <div class="ruler">
-        <metal:block metal:use-macro="here/template/common_template/macros/toc_ruler_thumbs"/>
+      <div class="content">
+        <div class="ruler">
+          <metal:block metal:use-macro="here/template/common_template/macros/toc_ruler_thumbs" />
+        </div>
+
+        <table class="thumbs">
+          <tr tal:repeat="row pageBatch/pages">
+            <td tal:repeat="thumb row" tal:attributes="class python:here.getStyle(thumb['idx'],pn,'thumb')"><a
+              tal:define="idx thumb/idx" tal:condition="idx" tal:attributes="href python:here.getLink('pn',idx)"> <img
+                tal:attributes="src python:test(docinfo['imageURL'],here.getScalerUrl(pn=idx,dw=100,dh=100,docinfo=docinfo),'images/pic');
+                                alt idx" /><br />
+                <span title="Scan number" tal:content="idx" /> <span
+                tal:condition="python:pageNumbers and pageNumbers.get(idx, False) and pageNumbers[idx]['no']"
+                title="Original page number" tal:content="python:' (%s)'%(pageNumbers[idx]['no'])" />
+            </a></td>
+          </tr>
+        </table>
       </div>
-
-      <table class="thumbs">
-        <tr tal:repeat="row pageBatch/pages">
-          <td tal:repeat="thumb row"
-            tal:attributes="class python:here.getStyle(thumb['idx'],pn,'thumb')">
-            <a tal:define="idx thumb/idx" tal:condition="idx"
-              tal:attributes="href python:here.getLink('pn',idx)">
-              <img
-                tal:attributes="src python:test(docinfo['imageURL'],here.getScalerUrl(pn=idx,dw=100,dh=100,docinfo=docinfo),'images/pic');
-                                alt idx" /><br/>
-              <span title="Scan number" tal:content="idx"/>
-              <span tal:condition="python:pageNumbers and pageNumbers.get(idx, False) and pageNumbers[idx]['no']" title="Original page number" tal:content="python:' (%s)'%(pageNumbers[idx]['no'])"/>
-            </a>
-          </td>
-        </tr>
-      </table>
-    </div> <!-- content -->
-  </div> <!-- toc -->
+      <!-- content -->
+    </div>
+    <!-- toc -->
+  </div>
 </body>
 </html>
Index: zpt/viewer_images.zpt
===================================================================
--- zpt/viewer_images.zpt	(revision 514)
+++ zpt/viewer_images.zpt	(revision 532)
@@ -25,13 +25,13 @@
 
   <script type="text/javascript"
-    tal:content="string:
+    tal:content="python:'''
        var dlOpts = {
             'interactionMode' : 'fullscreen',
-            'digilibBaseUrl' : '$dlBaseUrl',
-            'fn' : '${docinfo/imagePath}',
-            'pn' : '${pageinfo/pn}',
+            'digilibBaseUrl' : '%s',
+            'fn' : '%s',
+            'pn' : '%s',
             'suppressParamNames' : ['fn'],
             'scalerInsets' : {'x' : 140, 'y' : 100}
-        };"></script>
+        };'''%(dlBaseUrl,docinfo.get('imagePath',''),pageinfo.get('pn','1'))"></script>
 
   <script type="text/javascript">
@@ -70,11 +70,4 @@
           <metal:block metal:use-macro="here/template/common_template/macros/page_ruler" />
         </div>
-        <ul class="switcher">
-          <li class="sel">Image</li>
-          <li tal:condition="docpath">
-            <a tal:attributes="href python:here.getLink('viewMode','text')">Text</a>
-          </li>
-        </ul>
-        <!-- /switcher -->
         <div class="content">
           <div id="scaler">
Index: zpt/viewer_text.zpt
===================================================================
--- zpt/viewer_text.zpt	(revision 530)
+++ zpt/viewer_text.zpt	(revision 532)
@@ -14,22 +14,20 @@
 <script type="text/javascript" tal:attributes="src string:$rootUrl/template/jquery_js"></script>
 <script type="text/javascript">
-    // <!--
-    $(document).ready(function() {
-        // autosubmit forms
-        $('form.autosubmit').find('.autosubmit').change(function() {
-            this.form.submit();
-        });
-        $('form.autosubmit input[type="submit"]').hide();
-    });
+	// <!--
+	$(document).ready(function() {
+		// autosubmit forms
+		$('form.autosubmit').find('.autosubmit').change(function() {
+			this.form.submit();
+		});
+		$('form.autosubmit input[type="submit"]').hide();
+	});
 // -->
 </script>
 <!--  layer headers (rendered always) -->
 <tal:block tal:repeat="layer availableLayers">
-  <tal:block tal:define="mpath string:here/template/layer_text_${layer}/macros/html_head"
-    tal:condition="python:exists(mpath)">
+  <tal:block tal:define="mpath string:here/template/layer_text_${layer}/macros/html_head" tal:condition="python:exists(mpath)">
     <metal:block metal:use-macro="python:path(mpath)" />
   </tal:block>
 </tal:block>
-
 </head>
 <body tal:condition="numPages">
@@ -43,9 +41,9 @@
       <metal:block metal:use-macro="here/template/common_template/macros/head" />
     </div>
+
     <div class="page-body" tal:condition="python:here.isAccessible(docinfo)">
       <!--table of contents-->
       <div class="col toc">
-        <metal:block
-          metal:use-macro="python:path('here/template/toc_%s/macros/main'%tocMode)" />
+        <metal:block metal:use-macro="python:path('here/template/toc_%s/macros/main'%tocMode)" />
       </div>
 
@@ -55,10 +53,4 @@
           <metal:block metal:use-macro="here/template/common_template/macros/page_ruler" />
         </div>
-        <ul class="switcher">
-          <li>
-            <a tal:attributes="href python:here.getLink('viewMode','images')">Image</a>
-          </li>
-          <li class="sel">Text</li>
-        </ul>
         <div class="content">
           <div class="pageHeaderTitle" tal:condition="exists:pageinfo/pageHeaderTitle"
@@ -81,30 +73,16 @@
         <!--"BEGIN TEXT DISPLAY"  -->
         <div class="options">
-          <h4>Text display</h4>
+          <h4>Text layer</h4>
           <form tal:attributes="action viewerUrl" class="autosubmit">
-            <input type="hidden"
-              tal:define="params python:here.getParams(params={'viewLayer':None,'viewMode':None})"
-              tal:repeat="param params"
-              tal:attributes="name param; value python:params[param]" />
+            <input type="hidden" tal:define="params python:here.getParams(params={'viewLayer':None,'viewMode':None})"
+              tal:repeat="param params" tal:attributes="name param; value python:params[param]" />
             <ul>
-              <li>
-                <input class="autosubmit" type="radio" name="viewMode" value="text"
-                  tal:attributes="checked python:viewMode=='text'" /> Text
-                <ul>
-                  <!-- text layer select buttons (rendered always) -->
-                  <tal:block tal:repeat="layer availableLayers">
-                    <tal:block
-                      tal:define="mpath string:here/template/layer_text_${layer}/macros/layer_select_li"
-                      tal:condition="python:exists(mpath)">
-                      <li metal:use-macro="python:path(mpath)" />
-                    </tal:block>
-                  </tal:block>
-                </ul>
-              </li>
-              <li>
-                <input type="radio" class="autosubmit" name="viewMode" value="xml"
-                  tal:attributes="checked python:viewMode=='xml'" /> XML<br /> <input
-                  type="submit" value="Go!" />
-              </li>
+              <!-- text layer select buttons (rendered always) -->
+              <tal:block tal:repeat="layer availableLayers">
+                <tal:block tal:define="mpath string:here/template/layer_text_${layer}/macros/layer_select_li"
+                  tal:condition="python:exists(mpath)">
+                  <li metal:use-macro="python:path(mpath)" />
+                </tal:block>
+              </tal:block>
             </ul>
           </form>
@@ -113,18 +91,12 @@
 
         <!--"BEGIN TEXT SIZE"-->
-        <div class="options">
+        <!--  <div class="options">
           <h4>Text size</h4>
           <ul class="fsizer">
-            <li>
-              <a href="javascript:fontSize(12);" class="fs_sml">S</a>
-            </li>
-            <li>
-              <a href="javascript:fontSize(14);" class="fs_med">M</a>
-            </li>
-            <li>
-              <a href="javascript:fontSize(16);" class="fs_lrg">L</a>
-            </li>
+            <li><a href="javascript:fontSize(12);" class="fs_sml">S</a></li>
+            <li><a href="javascript:fontSize(14);" class="fs_med">M</a></li>
+            <li><a href="javascript:fontSize(16);" class="fs_lrg">L</a></li>
           </ul>
-        </div>
+        </div> -->
         <!--"END TEXT SIZE"-->
 
@@ -136,20 +108,12 @@
             <input type="hidden"
               tal:define="params python:here.getParams(params={'characterNormalization':None, 'viewLayer':viewLayer})"
-              tal:repeat="param params"
-              tal:attributes="name param; value python:params[param]" />
+              tal:repeat="param params" tal:attributes="name param; value python:params[param]" />
             <ul>
-              <li>
-                <input type="radio" class="autosubmit" name="characterNormalization"
-                  value="orig" tal:attributes="checked python:norm=='orig'" /> Original
-              </li>
-              <li>
-                <input type="radio" class="autosubmit" name="characterNormalization"
-                  value="reg" tal:attributes="checked python:norm=='reg'" /> Regularized
-              </li>
-              <li>
-                <input type="radio" class="autosubmit" name="characterNormalization"
-                  value="regPlusNorm" tal:attributes="checked python:norm=='regPlusNorm'" />
-                Normalized
-              </li>
+              <li><input type="radio" class="autosubmit" name="characterNormalization" value="orig"
+                tal:attributes="checked python:norm=='orig'" /> Original</li>
+              <li><input type="radio" class="autosubmit" name="characterNormalization" value="reg"
+                tal:attributes="checked python:norm=='reg'" /> Regularized</li>
+              <li><input type="radio" class="autosubmit" name="characterNormalization" value="regPlusNorm"
+                tal:attributes="checked python:norm=='regPlusNorm'" /> Normalized</li>
             </ul>
             <input type="submit" value="Go!" />
@@ -160,6 +124,5 @@
         <!--  layer option boxes (rendered if active) -->
         <tal:block tal:repeat="layer availableLayers">
-          <tal:block
-            tal:define="mpath string:here/template/layer_text_${layer}/macros/options_box"
+          <tal:block tal:define="mpath string:here/template/layer_text_${layer}/macros/options_box"
             tal:condition="python:exists(mpath)">
             <metal:block metal:use-macro="python:path(mpath)" />
Index: zpt/viewer_xml.zpt
===================================================================
--- zpt/viewer_xml.zpt	(revision 512)
+++ zpt/viewer_xml.zpt	(revision 532)
@@ -46,10 +46,4 @@
           <metal:block metal:use-macro="here/template/common_template/macros/page_ruler" />
         </div>
-        <ul class="switcher">
-          <li>
-            <a tal:attributes="href python:here.getLink('viewMode','images')">Image</a>
-          </li>
-          <li class="sel">Text</li>
-        </ul>
         <div class="content">
           <div class="pageHeaderTitle" tal:condition="exists:pageinfo/pageHeaderTitle"
@@ -62,29 +56,6 @@
       <!-- right-side options -->
       <div class="col buttons">
-        <!--"BEGIN TEXT DISPLAY"  -->
-        <div class="options">
-          <h4>Text display</h4>
-          <form tal:attributes="action viewerUrl" class="autosubmit">
-            <input type="hidden"
-              tal:define="params python:here.getParams(params={'viewMode':None})"
-              tal:repeat="param params"
-              tal:attributes="name param; value python:params[param]" />
-            <ul>
-              <li>
-                <input class="autosubmit" type="radio" name="viewMode" value="text"
-                  tal:attributes="checked python:viewMode=='text'" /> Text
-              </li>
-              <li>
-                <input type="radio" class="autosubmit" name="viewMode" value="text"
-                  tal:attributes="checked python:viewMode=='xml'" /> XML
-              </li>
-            </ul>
-            <input type="submit" value="Go!" />
-          </form>
-        </div>
-        <!--"END TEXT DISPLAY"-->
-
         <!--"BEGIN TEXT SIZE"-->
-        <div class="options">
+        <!-- <div class="options">
           <h4>Text size</h4>
           <ul class="fsizer">
@@ -99,5 +70,5 @@
             </li>
           </ul>
-        </div>
+        </div> -->
         <!--"END TEXT SIZE"-->
 
