Index: css/docuviewer.css
===================================================================
--- css/docuviewer.css	(revision 583)
+++ css/docuviewer.css	(revision 590)
@@ -373,9 +373,9 @@
  * image page
  */
-div.col.main div.content.images {
+div.col.main div.content.image {
 	background-color: inherit;
 	padding: 0;
 }
-div.col.main div.content.images table {
+div.col.main div.content.image table {
 	border-collapse: collapse; /* for tight digilib */
 }
Index: documentViewer.py
===================================================================
--- documentViewer.py	(revision 589)
+++ documentViewer.py	(revision 590)
@@ -90,5 +90,5 @@
     viewer_text = PageTemplateFile('zpt/viewer_text', globals())
     viewer_xml = PageTemplateFile('zpt/viewer_xml', globals())
-    viewer_images = PageTemplateFile('zpt/viewer_images', globals())
+    viewer_image = PageTemplateFile('zpt/viewer_image', globals())
     viewer_index = PageTemplateFile('zpt/viewer_index', globals())
     viewer_thumbs = PageTemplateFile('zpt/viewer_thumbs', globals())
@@ -96,5 +96,5 @@
     # available layer types (annotator not default)
     builtinLayers = {'text': ['dict','search','gis'],
-                     'xml': None, 'images': None, 'index': ['extended']}
+                     'xml': None, 'image': None, 'index': ['extended']}
     availableLayers = builtinLayers;
     # layer templates
@@ -104,5 +104,5 @@
     layer_text_gis = PageTemplateFile('zpt/layer_text_gis', globals())
     layer_text_pundit = PageTemplateFile('zpt/layer_text_pundit', globals())
-    layer_images_annotator = PageTemplateFile('zpt/layer_images_annotator', globals())
+    layer_image_annotator = PageTemplateFile('zpt/layer_image_annotator', globals())
     layer_index_extended = PageTemplateFile('zpt/layer_index_extended', globals())
     # toc templates
@@ -211,12 +211,13 @@
         @param mode: defines how to access the document behind url 
         @param url: url which contains display information
-        @param viewMode: if images display images, if text display text, default is images (text,images or auto)
+        @param viewMode: image: display images, text: display text, default is auto (try text, else image)
         
         '''
         
         if not hasattr(self, 'template'):
-            # create template folder if it doesn't exist
-            self.manage_addFolder('template')
-            
+            # this won't work
+            logging.error("template folder missing!")
+            return "ERROR: template folder missing!"
+                        
         if not self.digilibBaseUrl:
             self.digilibBaseUrl = self.findDigilibUrl() or "http://nausikaa.mpiwg-berlin.mpg.de/digitallibrary"
@@ -232,5 +233,5 @@
                 viewMode="text"
             else:
-                viewMode="images"
+                viewMode="image"
                
         return pt(docinfo=docinfo,pageinfo=pageinfo,viewMode=viewMode)
@@ -243,5 +244,5 @@
         @param url: url which contains display information
         @param mode: defines how to access the document behind url 
-        @param viewMode: 'images': display images, 'text': display text, 'xml': display xml, default is 'auto'
+        @param viewMode: 'image': display images, 'text': display text, 'xml': display xml, default is 'auto'
         @param viewLayer: sub-type of viewMode, e.g. layer 'dict' for viewMode='text'
         @param tocMode: type of 'table of contents' for navigation (thumbs, text, figures, none)
@@ -280,5 +281,5 @@
                     viewLayer = "dict"
             else:
-                viewMode = "images"
+                viewMode = "image"
                 
         elif viewMode == "text_dict":
@@ -287,4 +288,9 @@
             viewLayer = "dict"
             
+        elif viewMode == 'images':
+            # legacy fix
+            viewMode = 'image'
+            self.REQUEST['viewMode'] = 'image'
+
         # safe viewLayer in userinfo
         userinfo['viewLayer'] = viewLayer
@@ -405,5 +411,5 @@
             try:
                 layers = json.loads(newLayerString)
-                if 'text' in layers and 'images' in layers:
+                if 'text' in layers and 'image' in layers:
                     self.availableLayers = layers
                     return
Index: zpt/common_template.zpt
===================================================================
--- zpt/common_template.zpt	(revision 584)
+++ zpt/common_template.zpt	(revision 590)
@@ -28,6 +28,6 @@
         <li tal:condition="docpath" 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:condition="python:docinfo.get('imagePath',None)" 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:condition="python:docinfo.get('imagePath',None)" tal:attributes="class python:here.getStyle(viewMode, 'image')"><a
+          tal:omit-tag="python:viewMode=='image'" tal:attributes="href python:here.getLink('viewMode','image')">Image</a></li>
         <li tal:condition="docpath" 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>
Index: zpt/layer_image_annotator.zpt
===================================================================
--- zpt/layer_image_annotator.zpt	(revision 590)
+++ zpt/layer_image_annotator.zpt	(revision 590)
@@ -0,0 +1,83 @@
+<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN"
+          "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
+<html xmlns="http://www.w3.org/1999/xhtml">
+<head>
+<metal:block metal:define-macro="html_head" tal:condition="python:'annotator' in viewLayers">
+  <!--  annotator for digilib -->
+  <script type="text/javascript" tal:attributes="src string:$dlBaseUrl/jquery/showdown.js"></script>
+  <script type="text/javascript" tal:attributes="src string:$dlBaseUrl/jquery/annotator-dl.js"></script>
+  <script type="text/javascript" tal:attributes="src string:$dlBaseUrl/jquery/jquery.digilib.annotator.js"></script>
+  <link rel="stylesheet" type="text/css" tal:attributes="href string:$dlBaseUrl/jquery/annotator.min.css"/>
+
+  <script type="text/javascript" 
+    tal:define="global annServerUrl string:http://tuxserve03.mpiwg-berlin.mpg.de/AnnotationManager;
+    global annTokenUrl string:$viewerUrl/template/token/getLoginToken;
+    annUrl python:'http://echo.mpiwg-berlin.mpg.de/documents%s?pn=%s'%(docinfo['documentPath'],pageinfo['pn']);
+    resUrl python:'http://echo.mpiwg-berlin.mpg.de/documents%s'%(docinfo['documentPath']);
+    global annUser python:here.getAuthenticatedUser(anon='anonymous');
+    global annGroup python:request.get('annotator_group', None);
+    permUser python:test(annGroup, 'group:%s'%annGroup, annUser);"
+    tal:content="structure string:
+    dlOpts.digilibFrontendPath='/jquery/digilib-ann.html';
+    dlOpts.annotationServerUrl='$annServerUrl/annotator';
+    dlOpts.annotationTokenUrl='$annTokenUrl';
+    dlOpts.annotationUser='$annUser';
+    dlOpts.annotatorPlugins=['Auth','Permissions','Store','Markdown','DigilibIntegrator'];
+    dlOpts.annotatorPluginSettings={'Store':{'annotationData':{'uri':'$annUrl','resource':'$resUrl'},'loadFromSearch':{'uri':'$annUrl'}},
+        'Permissions':{'read':[],'update':['$permUser'],'delete':['$permUser'],'admin':['$permUser']}};
+    "></script>
+</metal:block>
+
+</head>
+<body>
+  <!-- right-side options -->
+  <div class="col buttons">
+    <!-- LAYER DISPLAY OPTION  -->
+    <ul>
+      <li metal:define-macro="layer_select_li">
+        <input type="checkbox" class="autosubmit" name="viewLayer" value="annotator"
+          tal:attributes="checked python:'annotator' in viewLayers" /> Annotator
+      </li>
+    </ul>
+  </div>
+
+  <metal:block metal:define-macro="options_box" tal:condition="python:'annotator' in viewLayers">
+    <!-- BEGIN ANNOTATIONS -->
+    <div class="options">
+      <h4>Annotator</h4>
+      <ul>
+        <li><a href="javascript:$digilib.digilib('setAnnotationMark')"> <img tal:condition="exists:here/template/annotation-mark.png"
+            tal:attributes="src here/template/annotation-mark.png/absolute_url" /> annotate point
+        </a></li>
+        <li><a href="javascript:$digilib.digilib('setAnnotationRegion')"> <img tal:condition="exists:here/template/annotation-region.png"
+            tal:attributes="src here/template/annotation-region.png/absolute_url" /> annotate region
+        </a></li>
+      </ul>
+      <p>
+        User "<span tal:replace="annUser" />"<span tal:condition="annGroup" tal:content="string: ($annGroup)"/>.
+      </p>
+      <!-- TODO: login button -->
+      <form class="autosubmit" tal:attributes="action viewerUrl">
+        <input type="hidden" tal:define="params python:here.getParams(params={'annotator_group':None});" tal:repeat="param params"
+          tal:attributes="name param; value python:params[param]" />
+        <p>
+          In group
+          <select class="autosubmit" name="annotator_group">
+            <option value="" tal:attributes="selected not:annGroup;"> </option>
+            <option
+              tal:repeat="group python:here.getAnnotatorGroupsForUser(user=annUser,annotationServerUrl=annServerUrl)"
+              tal:attributes="value group/id; selected python:group['id']==annGroup;" tal:content="group/name" />
+          </select> <br /> 
+          <input type="submit" value="Go!" />
+        </p>
+      </form>
+      <p tal:define="std modules/Products.PythonScripts.standard">
+        <a class="button" tal:attributes="href python:'%s/login/login?came_from=%s'%(viewerUrl,std.url_quote(here.getLink()))">Log in</a>
+      </p>
+    </div>
+    <!-- END ANNOTATIONS -->
+  </metal:block>
+
+</body>
+
+</html>
Index: pt/layer_images_annotator.zpt
===================================================================
--- zpt/layer_images_annotator.zpt	(revision 587)
+++ 	(revision )
@@ -1,83 +1,0 @@
-<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN"
-          "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
-<html xmlns="http://www.w3.org/1999/xhtml">
-<head>
-<metal:block metal:define-macro="html_head" tal:condition="python:'annotator' in viewLayers">
-  <!--  annotator for digilib -->
-  <script type="text/javascript" tal:attributes="src string:$dlBaseUrl/jquery/showdown.js"></script>
-  <script type="text/javascript" tal:attributes="src string:$dlBaseUrl/jquery/annotator-dl.js"></script>
-  <script type="text/javascript" tal:attributes="src string:$dlBaseUrl/jquery/jquery.digilib.annotator.js"></script>
-  <link rel="stylesheet" type="text/css" tal:attributes="href string:$dlBaseUrl/jquery/annotator.min.css"/>
-
-  <script type="text/javascript" 
-    tal:define="global annServerUrl string:http://tuxserve03.mpiwg-berlin.mpg.de/AnnotationManager;
-    global annTokenUrl string:$viewerUrl/template/token/getLoginToken;
-    annUrl python:'http://echo.mpiwg-berlin.mpg.de/documents%s?pn=%s'%(docinfo['documentPath'],pageinfo['pn']);
-    resUrl python:'http://echo.mpiwg-berlin.mpg.de/documents%s'%(docinfo['documentPath']);
-    global annUser python:here.getAuthenticatedUser(anon='anonymous');
-    global annGroup python:request.get('annotator_group', None);
-    permUser python:test(annGroup, 'group:%s'%annGroup, annUser);"
-    tal:content="structure string:
-    dlOpts.digilibFrontendPath='/jquery/digilib-ann.html';
-    dlOpts.annotationServerUrl='$annServerUrl/annotator';
-    dlOpts.annotationTokenUrl='$annTokenUrl';
-    dlOpts.annotationUser='$annUser';
-    dlOpts.annotatorPlugins=['Auth','Permissions','Store','Markdown','DigilibIntegrator'];
-    dlOpts.annotatorPluginSettings={'Store':{'annotationData':{'uri':'$annUrl','resource':'$resUrl'},'loadFromSearch':{'uri':'$annUrl'}},
-        'Permissions':{'read':[],'update':['$permUser'],'delete':['$permUser'],'admin':['$permUser']}};
-    "></script>
-</metal:block>
-
-</head>
-<body>
-  <!-- right-side options -->
-  <div class="col buttons">
-    <!-- LAYER DISPLAY OPTION  -->
-    <ul>
-      <li metal:define-macro="layer_select_li">
-        <input type="checkbox" class="autosubmit" name="viewLayer" value="annotator"
-          tal:attributes="checked python:'annotator' in viewLayers" /> Annotator
-      </li>
-    </ul>
-  </div>
-
-  <metal:block metal:define-macro="options_box" tal:condition="python:'annotator' in viewLayers">
-    <!-- BEGIN ANNOTATIONS -->
-    <div class="options">
-      <h4>Annotator</h4>
-      <ul>
-        <li><a href="javascript:$digilib.digilib('setAnnotationMark')"> <img tal:condition="exists:here/template/annotation-mark.png"
-            tal:attributes="src here/template/annotation-mark.png/absolute_url" /> annotate point
-        </a></li>
-        <li><a href="javascript:$digilib.digilib('setAnnotationRegion')"> <img tal:condition="exists:here/template/annotation-region.png"
-            tal:attributes="src here/template/annotation-region.png/absolute_url" /> annotate region
-        </a></li>
-      </ul>
-      <p>
-        User "<span tal:replace="annUser" />"<span tal:condition="annGroup" tal:content="string: ($annGroup)"/>.
-      </p>
-      <!-- TODO: login button -->
-      <form class="autosubmit" tal:attributes="action viewerUrl">
-        <input type="hidden" tal:define="params python:here.getParams(params={'annotator_group':None});" tal:repeat="param params"
-          tal:attributes="name param; value python:params[param]" />
-        <p>
-          In group
-          <select class="autosubmit" name="annotator_group">
-            <option value="" tal:attributes="selected not:annGroup;"> </option>
-            <option
-              tal:repeat="group python:here.getAnnotatorGroupsForUser(user=annUser,annotationServerUrl=annServerUrl)"
-              tal:attributes="value group/id; selected python:group['id']==annGroup;" tal:content="group/name" />
-          </select> <br /> 
-          <input type="submit" value="Go!" />
-        </p>
-      </form>
-      <p tal:define="std modules/Products.PythonScripts.standard">
-        <a class="button" tal:attributes="href python:'%s/login/login?came_from=%s'%(viewerUrl,std.url_quote(here.getLink()))">Log in</a>
-      </p>
-    </div>
-    <!-- END ANNOTATIONS -->
-  </metal:block>
-
-</body>
-
-</html>
Index: zpt/viewer_image.zpt
===================================================================
--- zpt/viewer_image.zpt	(revision 590)
+++ zpt/viewer_image.zpt	(revision 590)
@@ -0,0 +1,165 @@
+<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN"
+    "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 pageinfo/viewMode;
+              viewLayer pageinfo/viewLayer; viewLayers pageinfo/viewLayers;
+              availableLayers python:here.getAvailableLayers().get('image', None);
+              tocMode pageinfo/tocMode; viewerUrl docinfo/viewerUrl;
+              numPages docinfo/numPages | nothing; dlBaseUrl docinfo/digilibBaseUrl | nothing;">
+<head>
+<meta http-equiv="Content-Type" content="text/html; charset=utf-8" />
+<title tal:content="python:docinfo.get('creator',' ') + ' - ' + docinfo.get('title',' ')" />
+<link rel="stylesheet" href="template/docuviewer_css" type="text/css" />
+<script type="text/javascript" tal:attributes="src string:$dlBaseUrl/jquery/jquery.js"></script>
+<script type="text/javascript" tal:attributes="src string:$dlBaseUrl/jquery/jquery.cookie.js"></script>
+<script type="text/javascript" tal:attributes="src string:$dlBaseUrl/jquery/jquery.digilib.js"></script>
+<script type="text/javascript" tal:attributes="src string:$dlBaseUrl/jquery/jquery.digilib.geometry.js"></script>
+<script type="text/javascript" tal:attributes="src string:$dlBaseUrl/jquery/jquery.digilib.arrows.js"></script>
+<script type="text/javascript" tal:attributes="src string:$dlBaseUrl/jquery/jquery.digilib.marks.js"></script>
+<link rel="stylesheet" type="text/css" tal:attributes="href string:$dlBaseUrl/jquery/jquery.digilib.css" />
+
+<script type="text/javascript"
+  tal:content="python:'''\n
+       var dlOpts = {\n
+            'interactionMode' : 'fullscreen',\n
+            'digilibBaseUrl' : '%s',\n
+            'fn' : '%s',\n
+            'pn' : '%s',\n
+            'suppressParamNames' : ['fn'],\n
+            'scalerInsets' : {'x':300, 'y':100}\n
+        };\n'''%(dlBaseUrl,docinfo.get('imagePath',''),pageinfo.get('pn','1'))"></script>
+
+<!--  layer headers (rendered always) -->
+<tal:block tal:repeat="layer availableLayers">
+  <tal:block tal:define="mpath string:here/template/layer_image_${layer}/macros/html_head" tal:condition="python:exists(mpath)">
+    <metal:block metal:use-macro="python:path(mpath)" />
+  </tal:block>
+</tal:block>
+
+<script type="text/javascript">
+	// <!--
+	$(document).ready(function() {
+		// autosubmit forms
+		$('form.autosubmit').find('.autosubmit').change(function() {
+			this.form.submit();
+		});
+		$('form.autosubmit input[type="submit"]').hide();
+		// get digilib div
+		$digilib = $('div#scaler');
+		// configure digilib
+		$digilib.digilib(dlOpts);
+	});
+// -->
+</script>
+</head>
+<body tal:condition="numPages">
+  <tal:block
+    tal:define="docpath docinfo/textURLPath | nothing;
+              pn pageinfo/pn; 
+              flowLtr python:docinfo.get('pageFlow','ltr')!='rtl';">
+    <div class="page-head">
+      <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)" />
+      </div>
+      <!-- col-main: document page -->
+      <div class="col main">
+        <div class="ruler top">
+          <metal:block metal:use-macro="here/template/common_template/macros/page_ruler" />
+        </div>
+        <div class="content image">
+          <div id="scaler">
+            <img tal:attributes="src string:${docinfo/imageURL}&pn=${pageinfo/pn}&dw=500&dh=500" />
+          </div>
+        </div>
+        <!-- /content -->
+      </div>
+      <!-- /col-main -->
+      
+      <div class="col buttons">
+        <!-- layer switcher -->
+        <div class="options" tal:condition="availableLayers">
+          <h4>Image layer</h4>
+          <form tal:attributes="action viewerUrl" class="autosubmit">
+            <input type="hidden" tal:define="params python:here.getParams(params={'viewLayer':None})"
+              tal:repeat="param params" tal:attributes="name param; value python:params[param]" />
+            <ul>
+              <!-- layer select buttons (rendered always) -->
+              <tal:block tal:repeat="layer availableLayers">
+                <tal:block tal:define="mpath string:here/template/layer_image_${layer}/macros/layer_select_li"
+                  tal:condition="python:exists(mpath)">
+                  <li metal:use-macro="python:path(mpath)" />
+                </tal:block>
+              </tal:block>
+            </ul>
+            <input type="submit" value="Go!" />
+          </form>
+        </div>
+
+        <!-- digilib options -->
+        <div class="options digilib">
+          <ul>
+            <li><a href="javascript:$digilib.digilib('zoomBy', 1.4)"> <img tal:condition="exists:here/template/zoom-in.png"
+                tal:attributes="src here/template/zoom-in.png/absolute_url" /> zoom in
+            </a></li>
+            <li><a href="javascript:$digilib.digilib('zoomBy', 0.7)"> <img
+                tal:condition="exists:here/template/zoom-out.png" tal:attributes="src here/template/zoom-out.png/absolute_url" />
+                zoom out
+            </a></li>
+            <li><a href="javascript:$digilib.digilib('zoomArea')"> <img tal:condition="exists:here/template/zoom-area.png"
+                tal:attributes="src here/template/zoom-area.png/absolute_url" /> zoom area
+            </a></li>
+            <li><a href="javascript:$digilib.digilib('zoomFull')"> <img tal:condition="exists:here/template/zoom-full.png"
+                tal:attributes="src here/template/zoom-full.png/absolute_url" /> full page
+            </a></li>
+            <li><a href="javascript:$digilib.digilib('zoomFull', 'width')"> <img
+                tal:condition="exists:here/template/pagewidth.png" tal:attributes="src here/template/pagewidth.png/absolute_url" /> page
+                width
+            </a></li>
+            <li><a href="javascript:$digilib.digilib('setMark')"> <img tal:condition="exists:here/template/mark.png"
+                tal:attributes="src here/template/mark.png/absolute_url" /> set mark
+            </a></li>
+            <li><a href="javascript:$digilib.digilib('removeMark')"> <img tal:condition="exists:here/template/delmark.png"
+                tal:attributes="src here/template/delmark.png/absolute_url" /> remove mark
+            </a></li>
+            <li><a href="javascript:$digilib.digilib('reference')"> <img tal:condition="exists:here/template/reference.png"
+                tal:attributes="src here/template/reference.png/absolute_url" /> get reference
+            </a></li>
+            <li><a href="javascript:$digilib.digilib('digilibUrl', 'open_new')"> <img
+                tal:condition="exists:here/template/digilib.png" tal:attributes="src here/template/digilib.png/absolute_url" />
+                digilib
+            </a></li>
+          </ul>
+        </div>
+
+        <!--  layer option boxes (rendered if active) -->
+        <tal:block tal:repeat="layer availableLayers">
+          <tal:block tal:define="mpath string:here/template/layer_image_${layer}/macros/options_box"
+            tal:condition="python:exists(mpath)">
+            <metal:block metal:use-macro="python:path(mpath)" />
+          </tal:block>
+        </tal:block>
+      </div>
+    </div><!-- /page-body -->
+    
+    <div class="page-body" tal:condition="python:not here.isAccessible(docinfo)">
+      <div class="errortext">Sorry, access to this document is restricted.</div>
+    </div>
+    <tal:block tal:condition="exists:here/template/site_template.pt/macros/footer">
+      <!-- footer -->
+      <metal:block metal:use-macro="here/template/site_template.pt/macros/footer"/>
+    </tal:block>
+    
+  </tal:block>
+</body>
+<body tal:condition="not:numPages">
+  <div class="errortext">Sorry, document doesn't exist.</div>
+  <tal:block tal:condition="exists:here/template/site_template.pt/macros/footer">
+    <!-- footer -->
+    <metal:block metal:use-macro="here/template/site_template.pt/macros/footer"/>
+  </tal:block>
+</body>
+</html>
Index: pt/viewer_images.zpt
===================================================================
--- zpt/viewer_images.zpt	(revision 585)
+++ 	(revision )
@@ -1,165 +1,0 @@
-<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN"
-    "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 pageinfo/viewMode;
-              viewLayer pageinfo/viewLayer; viewLayers pageinfo/viewLayers;
-              availableLayers python:here.getAvailableLayers().get('images', None);
-              tocMode pageinfo/tocMode; viewerUrl docinfo/viewerUrl;
-              numPages docinfo/numPages | nothing; dlBaseUrl docinfo/digilibBaseUrl | nothing;">
-<head>
-<meta http-equiv="Content-Type" content="text/html; charset=utf-8" />
-<title tal:content="python:docinfo.get('creator',' ') + ' - ' + docinfo.get('title',' ')" />
-<link rel="stylesheet" href="template/docuviewer_css" type="text/css" />
-<script type="text/javascript" tal:attributes="src string:$dlBaseUrl/jquery/jquery.js"></script>
-<script type="text/javascript" tal:attributes="src string:$dlBaseUrl/jquery/jquery.cookie.js"></script>
-<script type="text/javascript" tal:attributes="src string:$dlBaseUrl/jquery/jquery.digilib.js"></script>
-<script type="text/javascript" tal:attributes="src string:$dlBaseUrl/jquery/jquery.digilib.geometry.js"></script>
-<script type="text/javascript" tal:attributes="src string:$dlBaseUrl/jquery/jquery.digilib.arrows.js"></script>
-<script type="text/javascript" tal:attributes="src string:$dlBaseUrl/jquery/jquery.digilib.marks.js"></script>
-<link rel="stylesheet" type="text/css" tal:attributes="href string:$dlBaseUrl/jquery/jquery.digilib.css" />
-
-<script type="text/javascript"
-  tal:content="python:'''\n
-       var dlOpts = {\n
-            'interactionMode' : 'fullscreen',\n
-            'digilibBaseUrl' : '%s',\n
-            'fn' : '%s',\n
-            'pn' : '%s',\n
-            'suppressParamNames' : ['fn'],\n
-            'scalerInsets' : {'x':300, 'y':100}\n
-        };\n'''%(dlBaseUrl,docinfo.get('imagePath',''),pageinfo.get('pn','1'))"></script>
-
-<!--  layer headers (rendered always) -->
-<tal:block tal:repeat="layer availableLayers">
-  <tal:block tal:define="mpath string:here/template/layer_images_${layer}/macros/html_head" tal:condition="python:exists(mpath)">
-    <metal:block metal:use-macro="python:path(mpath)" />
-  </tal:block>
-</tal:block>
-
-<script type="text/javascript">
-	// <!--
-	$(document).ready(function() {
-		// autosubmit forms
-		$('form.autosubmit').find('.autosubmit').change(function() {
-			this.form.submit();
-		});
-		$('form.autosubmit input[type="submit"]').hide();
-		// get digilib div
-		$digilib = $('div#scaler');
-		// configure digilib
-		$digilib.digilib(dlOpts);
-	});
-// -->
-</script>
-</head>
-<body tal:condition="numPages">
-  <tal:block
-    tal:define="docpath docinfo/textURLPath | nothing;
-              pn pageinfo/pn; 
-              flowLtr python:docinfo.get('pageFlow','ltr')!='rtl';">
-    <div class="page-head">
-      <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)" />
-      </div>
-      <!-- col-main: document page -->
-      <div class="col main">
-        <div class="ruler top">
-          <metal:block metal:use-macro="here/template/common_template/macros/page_ruler" />
-        </div>
-        <div class="content images">
-          <div id="scaler">
-            <img tal:attributes="src string:${docinfo/imageURL}&pn=${pageinfo/pn}&dw=500&dh=500" />
-          </div>
-        </div>
-        <!-- /content -->
-      </div>
-      <!-- /col-main -->
-      
-      <div class="col buttons">
-        <!-- layer switcher -->
-        <div class="options" tal:condition="availableLayers">
-          <h4>Image layer</h4>
-          <form tal:attributes="action viewerUrl" class="autosubmit">
-            <input type="hidden" tal:define="params python:here.getParams(params={'viewLayer':None})"
-              tal:repeat="param params" tal:attributes="name param; value python:params[param]" />
-            <ul>
-              <!-- layer select buttons (rendered always) -->
-              <tal:block tal:repeat="layer availableLayers">
-                <tal:block tal:define="mpath string:here/template/layer_images_${layer}/macros/layer_select_li"
-                  tal:condition="python:exists(mpath)">
-                  <li metal:use-macro="python:path(mpath)" />
-                </tal:block>
-              </tal:block>
-            </ul>
-            <input type="submit" value="Go!" />
-          </form>
-        </div>
-
-        <!-- digilib options -->
-        <div class="options digilib">
-          <ul>
-            <li><a href="javascript:$digilib.digilib('zoomBy', 1.4)"> <img tal:condition="exists:here/template/zoom-in.png"
-                tal:attributes="src here/template/zoom-in.png/absolute_url" /> zoom in
-            </a></li>
-            <li><a href="javascript:$digilib.digilib('zoomBy', 0.7)"> <img
-                tal:condition="exists:here/template/zoom-out.png" tal:attributes="src here/template/zoom-out.png/absolute_url" />
-                zoom out
-            </a></li>
-            <li><a href="javascript:$digilib.digilib('zoomArea')"> <img tal:condition="exists:here/template/zoom-area.png"
-                tal:attributes="src here/template/zoom-area.png/absolute_url" /> zoom area
-            </a></li>
-            <li><a href="javascript:$digilib.digilib('zoomFull')"> <img tal:condition="exists:here/template/zoom-full.png"
-                tal:attributes="src here/template/zoom-full.png/absolute_url" /> full page
-            </a></li>
-            <li><a href="javascript:$digilib.digilib('zoomFull', 'width')"> <img
-                tal:condition="exists:here/template/pagewidth.png" tal:attributes="src here/template/pagewidth.png/absolute_url" /> page
-                width
-            </a></li>
-            <li><a href="javascript:$digilib.digilib('setMark')"> <img tal:condition="exists:here/template/mark.png"
-                tal:attributes="src here/template/mark.png/absolute_url" /> set mark
-            </a></li>
-            <li><a href="javascript:$digilib.digilib('removeMark')"> <img tal:condition="exists:here/template/delmark.png"
-                tal:attributes="src here/template/delmark.png/absolute_url" /> remove mark
-            </a></li>
-            <li><a href="javascript:$digilib.digilib('reference')"> <img tal:condition="exists:here/template/reference.png"
-                tal:attributes="src here/template/reference.png/absolute_url" /> get reference
-            </a></li>
-            <li><a href="javascript:$digilib.digilib('digilibUrl', 'open_new')"> <img
-                tal:condition="exists:here/template/digilib.png" tal:attributes="src here/template/digilib.png/absolute_url" />
-                digilib
-            </a></li>
-          </ul>
-        </div>
-
-        <!--  layer option boxes (rendered if active) -->
-        <tal:block tal:repeat="layer availableLayers">
-          <tal:block tal:define="mpath string:here/template/layer_images_${layer}/macros/options_box"
-            tal:condition="python:exists(mpath)">
-            <metal:block metal:use-macro="python:path(mpath)" />
-          </tal:block>
-        </tal:block>
-      </div>
-    </div><!-- /page-body -->
-    
-    <div class="page-body" tal:condition="python:not here.isAccessible(docinfo)">
-      <div class="errortext">Sorry, access to this document is restricted.</div>
-    </div>
-    <tal:block tal:condition="exists:here/template/site_template.pt/macros/footer">
-      <!-- footer -->
-      <metal:block metal:use-macro="here/template/site_template.pt/macros/footer"/>
-    </tal:block>
-    
-  </tal:block>
-</body>
-<body tal:condition="not:numPages">
-  <div class="errortext">Sorry, document doesn't exist.</div>
-  <tal:block tal:condition="exists:here/template/site_template.pt/macros/footer">
-    <!-- footer -->
-    <metal:block metal:use-macro="here/template/site_template.pt/macros/footer"/>
-  </tal:block>
-</body>
-</html>
