]> granicus.if.org Git - docbook-dsssl/commitdiff
Complete rewrite; this is now the simple, linear, non-framed version
authorNorman Walsh <ndw@nwalsh.com>
Mon, 9 Apr 2001 11:24:53 +0000 (11:24 +0000)
committerNorman Walsh <ndw@nwalsh.com>
Mon, 9 Apr 2001 11:24:53 +0000 (11:24 +0000)
slides/xsl/slides.xsl

index eb2b0858b5fdff3a5a90a1934ba2fb92b05e47fc..6930c5a0b588faf22be34351292e3a50509e8e9c 100644 (file)
@@ -3,15 +3,10 @@
                version="1.0">
 
 <xsl:import href="/sourceforge/docbook/xsl/html/chunk.xsl"/>
-<xsl:include href="slidechunk.xsl"/>
-<xsl:include href="slidenav.xsl"/>
 
-<xsl:strip-space elements="slides foil section"/>
+<xsl:output method="html"/>
 
-<xsl:param name="chunk">1</xsl:param>
-<xsl:param name="ie5">0</xsl:param>
-<xsl:param name="ns4">0</xsl:param>
-<xsl:param name="multiframe">0</xsl:param>
+<xsl:strip-space elements="slides foil section"/>
 
 <xsl:param name="css-stylesheet">slides.css</xsl:param>
 <xsl:param name="graphics.dir">graphics</xsl:param>
 <xsl:param name="right.image" select="'right.gif'"/>
 <xsl:param name="left.image" select="'left.gif'"/>
 
+<xsl:param name="script.dir" select="''"/>
 <xsl:param name="slides.js" select="'slides.js'"/>
 <xsl:param name="list.js" select="'list.js'"/>
 <xsl:param name="resize.js" select="'resize.js'"/>
 
+<xsl:param name="titlefoil.html" select="'index.html'"/>
+
 <xsl:param name="toc.bg.color">#FFFFFF</xsl:param>
 <xsl:param name="toc.width">250</xsl:param>
 
 
 <!-- ============================================================ -->
 
-<xsl:template match="/">
-  <xsl:apply-templates/>
+<xsl:template name="graphics.dir">
+  <!-- danger will robinson: template shadows parameter -->
+  <xsl:variable name="source.graphics.dir">
+    <xsl:call-template name="dbhtml-attribute">
+      <xsl:with-param name="pis" select="/processing-instruction('dbhtml')"/>
+      <xsl:with-param name="attribute" select="'graphics-dir'"/>
+    </xsl:call-template>
+  </xsl:variable>
+
+  <xsl:choose>
+    <xsl:when test="$source.graphics.dir != ''">
+      <xsl:value-of select="$source.graphics.dir"/>
+    </xsl:when>
+    <xsl:otherwise>
+      <xsl:value-of select="$graphics.dir"/>
+    </xsl:otherwise>
+  </xsl:choose>
 </xsl:template>
 
-<xsl:template match="slides">
-  <xsl:variable name="title">
-    <xsl:choose>
-      <xsl:when test="(slidesinfo/titleabbrev|titleabbrev)">
-        <xsl:value-of select="(slidesinfo/titleabbrev|titleabbrev)[1]"/>
-      </xsl:when>
-      <xsl:otherwise>
-        <xsl:value-of select="(slidesinfo/title|title)[1]"/>
-      </xsl:otherwise>
-    </xsl:choose>
+<xsl:template name="css-stylesheet">
+  <!-- danger will robinson: template shadows parameter -->
+  <xsl:variable name="source.css-stylesheet">
+    <xsl:call-template name="dbhtml-attribute">
+      <xsl:with-param name="pis" select="/processing-instruction('dbhtml')"/>
+      <xsl:with-param name="attribute" select="'css-stylesheet'"/>
+    </xsl:call-template>
   </xsl:variable>
-  <xsl:variable name="toc.rows" select="1+count(//section)+count(//foil)"/>
-  <xsl:variable name="toc.height" select="$toc.rows * $toc.row.height"/>
 
   <xsl:choose>
-    <xsl:when test="$chunk=0">
-      <!--nop-->
+    <xsl:when test="$source.css-stylesheet != ''">
+      <xsl:value-of select="$source.css-stylesheet"/>
     </xsl:when>
     <xsl:otherwise>
-      <xsl:call-template name="write.chunk">
-        <xsl:with-param name="filename" select="'frames.html'"/>
-        <xsl:with-param name="content">
-          <html>
-            <head>
-              <title><xsl:value-of select="$title"/></title>
-            </head>
-            <frameset border="1" cols="{$toc.width},*" name="topframe">
-              <frame src="toc.html" name="toc"/>
-              <frame src="titlefoil.html" name="foil"/>
-              <noframes>
-                <body class="frameset" xsl:use-attribute-sets="body-attrs">
-                  <a href="titleframe.html">
-                    <xsl:text>Your browser doesn't support frames.</xsl:text>
-                  </a>
-                </body>
-              </noframes>
-            </frameset>
-          </html>
-        </xsl:with-param>
-      </xsl:call-template>
+      <xsl:value-of select="$css-stylesheet"/>
     </xsl:otherwise>
   </xsl:choose>
+</xsl:template>
+
+<xsl:template name="script-file">
+  <xsl:param name="js" select="'slides.js'"/>
+
+  <xsl:variable name="source.script.dir">
+    <xsl:call-template name="dbhtml-attribute">
+      <xsl:with-param name="pis" select="/processing-instruction('dbhtml')"/>
+      <xsl:with-param name="attribute" select="'script-dir'"/>
+    </xsl:call-template>
+  </xsl:variable>
 
   <xsl:choose>
-    <xsl:when test="$chunk=0">
+    <xsl:when test="$source.script.dir != ''">
+      <xsl:value-of select="$source.script.dir"/>
+      <xsl:text>/</xsl:text>
+    </xsl:when>
+    <xsl:when test="$script.dir != ''">
+      <xsl:value-of select="$script.dir"/>
+      <xsl:text>/</xsl:text>
+    </xsl:when>
+  </xsl:choose>
+  <xsl:value-of select="$js"/>
+</xsl:template>
+
+<xsl:template name="slides.js">
+  <!-- danger will robinson: template shadows parameter -->
+  <xsl:call-template name="script-file">
+    <xsl:with-param name="js" select="$slides.js"/>
+  </xsl:call-template>
+</xsl:template>
+
+<xsl:template name="list.js">
+  <!-- danger will robinson: template shadows parameter -->
+  <xsl:call-template name="script-file">
+    <xsl:with-param name="js" select="$list.js"/>
+  </xsl:call-template>
+</xsl:template>
+
+<xsl:template name="resize.js">
+  <!-- danger will robinson: template shadows parameter -->
+  <xsl:call-template name="script-file">
+    <xsl:with-param name="js" select="$resize.js"/>
+  </xsl:call-template>
+</xsl:template>
+
+<!-- ============================================================ -->
+
+<xsl:template match="/">
+  <xsl:apply-templates/>
+</xsl:template>
+
+<xsl:template match="slides">
+  <xsl:call-template name="write.chunk">
+    <xsl:with-param name="filename" select="'toc.html'"/>
+    <xsl:with-param name="content">
       <html>
-        <body class="foil" xsl:use-attribute-sets="body-attrs">
-          <xsl:apply-templates/>
+        <head>
+          <title><xsl:value-of select="title"/></title>
+          <link type="text/css" rel="stylesheet">
+            <xsl:attribute name="href">
+              <xsl:call-template name="css-stylesheet"/>
+            </xsl:attribute>
+          </link>
+        </head>
+        <body class="tocpage" xsl:use-attribute-sets="body-attrs">
+          <h1>
+            <a href="{$titlefoil.html}">
+              <xsl:value-of select="/slides/slidesinfo/title"/>
+            </a>
+          </h1>
+          <xsl:apply-templates select="." mode="toc"/>
+
+          <div class="navfoot" style="padding-top: 2in;">
+            <table width="100%" border="0"
+                   cellspacing="0" cellpadding="0"
+                   summary="Navigation">
+              <tr>
+                <td align="left" width="80%" valign="top">
+                  <span class="navfooter">
+                    <xsl:apply-templates select="/slides/slidesinfo/copyright"
+                                         mode="slide.navigation.mode"/>
+                  </span>
+                </td>
+                <td align="right" width="20%" valign="top">
+                  <a href="{$titlefoil.html}">
+                    <img alt="Next" border="0">
+                      <xsl:attribute name="src">
+                        <xsl:call-template name="graphics.dir"/>
+                        <xsl:text>/</xsl:text>
+                        <xsl:value-of select="$right.image"/>
+                      </xsl:attribute>
+                    </img>
+                  </a>
+                </td>
+              </tr>
+            </table>
+          </div>
         </body>
       </html>
-    </xsl:when>
-    <xsl:otherwise>
-      <xsl:if test="$ie5 != 0">
-        <xsl:call-template name="write.chunk">
-          <xsl:with-param name="filename" select="'ie5toc.html'"/>
-          <xsl:with-param name="content">
-            <html>
-              <head>
-                <title>TOC - <xsl:value-of select="$title"/></title>
-                <link type="text/css" rel="stylesheet"
-                      href="{$css-stylesheet}"/>
-                <script type="text/javascript" language="JavaScript" src="{$slides.js}"/>
-              </head>
-              <body class="toc" xsl:use-attribute-sets="body-attrs"
-                    onload="newPage('toc.html');">
-                <div class="toc">
-                  <xsl:apply-templates mode="toc"/>
-                </div>
-              </body>
-            </html>
-          </xsl:with-param>
-        </xsl:call-template>
-      </xsl:if>
-
-      <xsl:if test="$ns4 != 0">
-        <xsl:call-template name="write.chunk">
-          <xsl:with-param name="filename" select="'ns4toc.html'"/>
-          <xsl:with-param name="content">
-            <html>
-              <head>
-                <title>TOC - <xsl:value-of select="$title"/></title>
-                <link type="text/css" rel="stylesheet"
-                      href="{$css-stylesheet}"/>
-                <script type="text/javascript" language="JavaScript1.2" src="{$list.js}"></script>
-                <script type="text/javascript" language="JavaScript1.2" src="{$resize.js}"></script>
-                <script type="text/javascript" language="JavaScript"><xsl:text>
-function init() {
-  var width = </xsl:text>
-<xsl:value-of select="$toc.width"/>
-<xsl:text>, height = </xsl:text>
-<xsl:value-of select="$toc.row.height"/>
-<xsl:text>;
-  myList = new List(true, width, height, "</xsl:text>
-<xsl:value-of select="$toc.bg.color"/>
-<xsl:text>");
-</xsl:text>
-                <xsl:apply-templates mode="ns-toc"/>
-<xsl:text>
-  myList.build(0,0);
-}
-</xsl:text>
-                </script>
-                <style type="text/css"><xsl:text>
-  #spacer { position: absolute; height: </xsl:text>
-                <xsl:value-of select="$toc.height"/>
-  <xsl:text>; }
-</xsl:text>
-</style>
-              </head>
-              <body class="toc" xsl:use-attribute-sets="body-attrs"
-                    onload="init();">
-                <div id="spacer"></div>
-              </body>
-            </html>
-          </xsl:with-param>
-        </xsl:call-template>
-      </xsl:if>
+    </xsl:with-param>
+  </xsl:call-template>
 
-      <xsl:call-template name="write.chunk">
-        <xsl:with-param name="filename" select="'toc.html'"/>
-        <xsl:with-param name="content">
-          <html>
-            <head>
-              <title>TOC - <xsl:value-of select="$title"/></title>
-              <link type="text/css" rel="stylesheet" href="{$css-stylesheet}"/>
-              <script type="text/javascript" language="JavaScript" src="{$slides.js}"/>
-              <script type="text/javascript" language="JavaScript">
-                <xsl:if test="$ns4 != 0">
-                  <xsl:text><![CDATA[
-if (selectBrowser() == "ns4") {
-      location.replace("ns4toc.html");
-}
-]]></xsl:text>
-                </xsl:if>
-                <xsl:if test="$ie5 != 0">
-                  <xsl:text><![CDATA[
-if (selectBrowser() == "ie5") {
-      location.replace("ie5toc.html");
-}
-]]></xsl:text>
-                </xsl:if>
-              </script>
-            </head>
-            <body class="toc" xsl:use-attribute-sets="body-attrs">
-              <div class="toc">
-                <xsl:apply-templates mode="toc"/>
-              </div>
-            </body>
-          </html>
-        </xsl:with-param>
-      </xsl:call-template>
-
-      <xsl:apply-templates/>
-    </xsl:otherwise>
-  </xsl:choose>
+  <xsl:apply-templates/>
 </xsl:template>
 
 <!-- ============================================================ -->
 
 <xsl:template match="slidesinfo">
-  <xsl:choose>
-    <xsl:when test="$chunk=0">
-      <div class="{name(.)}">
-       <xsl:apply-templates/>
-      </div>
-    </xsl:when>
-    <xsl:otherwise>
-      <xsl:call-template name="write.chunk">
-        <xsl:with-param name="filename" select="'titlefoil.html'"/>
-        <xsl:with-param name="content">
-          <html>
-            <head>
-              <title><xsl:value-of select="title"/></title>
-              <link type="text/css" rel="stylesheet" href="{$css-stylesheet}"/>
-              <xsl:if test="$ie5 != '0'">
-                <script type="text/javascript" language="JavaScript" src="{$slides.js}"/>
-              </xsl:if>
-            </head>
-            <body class="titlepage" xsl:use-attribute-sets="body-attrs">
-              <xsl:if test="$ie5!='0'">
-                <xsl:attribute name="onload">
-                  <xsl:text>newPage('titlefoil.html');</xsl:text>
-                </xsl:attribute>
-                <xsl:attribute name="onkeypress">
-                  <xsl:text>navigate('','foil01.html');</xsl:text>
-                </xsl:attribute>
-              </xsl:if>
-              <div class="{name(.)}">
-                <xsl:apply-templates mode="titlepage.mode"/>
-              </div>
-
-              <xsl:choose>
-                <xsl:when test="$multiframe=0">
-                  <div class="navfoot" style="padding-top: 2in;">
-                    <table width="100%" border="0"
-                           cellspacing="0" cellpadding="0"
-                           summary="Navigation">
-                      <tr>
-                        <td align="left" width="80%" valign="top">
-                          <span class="navfooter">
-                            <xsl:apply-templates select="/slides/slidesinfo/copyright"
-                                                 mode="slide.navigation.mode"/>
-                          </span>
-                        </td>
-                        <td align="right" width="20%" valign="top">
-                          <a href="foil01.html">
-                            <img alt="Next" src="{$graphics.dir}/{$right.image}" border="0"/>
-                          </a>
-                        </td>
-                      </tr>
-                    </table>
-                  </div>
-                </xsl:when>
-                <xsl:otherwise>
-                  <div class="navfoot" style="padding-top: 2in;">
-                    <table width="100%" border="0"
-                           cellspacing="0" cellpadding="0"
-                           summary="Navigation">
-                      <tr>
-                        <td align="center" width="100%" valign="top">
-                          <span class="navfooter">
-                            <xsl:apply-templates select="/slides/slidesinfo/copyright"
-                                                 mode="slide.navigation.mode"/>
-                          </span>
-                        </td>
-                      </tr>
-                    </table>
-                  </div>
-                </xsl:otherwise>
-              </xsl:choose>
-            </body>
-          </html>
-        </xsl:with-param>
-      </xsl:call-template>
-    </xsl:otherwise>
-  </xsl:choose>
+  <xsl:call-template name="write.chunk">
+    <xsl:with-param name="filename" select="$titlefoil.html"/>
+    <xsl:with-param name="content">
+      <html>
+        <head>
+          <title><xsl:value-of select="title"/></title>
+          <link type="text/css" rel="stylesheet">
+            <xsl:attribute name="href">
+              <xsl:call-template name="css-stylesheet"/>
+            </xsl:attribute>
+          </link>
+        </head>
+        <body class="titlepage" xsl:use-attribute-sets="body-attrs">
+          <div class="navhead">
+            <table width="100%" border="0" cellpadding="0" cellspacing="0"
+                   summary="Navigation">
+              <tr>
+                <td align="left" width="10%">
+                  <a href="toc.html">
+                    <xsl:text>Contents</xsl:text>
+                  </a>
+                </td>
+                <td align="center" width="80%">
+                  <xsl:text>&#160;</xsl:text>
+                </td>
+                <td align="right" width="10%">
+                  <xsl:text>&#160;</xsl:text>
+                </td>
+              </tr>
+            </table>
+          </div>
+
+          <div class="{name(.)}">
+            <xsl:apply-templates mode="titlepage.mode"/>
+          </div>
+
+          <div class="navfoot" style="padding-top: 2in;">
+            <table width="100%" border="0"
+                   cellspacing="0" cellpadding="0"
+                   summary="Navigation">
+              <tr>
+                <td align="left" width="80%" valign="top">
+                  <span class="navfooter">
+                    <xsl:apply-templates select="/slides/slidesinfo/copyright"
+                                         mode="slide.navigation.mode"/>
+                  </span>
+                </td>
+                <td align="right" width="20%" valign="top">
+                  <a href="foil01.html">
+                    <img alt="Next" border="0">
+                      <xsl:attribute name="src">
+                        <xsl:call-template name="graphics.dir"/>
+                        <xsl:text>/</xsl:text>
+                        <xsl:value-of select="$right.image"/>
+                      </xsl:attribute>
+                    </img>
+                  </a>
+                </td>
+              </tr>
+            </table>
+          </div>
+        </body>
+      </html>
+    </xsl:with-param>
+  </xsl:call-template>
 </xsl:template>
 
 <xsl:template match="slidesinfo/title">
@@ -301,9 +269,7 @@ if (selectBrowser() == "ie5") {
 </xsl:template>
 
 <xsl:template match="slidesinfo/copyright">
-  <xsl:if test="$chunk=0">
-    <xsl:apply-templates select="." mode="titlepage.mode"/>
-  </xsl:if>
+  <!-- nop -->
 </xsl:template>
 
 <xsl:template match="copyright" mode="slide.navigation.mode">
@@ -351,256 +317,42 @@ if (selectBrowser() == "ie5") {
       <xsl:when test="preceding::foil">
         <xsl:apply-templates select="preceding::foil[1]" mode="filename"/>
       </xsl:when>
-      <xsl:otherwise>titlefoil.html</xsl:otherwise>
+      <xsl:otherwise>
+        <xsl:value-of select="$titlefoil.html"/>
+      </xsl:otherwise>
     </xsl:choose>
   </xsl:variable>
 
-  <xsl:choose>
-    <xsl:when test="$chunk=0">
-      <hr/>
-      <div class="{name(.)}" id="{$id}">
-       <a name="{$id}"/>
-       <xsl:apply-templates select="title"/>
-      </div>
-    </xsl:when>
-    <xsl:otherwise>
-      <xsl:call-template name="write.chunk">
-        <xsl:with-param name="filename" select="$thissection"/>
-        <xsl:with-param name="content">
-          <head>
-            <title><xsl:value-of select="title"/></title>
-            <link type="text/css" rel="stylesheet" href="{$css-stylesheet}"/>
-            <xsl:if test="$ie5 != '0'">
-              <script type="text/javascript" language="JavaScript" src="{$slides.js}"/>
-            </xsl:if>
-          </head>
-          <xsl:choose>
-            <xsl:when test="$multiframe != 0">
-              <xsl:apply-templates select="." mode="multiframe"/>
-            </xsl:when>
-            <xsl:otherwise>
-              <xsl:apply-templates select="." mode="singleframe"/>
-            </xsl:otherwise>
-          </xsl:choose>
-        </xsl:with-param>
-      </xsl:call-template>
-    </xsl:otherwise>
-  </xsl:choose>
-
-  <xsl:if test="$multiframe != 0">
-    <xsl:apply-templates select="." mode="multiframe-top"/>
-    <xsl:apply-templates select="." mode="multiframe-body"/>
-    <xsl:apply-templates select="." mode="multiframe-bottom"/>
-  </xsl:if>
-
-  <xsl:apply-templates select="foil"/>
-</xsl:template>
-
-<xsl:template match="section" mode="multiframe">
-  <xsl:variable name="snumber">
-    <xsl:number count="section" level="any"/>
-  </xsl:variable>
-
-  <xsl:variable name="thissection">
-    <xsl:text>section</xsl:text>
-    <xsl:number value="$snumber" format="01"/>
-    <xsl:text>.html</xsl:text>
-  </xsl:variable>
-
-  <frameset rows="25,*,25" border="0" name="foil" framespacing="0">
-    <frame src="top-{$thissection}" name="top" marginheight="0" scrolling="no"/>
-    <frame src="body-{$thissection}" name="body" marginheight="0"/>
-    <frame src="bot-{$thissection}" name="bottom" marginheight="0" scrolling="no"/>
-    <noframes>
-      <body class="frameset" xsl:use-attribute-sets="body-attrs">
-        <p>
-          <xsl:text>Your browser doesn't support frames.</xsl:text>
-        </p>
-      </body>
-    </noframes>
-  </frameset>
-</xsl:template>
-
-<xsl:template match="section" mode="multiframe-top">
-  <xsl:variable name="section">
-    <xsl:text>section</xsl:text>
-    <xsl:number count="section" level="any" format="01"/>
-    <xsl:text>.html</xsl:text>
-  </xsl:variable>
-
   <xsl:call-template name="write.chunk">
-    <xsl:with-param name="filename" select="concat('top-',$section)"/>
+    <xsl:with-param name="filename" select="$thissection"/>
     <xsl:with-param name="content">
-      <html>
-        <head>
-          <title>Navigation</title>
-          <link type="text/css" rel="stylesheet" href="{$css-stylesheet}"/>
-          <xsl:if test="$ie5 != '0'">
-            <script type="text/javascript" language="JavaScript" src="{$slides.js}"/>
-          </xsl:if>
-        </head>
-        <body class="navigation">
+      <head>
+        <title><xsl:value-of select="title"/></title>
+        <link type="text/css" rel="stylesheet">
+          <xsl:attribute name="href">
+            <xsl:call-template name="css-stylesheet"/>
+          </xsl:attribute>
+        </link>
+      </head>
+      <body class="section" xsl:use-attribute-sets="body-attrs">
+        <div class="{name(.)}" id="{$id}">
+          <a name="{$id}"/>
           <xsl:call-template name="section-top-nav"/>
-        </body>
-      </html>
-    </xsl:with-param>
-  </xsl:call-template>
-</xsl:template>
-
-<xsl:template match="section" mode="multiframe-body">
-  <xsl:variable name="id">
-    <xsl:call-template name="object.id"/>
-  </xsl:variable>
-
-  <xsl:variable name="snumber">
-    <xsl:number count="section" level="any"/>
-  </xsl:variable>
-
-  <xsl:variable name="thissection">
-    <xsl:text>section</xsl:text>
-    <xsl:number value="$snumber" format="01"/>
-    <xsl:text>.html</xsl:text>
-  </xsl:variable>
-
-  <xsl:variable name="nextfoil">
-    <xsl:apply-templates select="foil[1]" mode="filename"/>
-  </xsl:variable>
-
-  <xsl:variable name="prevfoil">
-    <xsl:choose>
-      <xsl:when test="preceding::foil">
-        <xsl:apply-templates select="preceding::foil[1]" mode="filename"/>
-      </xsl:when>
-      <xsl:otherwise>titlefoil.html</xsl:otherwise>
-    </xsl:choose>
-  </xsl:variable>
-
-  <xsl:call-template name="write.chunk">
-    <xsl:with-param name="filename" select="concat('body-',$thissection)"/>
-    <xsl:with-param name="content">
-      <html>
-        <head>
-          <title>Body</title>
-          <link type="text/css" rel="stylesheet" href="{$css-stylesheet}"/>
-          <xsl:if test="$ie5 != '0'">
-            <script type="text/javascript" language="JavaScript" src="{$slides.js}"/>
-          </xsl:if>
-          <style type="text/css">div.section { margin-top: 3em }</style>
-        </head>
-        <xsl:apply-templates select="." mode="singleframe"/>
-      </html>
-    </xsl:with-param>
-  </xsl:call-template>
-</xsl:template>
-
-<xsl:template match="section" mode="multiframe-bottom">
-  <xsl:variable name="id">
-    <xsl:call-template name="object.id"/>
-  </xsl:variable>
-
-  <xsl:variable name="snumber">
-    <xsl:number count="section" level="any"/>
-  </xsl:variable>
+          <hr/>
 
-  <xsl:variable name="thissection">
-    <xsl:text>section</xsl:text>
-    <xsl:number value="$snumber" format="01"/>
-    <xsl:text>.html</xsl:text>
-  </xsl:variable>
+          <div class="{name(.)}" id="{$id}">
+            <a name="{$id}"/>
+            <xsl:apply-templates select="title"/>
+          </div>
 
-  <xsl:variable name="nextfoil">
-    <xsl:apply-templates select="foil[1]" mode="filename"/>
-  </xsl:variable>
-
-  <xsl:variable name="prevfoil">
-    <xsl:choose>
-      <xsl:when test="preceding::foil">
-        <xsl:apply-templates select="preceding::foil[1]" mode="filename"/>
-      </xsl:when>
-      <xsl:otherwise>titlefoil.html</xsl:otherwise>
-    </xsl:choose>
-  </xsl:variable>
-
-  <xsl:call-template name="write.chunk">
-    <xsl:with-param name="filename" select="concat('bot-',$thissection)"/>
-    <xsl:with-param name="content">
-      <html>
-        <head>
-          <title>Navigation</title>
-          <link type="text/css" rel="stylesheet" href="{$css-stylesheet}"/>
-          <xsl:if test="$ie5 != '0'">
-            <script type="text/javascript" language="JavaScript" src="{$slides.js}"/>
-          </xsl:if>
-        </head>
-        <body class="navigation">
+          <hr/>
           <xsl:call-template name="section-bottom-nav"/>
-        </body>
-      </html>
+        </div>
+      </body>
     </xsl:with-param>
   </xsl:call-template>
-</xsl:template>
-
-<xsl:template match="section" mode="singleframe">
-  <xsl:variable name="id">
-    <xsl:call-template name="object.id"/>
-  </xsl:variable>
-
-  <xsl:variable name="snumber">
-    <xsl:number count="section" level="any"/>
-  </xsl:variable>
 
-  <xsl:variable name="thissection">
-    <xsl:text>section</xsl:text>
-    <xsl:number value="$snumber" format="01"/>
-    <xsl:text>.html</xsl:text>
-  </xsl:variable>
-
-  <xsl:variable name="nextfoil">
-    <xsl:apply-templates select="foil[1]" mode="filename"/>
-  </xsl:variable>
-
-  <xsl:variable name="prevfoil">
-    <xsl:choose>
-      <xsl:when test="preceding::foil">
-        <xsl:apply-templates select="preceding::foil[1]" mode="filename"/>
-      </xsl:when>
-      <xsl:otherwise>titlefoil.html</xsl:otherwise>
-    </xsl:choose>
-  </xsl:variable>
-
-  <body class="section" xsl:use-attribute-sets="body-attrs">
-    <xsl:if test="$ie5!='0'">
-      <xsl:attribute name="onload">
-        <xsl:text>newPage('</xsl:text>
-        <xsl:value-of select="$thissection"/>
-        <xsl:text>');</xsl:text>
-      </xsl:attribute>
-      <xsl:attribute name="onkeypress">
-        <xsl:text>navigate('</xsl:text>
-        <xsl:value-of select="$prevfoil"/>
-        <xsl:text>','</xsl:text>
-        <xsl:value-of select="$nextfoil"/>
-        <xsl:text>')</xsl:text>
-      </xsl:attribute>
-    </xsl:if>
-    <div class="{name(.)}" id="{$id}">
-      <a name="{$id}"/>
-      <xsl:if test="$multiframe=0">
-        <xsl:call-template name="section-top-nav"/>
-        <hr/>
-      </xsl:if>
-
-      <div class="{name(.)}" id="{$id}">
-        <a name="{$id}"/>
-        <xsl:apply-templates select="title"/>
-      </div>
-
-      <xsl:if test="$multiframe=0">
-        <hr/>
-        <xsl:call-template name="section-bottom-nav"/>
-      </xsl:if>
-    </div>
-  </body>
+  <xsl:apply-templates select="foil"/>
 </xsl:template>
 
 <xsl:template match="section/title">
@@ -648,254 +400,39 @@ if (selectBrowser() == "ie5") {
         <xsl:apply-templates select="parent::section[1]"
                              mode="filename"/>
       </xsl:when>
-      <xsl:otherwise>titlefoil.html</xsl:otherwise>
-    </xsl:choose>
-  </xsl:variable>
-
-  <xsl:choose>
-    <xsl:when test="$chunk=0">
-      <hr/>
-      <div class="{name(.)}" id="{$id}">
-       <a name="{$id}"/>
-       <xsl:apply-templates/>
-      </div>
-    </xsl:when>
-    <xsl:otherwise>
-      <xsl:call-template name="write.chunk">
-        <xsl:with-param name="filename" select="$thisfoil"/>
-        <xsl:with-param name="content">
-          <head>
-            <title><xsl:value-of select="title"/></title>
-            <link type="text/css" rel="stylesheet" href="{$css-stylesheet}"/>
-            <xsl:if test="$ie5 != '0'">
-              <script type="text/javascript" language="JavaScript" src="{$slides.js}"/>
-            </xsl:if>
-          </head>
-          <xsl:choose>
-            <xsl:when test="$multiframe != 0">
-              <xsl:apply-templates select="." mode="multiframe"/>
-            </xsl:when>
-            <xsl:otherwise>
-              <xsl:apply-templates select="." mode="singleframe"/>
-            </xsl:otherwise>
-          </xsl:choose>
-        </xsl:with-param>
-      </xsl:call-template>
-    </xsl:otherwise>
-  </xsl:choose>
-  <xsl:if test="$multiframe != 0">
-    <xsl:apply-templates select="." mode="multiframe-top"/>
-    <xsl:apply-templates select="." mode="multiframe-body"/>
-    <xsl:apply-templates select="." mode="multiframe-bottom"/>
-  </xsl:if>
-</xsl:template>
-
-<xsl:template match="foil" mode="multiframe">
-  <xsl:variable name="section" select="ancestor::section"/>
-
-  <xsl:variable name="thisfoil">
-    <xsl:apply-templates select="." mode="filename"/>
-  </xsl:variable>
-
-  <xsl:variable name="nextfoil">
-    <xsl:apply-templates select="(following::foil
-                                 |following::section)[1]"
-                         mode="filename"/>
-  </xsl:variable>
-
-  <xsl:variable name="prevfoil">
-    <xsl:choose>
-      <xsl:when test="preceding-sibling::foil">
-        <xsl:apply-templates select="preceding-sibling::foil[1]"
-                             mode="filename"/>
-      </xsl:when>
-      <xsl:when test="parent::section">
-        <xsl:apply-templates select="parent::section[1]"
-                             mode="filename"/>
-      </xsl:when>
-      <xsl:otherwise>titlefoil.html</xsl:otherwise>
+      <xsl:otherwise>
+        <xsl:value-of select="$titlefoil.html"/>
+      </xsl:otherwise>
     </xsl:choose>
   </xsl:variable>
 
-  <frameset rows="25,*,25" border="0" name="foil" framespacing="0">
-    <xsl:attribute name="onkeypress">
-      <xsl:text>navigate('</xsl:text>
-      <xsl:value-of select="$prevfoil"/>
-      <xsl:text>','</xsl:text>
-      <xsl:value-of select="$nextfoil"/>
-      <xsl:text>')</xsl:text>
-    </xsl:attribute>
-    <frame src="top-{$thisfoil}" name="top" marginheight="0" scrolling="no">
-      <xsl:attribute name="onkeypress">
-        <xsl:text>navigate('</xsl:text>
-        <xsl:value-of select="$prevfoil"/>
-        <xsl:text>','</xsl:text>
-        <xsl:value-of select="$nextfoil"/>
-        <xsl:text>')</xsl:text>
-      </xsl:attribute>
-    </frame>
-    <frame src="body-{$thisfoil}" name="body" marginheight="0">
-      <xsl:attribute name="onkeypress">
-        <xsl:text>navigate('</xsl:text>
-        <xsl:value-of select="$prevfoil"/>
-        <xsl:text>','</xsl:text>
-        <xsl:value-of select="$nextfoil"/>
-        <xsl:text>')</xsl:text>
-      </xsl:attribute>
-    </frame>
-    <frame src="bot-{$thisfoil}" name="bottom" marginheight="0" scrolling="no">
-      <xsl:attribute name="onkeypress">
-        <xsl:text>navigate('</xsl:text>
-        <xsl:value-of select="$prevfoil"/>
-        <xsl:text>','</xsl:text>
-        <xsl:value-of select="$nextfoil"/>
-        <xsl:text>')</xsl:text>
-      </xsl:attribute>
-    </frame>
-    <noframes>
-      <body class="frameset" xsl:use-attribute-sets="body-attrs">
-        <p>
-          <xsl:text>Your browser doesn't support frames.</xsl:text>
-        </p>
-      </body>
-    </noframes>
-  </frameset>
-</xsl:template>
-
-<xsl:template match="foil" mode="multiframe-top">
-  <xsl:variable name="thisfoil">
-    <xsl:apply-templates select="." mode="filename"/>
-  </xsl:variable>
-
   <xsl:call-template name="write.chunk">
-    <xsl:with-param name="filename" select="concat('top-',$thisfoil)"/>
+    <xsl:with-param name="filename" select="$thisfoil"/>
     <xsl:with-param name="content">
-      <html>
-        <head>
-          <title>Navigation</title>
-          <link type="text/css" rel="stylesheet" href="{$css-stylesheet}"/>
-          <xsl:if test="$ie5 != '0'">
-            <script type="text/javascript" language="JavaScript" src="{$slides.js}"/>
-          </xsl:if>
-        </head>
-        <body class="navigation">
+      <head>
+        <title><xsl:value-of select="title"/></title>
+        <link type="text/css" rel="stylesheet">
+          <xsl:attribute name="href">
+            <xsl:call-template name="css-stylesheet"/>
+          </xsl:attribute>
+        </link>
+      </head>
+      <body class="foil" xsl:use-attribute-sets="body-attrs">
+        <div class="{name(.)}" id="{$id}">
+          <a name="{$id}"/>
           <xsl:call-template name="foil-top-nav"/>
-        </body>
-      </html>
-    </xsl:with-param>
-  </xsl:call-template>
-</xsl:template>
+          <hr/>
 
-<xsl:template match="foil" mode="multiframe-body">
-  <xsl:variable name="thisfoil">
-    <xsl:apply-templates select="." mode="filename"/>
-  </xsl:variable>
-
-  <xsl:call-template name="write.chunk">
-    <xsl:with-param name="filename" select="concat('body-',$thisfoil)"/>
-    <xsl:with-param name="content">
-      <html>
-        <head>
-          <title>Body</title>
-          <link type="text/css" rel="stylesheet" href="{$css-stylesheet}"/>
-          <xsl:if test="$ie5 != '0'">
-            <script type="text/javascript" language="JavaScript" src="{$slides.js}"/>
-          </xsl:if>
-        </head>
-        <xsl:apply-templates select="." mode="singleframe"/>
-      </html>
-    </xsl:with-param>
-  </xsl:call-template>
-</xsl:template>
-
-<xsl:template match="foil" mode="multiframe-bottom">
-  <xsl:variable name="thisfoil">
-    <xsl:apply-templates select="." mode="filename"/>
-  </xsl:variable>
+          <xsl:apply-templates/>
 
-  <xsl:call-template name="write.chunk">
-    <xsl:with-param name="filename" select="concat('bot-',$thisfoil)"/>
-    <xsl:with-param name="content">
-      <html>
-        <head>
-          <title>Navigation</title>
-          <link type="text/css" rel="stylesheet" href="{$css-stylesheet}"/>
-          <xsl:if test="$ie5 != '0'">
-            <script type="text/javascript" language="JavaScript" src="{$slides.js}"/>
-          </xsl:if>
-        </head>
-        <body class="navigation">
+          <hr/>
           <xsl:call-template name="foil-bottom-nav"/>
-        </body>
-      </html>
+        </div>
+      </body>
     </xsl:with-param>
   </xsl:call-template>
 </xsl:template>
 
-<xsl:template match="foil" mode="singleframe">
-  <xsl:variable name="id">
-    <xsl:call-template name="object.id"/>
-  </xsl:variable>
-
-  <xsl:variable name="section" select="ancestor::section"/>
-
-  <xsl:variable name="thisfoil">
-    <xsl:apply-templates select="." mode="filename"/>
-  </xsl:variable>
-
-  <xsl:variable name="nextfoil">
-    <xsl:apply-templates select="(following::foil
-                                 |following::section)[1]"
-                         mode="filename"/>
-  </xsl:variable>
-
-  <xsl:variable name="prevfoil">
-    <xsl:choose>
-      <xsl:when test="preceding-sibling::foil">
-        <xsl:apply-templates select="preceding-sibling::foil[1]"
-                             mode="filename"/>
-      </xsl:when>
-      <xsl:when test="parent::section">
-        <xsl:apply-templates select="parent::section[1]"
-                             mode="filename"/>
-      </xsl:when>
-      <xsl:otherwise>titlefoil.html</xsl:otherwise>
-    </xsl:choose>
-  </xsl:variable>
-
-  <body class="foil" xsl:use-attribute-sets="body-attrs">
-    <xsl:if test="$ie5!='0'">
-      <xsl:attribute name="onload">
-        <xsl:text>newPage('</xsl:text>
-        <xsl:value-of select="$thisfoil"/>
-        <xsl:text>');</xsl:text>
-      </xsl:attribute>
-      <xsl:attribute name="onkeypress">
-        <xsl:text>navigate('</xsl:text>
-        <xsl:value-of select="$prevfoil"/>
-        <xsl:text>','</xsl:text>
-        <xsl:value-of select="$nextfoil"/>
-        <xsl:text>')</xsl:text>
-      </xsl:attribute>
-    </xsl:if>
-
-    <div class="{name(.)}" id="{$id}">
-      <a name="{$id}"/>
-      <xsl:if test="$multiframe=0">
-        <xsl:call-template name="foil-top-nav"/>
-        <hr/>
-      </xsl:if>
-
-      <xsl:apply-templates/>
-
-      <xsl:if test="$multiframe=0">
-        <hr/>
-        <xsl:call-template name="foil-bottom-nav"/>
-      </xsl:if>
-    </div>
-  </body>
-</xsl:template>
-
 <xsl:template match="foil" mode="foilnumber">
   <xsl:number count="foil" level="any"/>
 </xsl:template>
@@ -914,11 +451,6 @@ if (selectBrowser() == "ie5") {
 
 <xsl:template match="foil/title">
   <h1 class="{name(.)}">
-    <xsl:if test="$chunk=0">
-      <xsl:text>Slide </xsl:text>
-      <xsl:apply-templates select="parent::*" mode="foilnumber"/>
-      <xsl:text>: </xsl:text>
-    </xsl:if>
     <xsl:apply-templates/>
   </h1>
 </xsl:template>
@@ -1038,27 +570,14 @@ if (selectBrowser() == "ie5") {
 
 <!-- ============================================================ -->
 
-<xsl:template match="slidesinfo" mode="toc">
-  <xsl:variable name="id">
-    <xsl:call-template name="object.id"/>
-  </xsl:variable>
-  <div id="{$id}" class="toc-slidesinfo">
-    <a href="titlefoil.html" target="foil">
-      <xsl:choose>
-        <xsl:when test="titleabbrev">
-          <xsl:apply-templates select="titleabbrev" mode="toc"/>
-        </xsl:when>
-        <xsl:otherwise>
-          <xsl:apply-templates select="title" mode="toc"/>
-        </xsl:otherwise>
-      </xsl:choose>
-    </a>
-    <hr/>
-  </div>
+<xsl:template match="slides" mode="toc">
+  <p><b>Table of Contents</b></p>
+  <dl>
+    <xsl:apply-templates select="section|foil" mode="toc"/>
+  </dl>
 </xsl:template>
 
 <xsl:template match="section" mode="toc">
-  <xsl:variable name="id"><xsl:call-template name="object.id"/></xsl:variable>
   <xsl:variable name="snumber">
     <xsl:number count="section" level="any"/>
   </xsl:variable>
@@ -1069,41 +588,30 @@ if (selectBrowser() == "ie5") {
     <xsl:text>.html</xsl:text>
   </xsl:variable>
 
-  <div class="toc-section" id="{$id}">
-    <img src="{$graphics.dir}/{$minus.image}" alt="-"/>
-    <a href="{$thissection}" target="foil">
-      <xsl:choose>
-        <xsl:when test="titleabbrev">
-          <xsl:apply-templates select="titleabbrev" mode="toc"/>
-        </xsl:when>
-        <xsl:otherwise>
-          <xsl:apply-templates select="title" mode="toc"/>
-        </xsl:otherwise>
-      </xsl:choose>
+  <dt>
+    <a href="{$thissection}">
+      <xsl:value-of select="title"/>
     </a>
-    <xsl:apply-templates select="foil" mode="toc"/>
-  </div>
+  </dt>
+  <dd>
+    <dl>
+      <xsl:apply-templates select="foil" mode="toc"/>
+    </dl>
+  </dd>
 </xsl:template>
 
 <xsl:template match="foil" mode="toc">
-  <xsl:variable name="id"><xsl:call-template name="object.id"/></xsl:variable>
-  <xsl:variable name="foil">
-    <xsl:apply-templates select="." mode="foil-filename"/>
+  <xsl:variable name="thisfoil">
+    <xsl:apply-templates select="." mode="filename"/>
   </xsl:variable>
 
-  <div id="{$id}" class="toc-foil">
-    <img src="{$graphics.dir}/{$bullet.image}" alt="-"/>
-    <a href="{$foil}" target="foil">
-      <xsl:choose>
-        <xsl:when test="titleabbrev">
-          <xsl:apply-templates select="titleabbrev" mode="toc"/>
-        </xsl:when>
-        <xsl:otherwise>
-          <xsl:apply-templates select="title" mode="toc"/>
-        </xsl:otherwise>
-      </xsl:choose>
+  <dt>
+    <a href="{$thisfoil}">
+      <xsl:apply-templates select="." mode="foilnumber"/>
+      <xsl:text>. </xsl:text>
+      <xsl:value-of select="title"/>
     </a>
-  </div>
+  </dt>
 </xsl:template>
 
 <xsl:template match="title|titleabbrev" mode="toc">
@@ -1123,7 +631,7 @@ if (selectBrowser() == "ie5") {
 
   <xsl:text>myList.addItem('</xsl:text>
   <div id="{$id}" class="toc-slidesinfo">
-    <a href="titlefoil.html" target="foil">
+    <a href="{$titlefoil.html}" target="foil">
       <xsl:choose>
         <xsl:when test="titleabbrev">
           <xsl:value-of select="titleabbrev"/>
@@ -1173,7 +681,13 @@ if (selectBrowser() == "ie5") {
 
   <xsl:text>subList.addItem('</xsl:text>
   <div id="{$id}" class="toc-foil">
-    <img src="{$graphics.dir}/{$bullet.image}" alt="-"/>
+    <img alt="-">
+      <xsl:attribute name="src">
+        <xsl:call-template name="graphics.dir"/>
+        <xsl:text>/</xsl:text>
+        <xsl:value-of select="$bullet.image"/>
+      </xsl:attribute>
+    </img>
     <a href="{$foil}" target="foil">
       <xsl:choose>
         <xsl:when test="titleabbrev">
@@ -1194,4 +708,264 @@ if (selectBrowser() == "ie5") {
 
 <!-- ============================================================ -->
 
+<xsl:template name="section-top-nav">
+  <xsl:variable name="nextfoil">
+    <xsl:apply-templates select="foil[1]" mode="filename"/>
+  </xsl:variable>
+
+  <xsl:variable name="prevfoil">
+    <xsl:choose>
+      <xsl:when test="preceding::foil">
+        <xsl:apply-templates select="preceding::foil[1]" mode="filename"/>
+      </xsl:when>
+      <xsl:otherwise>
+        <xsl:value-of select="$titlefoil.html"/>
+      </xsl:otherwise>
+    </xsl:choose>
+  </xsl:variable>
+
+  <div class="navhead">
+    <table width="100%" border="0" cellpadding="0" cellspacing="0"
+           summary="Navigation">
+      <tr>
+        <td align="left" width="10%">
+          <xsl:choose>
+            <xsl:when test="$prevfoil != ''">
+              <a href="{$prevfoil}">
+                <img alt="Prev" border="0">
+                  <xsl:attribute name="src">
+                    <xsl:call-template name="graphics.dir"/>
+                    <xsl:text>/</xsl:text>
+                    <xsl:value-of select="$left.image"/>
+                  </xsl:attribute>
+                </img>
+              </a>
+            </xsl:when>
+            <xsl:otherwise>&#160;</xsl:otherwise>
+          </xsl:choose>
+        </td>
+        <td align="center" width="80%">
+          <xsl:variable name="prestitle">
+            <xsl:value-of select="(/slides/slidesinfo/title
+                                  |/slides/title)[1]"/>
+          </xsl:variable>
+
+          <span class="navheader">
+            <xsl:value-of select="$prestitle"/>
+          </span>
+        </td>
+        <td align="right" width="10%">
+          <xsl:choose>
+            <xsl:when test="$nextfoil != ''">
+              <a href="{$nextfoil}">
+                <img alt="Next" border="0">
+                  <xsl:attribute name="src">
+                    <xsl:call-template name="graphics.dir"/>
+                    <xsl:text>/</xsl:text>
+                    <xsl:value-of select="$right.image"/>
+                  </xsl:attribute>
+                </img>
+              </a>
+            </xsl:when>
+            <xsl:otherwise>&#160;</xsl:otherwise>
+          </xsl:choose>
+        </td>
+      </tr>
+    </table>
+  </div>
+</xsl:template>
+
+<xsl:template name="section-bottom-nav">
+  <div class="navfoot">
+    <table width="100%" border="0" cellpadding="0" cellspacing="0"
+           summary="Navigation">
+      <tr>
+        <td align="left" width="80%" valign="top">
+          <span class="navfooter">
+            <xsl:apply-templates select="/slides/slidesinfo/copyright"
+                                 mode="slide.navigation.mode"/>
+          </span>
+        </td>
+        <td align="right" width="20%" valign="top">
+          <xsl:text>&#160;</xsl:text>
+        </td>
+      </tr>
+    </table>
+  </div>
+</xsl:template>
+
+<xsl:template name="foil-top-nav">
+  <xsl:variable name="section" select="ancestor::section"/>
+
+  <xsl:variable name="nextfoil">
+    <xsl:apply-templates select="(following::foil
+                                 |following::section)[1]"
+                         mode="filename"/>
+  </xsl:variable>
+
+  <xsl:variable name="prevfoil">
+    <xsl:choose>
+      <xsl:when test="preceding-sibling::foil">
+        <xsl:apply-templates select="preceding-sibling::foil[1]"
+                             mode="filename"/>
+      </xsl:when>
+      <xsl:when test="parent::section">
+        <xsl:apply-templates select="parent::section[1]"
+                             mode="filename"/>
+      </xsl:when>
+      <xsl:otherwise>
+        <xsl:value-of select="$titlefoil.html"/>
+      </xsl:otherwise>
+    </xsl:choose>
+  </xsl:variable>
+
+  <div class="navhead">
+    <table width="100%" border="0" cellpadding="0" cellspacing="0"
+           summary="Navigation">
+      <tr>
+        <td align="left" width="10%">
+          <xsl:choose>
+            <xsl:when test="$prevfoil != ''">
+              <a href="{$prevfoil}">
+                <img alt="Prev" border="0">
+                  <xsl:attribute name="src">
+                    <xsl:call-template name="graphics.dir"/>
+                    <xsl:text>/</xsl:text>
+                    <xsl:value-of select="$left.image"/>
+                  </xsl:attribute>
+                </img>
+              </a>
+            </xsl:when>
+            <xsl:otherwise>&#160;</xsl:otherwise>
+          </xsl:choose>
+        </td>
+        <td align="center" width="80%">
+          <xsl:variable name="prestitle">
+            <xsl:value-of select="(/slides/slidesinfo/title
+                                  |/slides/title)[1]"/>
+          </xsl:variable>
+          <xsl:variable name="secttitle">
+            <xsl:if test="$section">
+              <xsl:value-of select="$section/title"/>
+            </xsl:if>
+          </xsl:variable>
+
+          <span class="navheader">
+            <xsl:value-of select="$prestitle"/>
+            <xsl:if test="$secttitle != ''">
+              <xsl:text>: </xsl:text>
+              <xsl:value-of select="$secttitle"/>
+            </xsl:if>
+          </span>
+        </td>
+        <td align="right" width="10%">
+          <xsl:choose>
+            <xsl:when test="$nextfoil != ''">
+              <a href="{$nextfoil}">
+                <img alt="Next" border="0">
+                  <xsl:attribute name="src">
+                    <xsl:call-template name="graphics.dir"/>
+                    <xsl:text>/</xsl:text>
+                    <xsl:value-of select="$right.image"/>
+                  </xsl:attribute>
+                </img>
+              </a>
+            </xsl:when>
+            <xsl:otherwise>&#160;</xsl:otherwise>
+          </xsl:choose>
+        </td>
+      </tr>
+    </table>
+  </div>
+</xsl:template>
+
+<xsl:template name="foil-bottom-nav">
+  <div class="navfoot">
+    <table width="100%" border="0" cellspacing="0" cellpadding="0"
+           summary="Navigation">
+      <tr>
+        <td align="left" width="80%" valign="top">
+          <span class="navfooter">
+            <xsl:apply-templates select="/slides/slidesinfo/copyright"
+                                 mode="slide.navigation.mode"/>
+          </span>
+        </td>
+        <td align="right" width="20%" valign="top">
+          <span class="navfooter">
+            <xsl:number count="foil" level="any"/>
+          </span>
+        </td>
+      </tr>
+    </table>
+  </div>
+</xsl:template>
+
+<!-- ============================================================ -->
+
+<xsl:template name="chunk">
+  <xsl:param name="node" select="."/>
+  <xsl:choose>
+    <xsl:when test="name($node)='slides'">1</xsl:when>
+    <xsl:when test="name($node)='foil'">1</xsl:when>
+    <xsl:otherwise>0</xsl:otherwise>
+  </xsl:choose>
+</xsl:template>
+
+<xsl:template match="*" mode="chunk-filename">
+  <xsl:param name="recursive">0</xsl:param>
+  <!-- returns the filename of a chunk -->
+  <xsl:variable name="ischunk"><xsl:call-template name="chunk"/></xsl:variable>
+  <xsl:variable name="filename">
+    <xsl:call-template name="dbhtml-filename"/>
+  </xsl:variable>
+  <xsl:variable name="dir">
+    <xsl:call-template name="dbhtml-dir"/>
+  </xsl:variable>
+
+  <xsl:choose>
+    <xsl:when test="$ischunk='0'">
+      <!-- if called on something that isn't a chunk, walk up... -->
+      <xsl:choose>
+        <xsl:when test="count(./parent::*)>0">
+          <xsl:apply-templates mode="chunk-filename" select="./parent::*">
+            <xsl:with-param name="recursive" select="$recursive"/>
+          </xsl:apply-templates>
+        </xsl:when>
+        <!-- unless there is no up, in which case return "" -->
+        <xsl:otherwise></xsl:otherwise>
+      </xsl:choose>
+    </xsl:when>
+
+    <xsl:when test="not($recursive) and $filename != ''">
+      <!-- if this chunk has an explicit name, use it -->
+      <xsl:if test="$dir != ''">
+        <xsl:value-of select="$dir"/>
+        <xsl:text>/</xsl:text>
+      </xsl:if>
+      <xsl:value-of select="$filename"/>
+    </xsl:when>
+
+    <xsl:when test="name(.)='foil'">
+      <xsl:variable name="foilnumber">
+       <xsl:number count="foil" level="any"/>
+      </xsl:variable>
+
+      <xsl:text>foil</xsl:text>
+      <xsl:number value="$foilnumber" format="01"/>
+      <xsl:text>.html</xsl:text>
+    </xsl:when>
+
+    <xsl:otherwise>
+      <xsl:text>chunk-filename-error-</xsl:text>
+      <xsl:value-of select="name(.)"/>
+      <xsl:number level="any" format="01" from="set"/>
+      <xsl:if test="not($recursive)">
+        <xsl:value-of select="$html.ext"/>
+      </xsl:if>
+    </xsl:otherwise>
+  </xsl:choose>
+</xsl:template>
+
+<!-- ============================================================ -->
+
 </xsl:stylesheet>