]> granicus.if.org Git - docbook-dsssl/commitdiff
More hacking, mostly. Added support for absolutely positioned footers
authorNorman Walsh <ndw@nwalsh.com>
Mon, 10 Sep 2001 13:26:36 +0000 (13:26 +0000)
committerNorman Walsh <ndw@nwalsh.com>
Mon, 10 Sep 2001 13:26:36 +0000 (13:26 +0000)
that works in most browsers and should be harmless in others. This should
make it possible to avoid multiframe. Also added "support" for NS6 and
IE6. I hope.

slides/browser/list.js
slides/browser/overlay.js [new file with mode: 0644]
slides/browser/slides.js
slides/tests/.cvsignore [new file with mode: 0644]
slides/tests/Makefile
slides/tests/test.xml
slides/xsl/frames.xsl
slides/xsl/slides.xsl

index 3d3f0cfc658750013109cefa5cb006b233c191ef..ede93897f329bdb969d031610125d3e816b0e480 100644 (file)
@@ -6,6 +6,7 @@ if (parseInt(navigator.appVersion.charAt(0)) >= 4) {
   isNav4 = (navigator.appName == "Netscape") ? true : false;
   isIE4 = (navigator.appName.indexOf("Microsoft") != -1) ? true : false;
 }
+
 function List(visible, width, height, bgColor) {
   this.setIndent = setIndent;
   this.addItem = addItem;
@@ -44,11 +45,20 @@ function List(visible, width, height, bgColor) {
   else this.bgColor = null;
   _mLists[_id++] = this;
 }
+
 function _listSetFont(i,j) {
   this.fontIntro = i;
   this.fontOutro = j;
 }
-function setIndent(indent) { this.i = indent; if(this.i < 0) { this.i = 0; this.space = false; } }
+
+function setIndent(indent) {
+    this.i = indent;
+    if (this.i < 0) {
+       this.i = 0;
+       this.space = false;
+    }
+}
+
 function setClip(layer, l, r, t, b) {
   if(isNav4) {
     layer.clip.left = l; layer.clip.right = r;
@@ -59,38 +69,44 @@ function setClip(layer, l, r, t, b) {
     layer.style.clip = "rect("+t+","+r+","+b+","+l+")";
   }
 }
+
 function _writeList() {
-  self.status = "List: Writing list...";
-  var layer, str, clip;
-  for(var i = 0; i < this.types.length; i++) { 
-    layer = this.items[i];
-    if(isNav4) layer.visibility = "hidden";
-    else layer.style.visibility = "hidden";
-    str = "";
-    if(isNav4) layer.document.open();
-    str += "<TABLE WIDTH="+this.width+" NOWRAP BORDER=0 CELLPADDING=0 CELLSPACING=0><TR>";
-    if(this.types[i] == "list") {
-      str += "<TD WIDTH=15 NOWRAP VALIGN=MIDDLE><A TARGET='_self' HREF=\"javascript:expand("+this.lists[i].id+");\"><IMG BORDER=0 SRC=\"../graphics/true.gif\" NAME=\"_img"+this.lists[i].id+"\"></A></TD>";
-      _pid++;
-    } else if(this.space)
-      str += "<TD WIDTH=15 NOWRAP>&nbsp;</TD>";
-    if(this.l>0 && this.i>0) str += "<TD WIDTH="+this.l*this.i+" NOWRAP>&nbsp;</TD>";
-    str += "<TD HEIGHT="+(this.height-3)+" WIDTH="+(this.width-15-this.l*this.i)+" VALIGN=MIDDLE ALIGN=LEFT>";
-    if(this.fontIntro) str += this.fontIntro;
-    str += this.strs[i];
-    if(this.fontOutro) str += this.fontOutro;
-    str += "</TD></TABLE>";
-    if(isNav4) {
-      layer.document.writeln(str);
-      layer.document.close();
-    } else layer.innerHTML = str;
-    if(this.types[i] == "list" && this.lists[i].visible)
-      this.lists[i]._writeList();
-  }
-  this.built = true;
-  this.needsRewrite = false;
-  self.status = '';
+    self.status = "List: Writing list...";
+    var layer, str, clip;
+    for (var i = 0; i < this.types.length; i++) {
+       layer = this.items[i];
+       if (isNav4) layer.visibility = "hidden";
+       else layer.style.visibility = "hidden";
+       str = "";
+
+       alert(layer);
+
+       if(isNav4) layer.document.open();
+
+       str += "<TABLE WIDTH="+this.width+" NOWRAP BORDER=0 CELLPADDING=0 CELLSPACING=0><TR>";
+       if(this.types[i] == "list") {
+           str += "<TD WIDTH=15 NOWRAP VALIGN=MIDDLE><A TARGET='_self' HREF=\"javascript:expand("+this.lists[i].id+");\"><IMG BORDER=0 SRC=\"../graphics/true.gif\" NAME=\"_img"+this.lists[i].id+"\"></A></TD>";
+           _pid++;
+       } else if(this.space)
+           str += "<TD WIDTH=15 NOWRAP>&nbsp;</TD>";
+       if(this.l>0 && this.i>0) str += "<TD WIDTH="+this.l*this.i+" NOWRAP>&nbsp;</TD>";
+       str += "<TD HEIGHT="+(this.height-3)+" WIDTH="+(this.width-15-this.l*this.i)+" VALIGN=MIDDLE ALIGN=LEFT>";
+       if(this.fontIntro) str += this.fontIntro;
+       str += this.strs[i];
+       if(this.fontOutro) str += this.fontOutro;
+       str += "</TD></TABLE>";
+       if(isNav4) {
+           layer.document.writeln(str);
+           layer.document.close();
+       } else layer.innerHTML = str;
+       if(this.types[i] == "list" && this.lists[i].visible)
+           this.lists[i]._writeList();
+    }
+    this.built = true;
+    this.needsRewrite = false;
+    self.status = '';
 }
+
 function _showList() {
   var layer;
   for(var i = 0; i < this.types.length; i++) { 
@@ -107,6 +123,7 @@ function _showList() {
   this.shown = true;
   this.needsUpdate = false;
 }
+
 function _updateList(pVis, x, y) {
   var currTop = y, layer;
   for(var i = 0; i < this.types.length; i++) { 
@@ -142,6 +159,7 @@ function _updateList(pVis, x, y) {
   }
   return currTop;
 }
+
 function _updateParent(pid, l) {
   var layer;
   if(!l) l = 0;
@@ -151,43 +169,57 @@ function _updateParent(pid, l) {
     if(this.types[i] == "list")
       this.lists[i]._updateParent(pid, l+1);
 }
+
 function expand(i) {
   _mLists[i].visible = !_mLists[i].visible;
   if(_mLists[i].onexpand != null) _mLists[i].onexpand(_mLists[i].id);
   _mLists[_mLists[i].pid].rebuild();
   if(_mLists[i].postexpand != null) _mLists[i].postexpand(_mLists[i].id);
 }
+
 function build(x, y) {
+    alert("got here1");
+
   this._updateParent(this.id);
   this._writeList();
   this._showList();
   this._updateList(true, x, y);
   this.x = x; this.y = y;
 }
-function rebuild() { this._updateList(true, this.x, this.y); }
+
+function rebuild() {
+    this._updateList(true, this.x, this.y);
+}
+
 function addItem(str, bgColor, layer) {
-  var testLayer = false;
-  if(!document.all) document.all = document.layers;
-  if(!layer) {
-    if(isIE4 || !this.parLayer) testLayer = eval('document.all.lItem'+_lid);
-    else {
-      _pLayer = this.parLayer;
-      testLayer = eval('_pLayer.document.layers.lItem'+_lid);
+    var testLayer = false;
+    if(!document.all) document.all = document.layers;
+    if(!layer) {
+       if(isIE4 || !this.parLayer) {
+           alert('document.all.lItem'+_lid);
+           testLayer = eval('document.all.lItem'+_lid);
+       } else {
+           _pLayer = this.parLayer;
+           testLayer = eval('_pLayer.document.layers.lItem'+_lid);
+       }
+       if(testLayer) {
+           layer = testLayer;
+       } else {
+           if(isNav4) {
+               if(this.parLayer) layer = new Layer(this.width, this.parLayer);
+               else layer = new Layer(this.width);
+           } else {
+               return;
+           }
+       }
     }
-    if(testLayer) layer = testLayer;
-    else {
-      if(isNav4) {
-        if(this.parLayer) layer = new Layer(this.width, this.parLayer);
-        else layer = new Layer(this.width);
-      } else return;
-    }
-  }
   if(bgColor) layer.oBgColor = bgColor;
   this.items[this.items.length] = layer;
   this.types[this.types.length] = "item";
   this.strs[this.strs.length] = str;
   _lid++;
 }
+
 function addList(list, str, bgColor, layer) {
   var testLayer = false;
   if(!document.all) document.all = document.layers;
@@ -212,4 +244,5 @@ function addList(list, str, bgColor, layer) {
   this.strs[this.strs.length] = str;
   list.parent = this;
   _lid++;
-}
\ No newline at end of file
+}
+
diff --git a/slides/browser/overlay.js b/slides/browser/overlay.js
new file mode 100644 (file)
index 0000000..11cd1ba
--- /dev/null
@@ -0,0 +1,106 @@
+/* Overlay.js, adapted from Floating image II on dynamicdrive.com */
+/* Usage:
+<html>
+<head>
+<script LANGUAGE="JavaScript1.2" src="overlay.js"></script>
+...rest of head...
+</head>
+<body onload="overlaySetup(corner)">
+<div id="overlayDiv" STYLE="position:absolute;visibility:visible;">
+...body of overlay...
+</div>
+...rest of page...
+*/
+
+var overlayLx = 0;
+var overlayLy = 0;
+
+var overlayNS4 = document.layers ? 1 : 0;
+var overlayIE  = document.all ? 1 : 0;
+var overlayNS6 = document.getElementById && !document.all ? 1 : 0;
+
+var overlayX = 0;
+var overlayY = 0;
+var overlayW = 0;
+var overlayH = 0;
+var overlayPadX = 15;
+var overlayPadY = 5;
+
+var overlayDelay=60;
+
+var overlayCorner = 'ur'; // ul, ll, ur, lr, uc, lc, cl, cr
+
+function overlayRefresh() {
+    if (overlayIE) {
+       overlayLx = document.body.clientWidth;
+       overlayLy = document.body.clientHeight;
+       overlayH  = overlayDiv.offsetHeight;
+       overlayW  = overlayDiv.offsetWidth;
+    } else if (overlayNS4) {
+       overlayLy = window.innerHeight;
+       overlayLx = window.innerWidth;
+       overlayH  = document.overlayDiv.clip.height;
+       overlayW  = document.overlayDiv.clip.width;
+    } else if (overlayNS6) {
+       overlayLy = window.innerHeight;
+       overlayLx = window.innerWidth;
+       overlayH  = document.getElementById('overlayDiv').offsetHeight;
+       overlayW  = document.getElementById('overlayDiv').offsetWidth;
+    }
+
+    if (overlayCorner == 'ul') {
+       overlayX = overlayPadX;
+       overlayY = overlayPadY;
+    } else if (overlayCorner == 'cl') {
+       overlayX = overlayPadX;
+       overlayY = (overlayLy - overlayH) / 2;
+    } else if (overlayCorner == 'll') {
+       overlayX = overlayPadX;
+       overlayY = (overlayLy - overlayH) - overlayPadY;
+    } else if (overlayCorner == 'ur') {
+       overlayX = (overlayLx - overlayW) - overlayPadX;
+       overlayY = overlayPadY;
+    } else if (overlayCorner == 'cr') {
+       overlayX = (overlayLx - overlayW) - overlayPadX;
+       overlayY = (overlayLy - overlayH) / 2;
+    } else if (overlayCorner == 'lr') {
+       overlayX = (overlayLx - overlayW) - overlayPadX;
+       overlayY = (overlayLy - overlayH) - overlayPadY;
+    } else if (overlayCorner == 'uc') {
+       overlayX = (overlayLx - overlayW) / 2;
+       overlayY = overlayPadY;
+    } else { // overlayCorner == 'lc'
+       overlayX = (overlayLx - overlayW) / 2;
+       overlayY = (overlayLy - overlayH) - overlayPadY;
+    }
+
+    if (overlayIE) {
+       overlayDiv.style.left=overlayX;
+       overlayDiv.style.top=overlayY+document.body.scrollTop;
+    } else if (overlayNS4) {
+       document.overlayDiv.pageX=overlayX;
+       document.overlayDiv.pageY=overlayY+window.pageYOffset;
+       document.overlayDiv.visibility="visible";
+    } else if (overlayNS6) {
+       var div = document.getElementById("overlayDiv");
+       div.style.left=overlayX;
+       div.style.top=overlayY+window.pageYOffset;
+    }
+}
+
+function onad() {
+    loopfunc();
+}
+
+function loopfunc() {
+    overlayRefresh();
+    setTimeout('loopfunc()',overlayDelay);
+}
+
+function overlaySetup(corner) {
+    overlayCorner = corner;
+
+    if (overlayIE || overlayNS4 || overlayNS6) {
+       onad();
+    }
+}
index cb6f0068bc2b162f63a2f0e24a59a5b2f1fb7501..e9a9ad8968ff2ea7291690551194e8a1c32afff0 100644 (file)
@@ -5,10 +5,20 @@ function selectBrowser() {
     var browserVersion = parseFloat(navigator.appVersion);
     var userAgent = navigator.userAgent;;
 
+    if (browserName == "Netscape" && browserVersion>=5) {
+       // Netscape 6 is Mozilla 5
+       return "ns6";
+    }
+
     if (browserName == "Netscape" && browserVersion>=4) {
        return "ns4";
     }
 
+    if (browserName == "Microsoft Internet Explorer"
+       && userAgent.indexOf("MSIE 6") > 0) {
+       return "ie6";
+    }
+
     if (browserName == "Microsoft Internet Explorer"
        && userAgent.indexOf("MSIE 5") > 0) {
        return "ie5";
@@ -17,11 +27,16 @@ function selectBrowser() {
     return null;
 }
 
-function newPage(filename) {
-    if (selectBrowser() != "ie5") {
+function newPage(filename,overlay) {
+    if (selectBrowser() != "ie5"
+       && selectBrowser() != "ie6") {
        return;
     }
 
+    if (overlay != 0) {
+       overlaySetup('ll');
+    }
+
     var parent = self.parent;
 
     var gparent = null;
@@ -48,7 +63,7 @@ function newPage(filename) {
     }
 }
 
-function navigate (bk,fw) {
+function navigate (bk,fw,overlay) {
     var frame = window;
     if (frame.name != "foil") {
        frame = frame.parent;
diff --git a/slides/tests/.cvsignore b/slides/tests/.cvsignore
new file mode 100644 (file)
index 0000000..2d19fc7
--- /dev/null
@@ -0,0 +1 @@
+*.html
index 639947ce14fd23ad2479eb3a8743845550ae6842..a80c7078d20fc3d6d5d7debb088467c4fa3527ad 100644 (file)
@@ -1,33 +1,41 @@
 include ../../cvstools/Makefile.incl
-HTMLSTYLE=../xsl/slides.xsl
+NOFRAMESTYLE=../xsl/slides.xsl
+FRAMESTYLE=../xsl/frames.xsl
 FOSTYLE=../xsl/fo-plain.xsl
 VARS=
 FORMATTER=xep
 BROWSER=
 MULTIFRAME=0
+FRAMES=0
+OVERLAY=1
 TIDY=1
 
-all:
-       @echo Select a target
+ifeq ($(FRAMES),0)
+  HTMLSTYLE=$(NOFRAMESTYLE)
+else
+  HTMLSTYLE=$(FRAMESTYLE)
+endif
 
-test: test.xml
-       $(XJPARSE) test.xml
 ifeq ($(BROWSER),)
-       $(XSLT) $< $(HTMLSTYLE) /dev/null $(VARS) multiframe=$(MULTIFRAME)
+  PARAMS=$(VARS) multiframe=$(MULTIFRAME) overlay=$(OVERLAY)
 else
-       $(XSLT) $< $(HTMLSTYLE) /dev/null $(VARS) $(BROWSER)=1 multiframe=$(MULTIFRAME)
+  PARAMS=$(VARS) $(BROWSER)=1 multiframe=$(MULTIFRAME) overlay=$(OVERLAY)
 endif
 
-testcust:
-       $(XJPARSE) test.xml
+all:
+       @echo Select a target
+
+test: test.xml
+       $(XJPARSE) $<
+       $(XSLT) $< $(HTMLSTYLE) $(PARAMS)
+       make tidy
 
 dbgentext: dbgentext.xml
        $(XJPARSE) $<
-ifeq ($(BROWSER),)
-       $(XSLT) $< $(HTMLSTYLE) /dev/null $(VARS) multiframe=$(MULTIFRAME)
-else
-       $(XSLT) $< $(HTMLSTYLE) /dev/null $(VARS) $(BROWSER)=1 multiframe=$(MULTIFRAME)
-endif
+       $(XSLT) $< $(HTMLSTYLE) $(PARAMS)
+       make tidy
+
+tidy:
 ifeq ($(TIDY),1)
        for i in *.html; do \
                if [ "$$i" != "ns4toc.html" ] ; then \
index 02d4750f8535b106952ae0fb5c64f821fe2383cf..f5400ea02f638c9bce9156fca8babc0a8d6704a6 100644 (file)
@@ -3,17 +3,36 @@
 <slides>
 <slidesinfo>
   <title>Test Slides Title</title>
+  <copyright><year>2001</year><holder>Norman Walsh</holder></copyright>
 </slidesinfo>
 
-<foil><title>Test Slides Title</title>
+<section><title>Section 1</title>
+
+<foil><title>Test Slides Title 1</title>
+<para>...</para>
+</foil>
+
+<foil><title>Test Slides Title 2</title>
+<para>...</para>
+<screen>
+this is a screen
+</screen>
+</foil>
+
+</section>
+<section><title>Section 2</title>
+
+<foil><title>Test Slides Title 1</title>
 <para>...</para>
 </foil>
 
-<foil><title>Test Slides Title</title>
+<foil><title>Test Slides Title 2</title>
 <para>...</para>
 <screen>
 this is a screen
 </screen>
 </foil>
 
+</section>
+
 </slides>
index ea08fac77d437bad2c9808903da560f07084d7db..025bfe4fd9223596b41ff72e616159b402363df0 100644 (file)
@@ -6,8 +6,8 @@
 
 <xsl:param name="titlefoil.html" select="'titlefoil.html'"/>
 
-<xsl:param name="ns4" select="0"/>
-<xsl:param name="ie5" select="0"/>
+<xsl:param name="ns4" select="1"/>
+<xsl:param name="ie5" select="1"/>
 <xsl:param name="multiframe" select="0"/>
 
 <xsl:param name="multiframe.top.bgcolor" select="'white'"/>
   <xsl:variable name="toc.rows" select="1+count(//section)+count(//foil)"/>
   <xsl:variable name="toc.height" select="$toc.rows * $toc.row.height"/>
 
+  <xsl:if test="$overlay != 0 and $multiframe != 0">
+    <xsl:message terminate='yes'>
+      <xsl:text>Multiframe and overlay are mutually exclusive.</xsl:text>
+    </xsl:message>
+  </xsl:if>
+
   <xsl:call-template name="write.chunk">
     <xsl:with-param name="filename" select="concat($base.dir,'frames.html')"/>
     <xsl:with-param name="content">
@@ -38,7 +44,8 @@
           <frame src="toc.html" name="toc" frameborder="1"/>
           <frame src="{$titlefoil.html}" name="foil"/>
           <noframes>
-            <body class="frameset" xsl:use-attribute-sets="body-attrs">
+            <body class="frameset">
+              <xsl:call-template name="body.attributes"/>
               <a href="titleframe.html">
                 <xsl:text>Your browser doesn't support frames.</xsl:text>
               </a>
                 <xsl:call-template name="slides.js"/>
               </xsl:attribute>
             </script>
+            <xsl:if test="$overlay != '0'">
+              <script type="text/javascript" language="JavaScript">
+                <xsl:attribute name="src">
+                  <xsl:call-template name="overlay.js"/>
+                </xsl:attribute>
+              </script>
+            </xsl:if>
           </head>
-          <body class="toc" xsl:use-attribute-sets="body-attrs"
-                onload="newPage('toc.html');">
+          <body class="toc" onload="newPage('toc.html',{$overlay});">
+            <xsl:call-template name="body.attributes"/>
             <div class="toc">
               <xsl:apply-templates mode="toc"/>
             </div>
@@ -124,8 +138,8 @@ function init() {
 </xsl:text>
             </style>
           </head>
-          <body class="toc" xsl:use-attribute-sets="body-attrs"
-                onload="init();">
+          <body class="toc" onload="init({$overlay});">
+            <xsl:call-template name="body.attributes"/>
             <div id="spacer"></div>
           </body>
         </html>
@@ -165,8 +179,16 @@ if (selectBrowser() == "ie5") {
 ]]></xsl:text>
             </xsl:if>
           </script>
+          <xsl:if test="$overlay != '0'">
+            <script type="text/javascript" language="JavaScript">
+              <xsl:attribute name="src">
+                <xsl:call-template name="overlay.js"/>
+              </xsl:attribute>
+            </script>
+          </xsl:if>
         </head>
-        <body class="toc" xsl:use-attribute-sets="body-attrs">
+        <body class="toc">
+          <xsl:call-template name="body.attributes"/>
           <div class="toc">
             <xsl:apply-templates mode="toc"/>
           </div>
@@ -180,7 +202,8 @@ if (selectBrowser() == "ie5") {
 
 <xsl:template match="slidesinfo">
   <xsl:call-template name="write.chunk">
-    <xsl:with-param name="filename" select="concat($base.dir,$titlefoil.html)"/>
+    <xsl:with-param name="filename"
+                    select="concat($base.dir,$titlefoil.html)"/>
     <xsl:with-param name="content">
       <html>
         <head>
@@ -197,25 +220,58 @@ if (selectBrowser() == "ie5") {
               </xsl:attribute>
             </script>
           </xsl:if>
-        </head>
-        <body class="titlepage" xsl:use-attribute-sets="body-attrs">
-          <xsl:if test="$ie5!='0'">
-            <xsl:attribute name="onload">
-              <xsl:text>newPage('</xsl:text>
-              <xsl:value-of select="$titlefoil.html"/>
-              <xsl:text>');</xsl:text>
-            </xsl:attribute>
-            <xsl:attribute name="onkeypress">
-              <xsl:text>navigate('','foil01.html');</xsl:text>
-            </xsl:attribute>
+          <xsl:if test="$overlay != '0'">
+            <script type="text/javascript" language="JavaScript">
+              <xsl:attribute name="src">
+                <xsl:call-template name="overlay.js"/>
+              </xsl:attribute>
+            </script>
           </xsl:if>
+        </head>
+        <body class="titlepage">
+          <xsl:call-template name="body.attributes"/>
+          <xsl:choose>
+            <xsl:when test="$ie5 != 0">
+              <xsl:attribute name="onload">
+                <xsl:text>newPage('</xsl:text>
+                <xsl:value-of select="$titlefoil.html"/>
+                <xsl:text>',</xsl:text>
+                <xsl:value-of select="$overlay"/>
+                <xsl:text>);</xsl:text>
+              </xsl:attribute>
+              <xsl:attribute name="onkeypress">
+                <xsl:text>navigate('','foil01.html',</xsl:text>
+                <xsl:value-of select="$overlay"/>
+                <xsl:text>)</xsl:text>
+              </xsl:attribute>
+            </xsl:when>
+            <xsl:when test="$overlay != 0">
+              <xsl:attribute name="onload">
+                <xsl:text>overlaySetup('lc')</xsl:text>
+              </xsl:attribute>
+            </xsl:when>
+          </xsl:choose>
           <div class="{name(.)}">
             <xsl:apply-templates mode="titlepage.mode"/>
           </div>
 
           <xsl:choose>
             <xsl:when test="$multiframe=0">
-              <div class="navfoot" style="padding-top: 2in;">
+              <div id="overlayDiv" class="navfoot">
+                <xsl:choose>
+                  <xsl:when test="$overlay != 0">
+                    <xsl:attribute name="style">
+                      <xsl:text>position:absolute;visibility:visible;</xsl:text>
+                    </xsl:attribute>
+                    <hr/>
+                  </xsl:when>
+                  <xsl:otherwise>
+                    <xsl:attribute name="style">
+                      <xsl:text>padding-top: 2in;</xsl:text>
+                    </xsl:attribute>
+                  </xsl:otherwise>
+                </xsl:choose>
+
                 <table width="100%" border="0"
                        cellspacing="0" cellpadding="0"
                        summary="Navigation">
@@ -311,6 +367,13 @@ if (selectBrowser() == "ie5") {
             </xsl:attribute>
           </script>
         </xsl:if>
+        <xsl:if test="$overlay != '0'">
+          <script type="text/javascript" language="JavaScript">
+            <xsl:attribute name="src">
+              <xsl:call-template name="overlay.js"/>
+            </xsl:attribute>
+          </script>
+        </xsl:if>
       </head>
       <xsl:choose>
         <xsl:when test="$multiframe != 0">
@@ -348,7 +411,8 @@ if (selectBrowser() == "ie5") {
     <frame src="body-{$thissection}" name="body" marginheight="0" frameborder="0"/>
     <frame src="bot-{$thissection}" name="bottom" marginheight="0" scrolling="no" frameborder="0"/>
     <noframes>
-      <body class="frameset" xsl:use-attribute-sets="body-attrs">
+      <body class="frameset">
+        <xsl:call-template name="body.attributes"/>
         <p>
           <xsl:text>Your browser doesn't support frames.</xsl:text>
         </p>
@@ -382,6 +446,13 @@ if (selectBrowser() == "ie5") {
               </xsl:attribute>
             </script>
           </xsl:if>
+          <xsl:if test="$overlay != '0'">
+            <script type="text/javascript" language="JavaScript">
+              <xsl:attribute name="src">
+                <xsl:call-template name="overlay.js"/>
+              </xsl:attribute>
+            </script>
+          </xsl:if>
         </head>
         <body class="navigation" bgcolor="{$multiframe.top.bgcolor}">
           <xsl:call-template name="section-top-nav">
@@ -442,6 +513,13 @@ if (selectBrowser() == "ie5") {
               </xsl:attribute>
             </script>
           </xsl:if>
+          <xsl:if test="$overlay != '0'">
+            <script type="text/javascript" language="JavaScript">
+              <xsl:attribute name="src">
+                <xsl:call-template name="overlay.js"/>
+              </xsl:attribute>
+            </script>
+          </xsl:if>
           <style type="text/css">div.section { margin-top: 3em }</style>
         </head>
         <xsl:apply-templates select="." mode="singleframe"/>
@@ -498,6 +576,13 @@ if (selectBrowser() == "ie5") {
               </xsl:attribute>
             </script>
           </xsl:if>
+          <xsl:if test="$overlay != '0'">
+            <script type="text/javascript" language="JavaScript">
+              <xsl:attribute name="src">
+                <xsl:call-template name="overlay.js"/>
+              </xsl:attribute>
+            </script>
+          </xsl:if>
         </head>
         <body class="navigation" bgcolor="{$multiframe.bottom.bgcolor}">
           <xsl:call-template name="section-bottom-nav"/>
@@ -537,21 +622,33 @@ if (selectBrowser() == "ie5") {
     </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>
+  <body class="section">
+    <xsl:call-template name="body.attributes"/>
+    <xsl:choose>
+      <xsl:when test="$ie5 != 0">
+        <xsl:attribute name="onload">
+          <xsl:text>newPage('</xsl:text>
+          <xsl:value-of select="$thissection"/>
+          <xsl:text>',</xsl:text>
+          <xsl:value-of select="$overlay"/>
+          <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:value-of select="$overlay"/>
+          <xsl:text>)</xsl:text>
+        </xsl:attribute>
+      </xsl:when>
+      <xsl:when test="$overlay != 0">
+        <xsl:attribute name="onload">
+          <xsl:text>overlaySetup('lc')</xsl:text>
+        </xsl:attribute>
+      </xsl:when>
+    </xsl:choose>
     <div class="{name(.)}" id="{$id}">
       <a name="{$id}"/>
       <xsl:if test="$multiframe=0">
@@ -565,8 +662,15 @@ if (selectBrowser() == "ie5") {
       </div>
 
       <xsl:if test="$multiframe=0">
-        <hr/>
-        <xsl:call-template name="section-bottom-nav"/>
+        <div id="overlayDiv">
+          <xsl:if test="$overlay != 0">
+            <xsl:attribute name="style">
+              <xsl:text>position:absolute;visibility:visible;</xsl:text>
+            </xsl:attribute>
+          </xsl:if>
+          <hr/>
+          <xsl:call-template name="section-bottom-nav"/>
+        </div>
       </xsl:if>
     </div>
   </body>
@@ -622,6 +726,13 @@ if (selectBrowser() == "ie5") {
             </xsl:attribute>
           </script>
         </xsl:if>
+        <xsl:if test="$overlay != '0'">
+          <script type="text/javascript" language="JavaScript">
+            <xsl:attribute name="src">
+              <xsl:call-template name="overlay.js"/>
+            </xsl:attribute>
+          </script>
+        </xsl:if>
       </head>
       <xsl:choose>
         <xsl:when test="$multiframe != 0">
@@ -676,7 +787,9 @@ if (selectBrowser() == "ie5") {
       <xsl:value-of select="$prevfoil"/>
       <xsl:text>','</xsl:text>
       <xsl:value-of select="$nextfoil"/>
-      <xsl:text>')</xsl:text>
+      <xsl:text>',</xsl:text>
+      <xsl:value-of select="$overlay"/>
+      <xsl:text>)</xsl:text>
     </xsl:attribute>
     <frame src="top-{$thisfoil}" name="top" marginheight="0" scrolling="no" frameborder="0">
       <xsl:attribute name="onkeypress">
@@ -684,7 +797,9 @@ if (selectBrowser() == "ie5") {
         <xsl:value-of select="$prevfoil"/>
         <xsl:text>','</xsl:text>
         <xsl:value-of select="$nextfoil"/>
-        <xsl:text>')</xsl:text>
+        <xsl:text>',</xsl:text>
+        <xsl:value-of select="$overlay"/>
+        <xsl:text>)</xsl:text>
       </xsl:attribute>
     </frame>
     <frame src="body-{$thisfoil}" name="body" marginheight="0" frameborder="0">
@@ -693,7 +808,9 @@ if (selectBrowser() == "ie5") {
         <xsl:value-of select="$prevfoil"/>
         <xsl:text>','</xsl:text>
         <xsl:value-of select="$nextfoil"/>
-        <xsl:text>')</xsl:text>
+        <xsl:text>',</xsl:text>
+        <xsl:value-of select="$overlay"/>
+        <xsl:text>)</xsl:text>
       </xsl:attribute>
     </frame>
     <frame src="bot-{$thisfoil}" name="bottom" marginheight="0" scrolling="no" frameborder="0">
@@ -702,11 +819,14 @@ if (selectBrowser() == "ie5") {
         <xsl:value-of select="$prevfoil"/>
         <xsl:text>','</xsl:text>
         <xsl:value-of select="$nextfoil"/>
-        <xsl:text>')</xsl:text>
+        <xsl:text>',</xsl:text>
+        <xsl:value-of select="$overlay"/>
+        <xsl:text>)</xsl:text>
       </xsl:attribute>
     </frame>
     <noframes>
-      <body class="frameset" xsl:use-attribute-sets="body-attrs">
+      <body class="frameset">
+        <xsl:call-template name="body.attributes"/>
         <p>
           <xsl:text>Your browser doesn't support frames.</xsl:text>
         </p>
@@ -738,6 +858,13 @@ if (selectBrowser() == "ie5") {
               </xsl:attribute>
             </script>
           </xsl:if>
+          <xsl:if test="$overlay != '0'">
+            <script type="text/javascript" language="JavaScript">
+              <xsl:attribute name="src">
+                <xsl:call-template name="overlay.js"/>
+              </xsl:attribute>
+            </script>
+          </xsl:if>
         </head>
         <body class="navigation" bgcolor="{$multiframe.top.bgcolor}">
           <xsl:call-template name="foil-top-nav">
@@ -773,6 +900,13 @@ if (selectBrowser() == "ie5") {
               </xsl:attribute>
             </script>
           </xsl:if>
+          <xsl:if test="$overlay != '0'">
+            <script type="text/javascript" language="JavaScript">
+              <xsl:attribute name="src">
+                <xsl:call-template name="overlay.js"/>
+              </xsl:attribute>
+            </script>
+          </xsl:if>
         </head>
         <xsl:apply-templates select="." mode="singleframe"/>
       </html>
@@ -803,6 +937,13 @@ if (selectBrowser() == "ie5") {
               </xsl:attribute>
             </script>
           </xsl:if>
+          <xsl:if test="$overlay != '0'">
+            <script type="text/javascript" language="JavaScript">
+              <xsl:attribute name="src">
+                <xsl:call-template name="overlay.js"/>
+              </xsl:attribute>
+            </script>
+          </xsl:if>
         </head>
         <body class="navigation" bgcolor="{$multiframe.bottom.bgcolor}">
           <xsl:call-template name="foil-bottom-nav"/>
@@ -845,21 +986,33 @@ if (selectBrowser() == "ie5") {
     </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>
+  <body class="foil">
+    <xsl:call-template name="body.attributes"/>
+    <xsl:choose>
+      <xsl:when test="$ie5 != 0">
+        <xsl:attribute name="onload">
+          <xsl:text>newPage('</xsl:text>
+          <xsl:value-of select="$thisfoil"/>
+          <xsl:text>',</xsl:text>
+          <xsl:value-of select="$overlay"/>
+          <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:value-of select="$overlay"/>
+          <xsl:text>)</xsl:text>
+        </xsl:attribute>
+      </xsl:when>
+      <xsl:when test="$overlay != 0">
+        <xsl:attribute name="onload">
+          <xsl:text>overlaySetup('lc')</xsl:text>
+        </xsl:attribute>
+      </xsl:when>
+    </xsl:choose>
 
     <div class="{name(.)}" id="{$id}">
       <a name="{$id}"/>
@@ -871,8 +1024,15 @@ if (selectBrowser() == "ie5") {
       <xsl:apply-templates/>
 
       <xsl:if test="$multiframe=0">
-        <hr/>
-        <xsl:call-template name="foil-bottom-nav"/>
+        <div id="overlayDiv">
+          <xsl:if test="$overlay != 0">
+            <xsl:attribute name="style">
+              <xsl:text>position:absolute;visibility:visible;</xsl:text>
+            </xsl:attribute>
+          </xsl:if>
+          <hr/>
+          <xsl:call-template name="foil-bottom-nav"/>
+        </div>
       </xsl:if>
     </div>
   </body>
index 228f2f82cd4eddc0ea1dc3341ec80f04461f118c..b36164593b95b7c5a5e0ad09d1499982913400a6 100644 (file)
 <xsl:param name="left.image" select="'left.gif'"/>
 
 <xsl:param name="script.dir" select="''"/>
+<xsl:param name="overlay.js" select="'overlay.js'"/>
 <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.html" select="'toc.html'"/>
 
 <xsl:param name="toc.bg.color">#FFFFFF</xsl:param>
 <xsl:param name="toc.width">250</xsl:param>
 <xsl:param name="toc.hide.show" select="0"/>
 
+<xsl:param name="overlay" select="0"/>
 <xsl:param name="ie5" select="0"/>
 
-<xsl:attribute-set name="body-attrs">
+<xsl:template name="body.attributes">
   <xsl:attribute name="bgcolor">white</xsl:attribute>
   <xsl:attribute name="text">black</xsl:attribute>
   <xsl:attribute name="link">#0000FF</xsl:attribute>
   <xsl:attribute name="vlink">#840084</xsl:attribute>
   <xsl:attribute name="alink">#0000FF</xsl:attribute>
-</xsl:attribute-set>
+</xsl:template>
 
 <!-- ============================================================ -->
 
   </xsl:call-template>
 </xsl:template>
 
+<xsl:template name="overlay.js">
+  <!-- danger will robinson: template shadows parameter -->
+  <xsl:call-template name="script-file">
+    <xsl:with-param name="js" select="$overlay.js"/>
+  </xsl:call-template>
+</xsl:template>
+
 <!-- ============================================================ -->
 
 <xsl:template match="/">
 
 <xsl:template match="slides">
   <xsl:call-template name="write.chunk">
-    <xsl:with-param name="filename" select="concat($base.dir, 'toc.html')"/>
+    <xsl:with-param name="filename" select="concat($base.dir, $toc.html)"/>
     <xsl:with-param name="content">
       <html>
         <head>
               <xsl:call-template name="css-stylesheet"/>
             </xsl:attribute>
           </link>
+          <xsl:if test="$overlay != '0'">
+            <script type="text/javascript" language="JavaScript">
+              <xsl:attribute name="src">
+                <xsl:call-template name="overlay.js"/>
+              </xsl:attribute>
+            </script>
+          </xsl:if>
         </head>
-        <body class="tocpage" xsl:use-attribute-sets="body-attrs">
+        <body class="tocpage">
+          <xsl:call-template name="body.attributes"/>
+          <xsl:if test="$overlay != 0">
+            <xsl:attribute name="onload">
+              <xsl:text>overlaySetup('lc')</xsl:text>
+            </xsl:attribute>
+          </xsl:if>
+
           <h1>
             <a href="{$titlefoil.html}">
               <xsl:value-of select="/slides/slidesinfo/title"/>
           </h1>
           <xsl:apply-templates select="." mode="toc"/>
 
-          <div class="navfoot" style="padding-top: 2in;">
+          <div id="overlayDiv" class="navfoot">
+            <xsl:choose>
+              <xsl:when test="$overlay != 0">
+                <xsl:attribute name="style">
+                  <xsl:text>position:absolute;visibility:visible;</xsl:text>
+                </xsl:attribute>
+                <hr/>
+              </xsl:when>
+              <xsl:otherwise>
+                <xsl:attribute name="style">
+                  <xsl:text>padding-top: 2in;</xsl:text>
+                </xsl:attribute>
+              </xsl:otherwise>
+            </xsl:choose>
+
             <table width="100%" border="0"
                    cellspacing="0" cellpadding="0"
                    summary="Navigation">
 
 <xsl:template match="slidesinfo">
   <xsl:call-template name="write.chunk">
-    <xsl:with-param name="filename" select="concat($base.dir, $titlefoil.html)"/>
+    <xsl:with-param name="filename"
+                    select="concat($base.dir, $titlefoil.html)"/>
     <xsl:with-param name="content">
       <html>
         <head>
               <xsl:call-template name="css-stylesheet"/>
             </xsl:attribute>
           </link>
+          <xsl:if test="$overlay != '0'">
+            <script type="text/javascript" language="JavaScript">
+              <xsl:attribute name="src">
+                <xsl:call-template name="overlay.js"/>
+              </xsl:attribute>
+            </script>
+          </xsl:if>
         </head>
-        <body class="titlepage" xsl:use-attribute-sets="body-attrs">
+        <body class="titlepage">
+          <xsl:call-template name="body.attributes"/>
+          <xsl:if test="$overlay != 0">
+            <xsl:attribute name="onload">
+              <xsl:text>overlaySetup('lc')</xsl:text>
+            </xsl:attribute>
+          </xsl:if>
           <div class="navhead">
             <table width="100%" border="0" cellpadding="0" cellspacing="0"
                    summary="Navigation">
               <tr>
                 <td align="left" width="10%">
-                  <a href="toc.html">
+                  <a href="{$toc.html}">
                     <xsl:text>Contents</xsl:text>
                   </a>
                 </td>
             <xsl:apply-templates mode="titlepage.mode"/>
           </div>
 
-          <div class="navfoot" style="padding-top: 2in;">
+          <div id="overlayDiv" class="navfoot">
+            <xsl:choose>
+              <xsl:when test="$overlay != 0">
+                <xsl:attribute name="style">
+                  <xsl:text>position:absolute;visibility:visible;</xsl:text>
+                </xsl:attribute>
+                <hr/>
+              </xsl:when>
+              <xsl:otherwise>
+                <xsl:attribute name="style">
+                  <xsl:text>padding-top: 2in;</xsl:text>
+                </xsl:attribute>
+              </xsl:otherwise>
+            </xsl:choose>
+
             <table width="100%" border="0"
                    cellspacing="0" cellpadding="0"
                    summary="Navigation">
             <xsl:call-template name="css-stylesheet"/>
           </xsl:attribute>
         </link>
+        <xsl:if test="$overlay != '0'">
+          <script type="text/javascript" language="JavaScript">
+            <xsl:attribute name="src">
+              <xsl:call-template name="overlay.js"/>
+            </xsl:attribute>
+          </script>
+        </xsl:if>
       </head>
-      <body class="section" xsl:use-attribute-sets="body-attrs">
+      <body class="section">
+        <xsl:call-template name="body.attributes"/>
+        <xsl:if test="$overlay != 0">
+          <xsl:attribute name="onload">
+            <xsl:text>overlaySetup('lc')</xsl:text>
+          </xsl:attribute>
+        </xsl:if>
         <div class="{name(.)}" id="{$id}">
           <a name="{$id}"/>
           <xsl:call-template name="section-top-nav"/>
             <xsl:apply-templates select="title"/>
           </div>
 
-          <hr/>
-          <xsl:call-template name="section-bottom-nav"/>
+          <div id="overlayDiv">
+            <xsl:if test="$overlay != 0">
+              <xsl:attribute name="style">
+                <xsl:text>position:absolute;visibility:visible;</xsl:text>
+              </xsl:attribute>
+            </xsl:if>
+
+            <hr/>
+            <xsl:call-template name="section-bottom-nav"/>
+          </div>
         </div>
       </body>
     </xsl:with-param>
             <xsl:call-template name="css-stylesheet"/>
           </xsl:attribute>
         </link>
+        <xsl:if test="$overlay != '0'">
+          <script type="text/javascript" language="JavaScript">
+            <xsl:attribute name="src">
+              <xsl:call-template name="overlay.js"/>
+            </xsl:attribute>
+          </script>
+        </xsl:if>
       </head>
-      <body class="foil" xsl:use-attribute-sets="body-attrs">
+      <body class="foil">
+        <xsl:call-template name="body.attributes"/>
+        <xsl:if test="$overlay != 0">
+          <xsl:attribute name="onload">
+            <xsl:text>overlaySetup('lc')</xsl:text>
+          </xsl:attribute>
+        </xsl:if>
         <div class="{name(.)}" id="{$id}">
           <a name="{$id}"/>
           <xsl:call-template name="foil-top-nav"/>
 
           <xsl:apply-templates/>
 
-          <hr/>
-          <xsl:call-template name="foil-bottom-nav"/>
+          <div id="overlayDiv">
+            <xsl:if test="$overlay != 0">
+              <xsl:attribute name="style">
+                <xsl:text>position:absolute;visibility:visible;</xsl:text>
+              </xsl:attribute>
+            </xsl:if>
+
+            <hr/>
+            <xsl:call-template name="foil-bottom-nav"/>
+          </div>
         </div>
       </body>
     </xsl:with-param>
   </xsl:variable>
 
   <xsl:text>myList.addItem('</xsl:text>
-  <div id="{$id}" class="toc-slidesinfo">
-    <a href="{$titlefoil.html}" target="foil">
-      <xsl:choose>
-        <xsl:when test="titleabbrev">
-          <xsl:value-of select="titleabbrev"/>
-        </xsl:when>
-        <xsl:otherwise>
-          <xsl:value-of select="title"/>
-        </xsl:otherwise>
-      </xsl:choose>
-    </a>
-  </div>
+
+  <xsl:text disable-output-escaping="yes">&lt;div id="</xsl:text>
+  <xsl:value-of select="$id"/>
+  <xsl:text disable-output-escaping="yes">" class="toc-slidesinfo"&gt;</xsl:text>
+
+  <xsl:text disable-output-escaping="yes">&lt;a href="</xsl:text>
+  <xsl:value-of select="$titlefoil.html"/>
+  <xsl:text disable-output-escaping="yes">" target="foil"&gt;</xsl:text>
+
+  <xsl:choose>
+    <xsl:when test="titleabbrev">
+      <xsl:value-of select="titleabbrev"/>
+    </xsl:when>
+    <xsl:otherwise>
+      <xsl:value-of select="title"/>
+    </xsl:otherwise>
+  </xsl:choose>
+
+  <xsl:text disable-output-escaping="yes">&lt;/a&gt;&lt;/div&gt;</xsl:text>
   <xsl:text>');&#10;</xsl:text>
 </xsl:template>
 
   <xsl:apply-templates select="foil" mode="ns-toc"/>
 
   <xsl:text>myList.addList(subList, '</xsl:text>
-  <div class="toc-section">
-    <a href="{$foil}" target="foil">
-      <xsl:choose>
-        <xsl:when test="titleabbrev">
-          <xsl:value-of select="titleabbrev"/>
-        </xsl:when>
-        <xsl:otherwise>
-          <xsl:value-of select="title"/>
-        </xsl:otherwise>
-      </xsl:choose>
-    </a>
-  </div>
-  <xsl:text>');&#10;</xsl:text>
+  <xsl:text disable-output-escaping="yes">&lt;div class="toc-section"&gt;</xsl:text>
+
+  <xsl:text disable-output-escaping="yes">&lt;a href="</xsl:text>
+  <xsl:value-of select="$foil"/>
+  <xsl:text disable-output-escaping="yes">" target="foil"&gt;</xsl:text>
+
+  <xsl:choose>
+    <xsl:when test="titleabbrev">
+      <xsl:value-of select="titleabbrev"/>
+    </xsl:when>
+    <xsl:otherwise>
+      <xsl:value-of select="title"/>
+    </xsl:otherwise>
+  </xsl:choose>
 
+  <xsl:text disable-output-escaping="yes">&lt;/a&gt;&lt;/div&gt;</xsl:text>
+  <xsl:text>');&#10;</xsl:text>
 </xsl:template>
 
 <xsl:template match="foil" mode="ns-toc">
     </xsl:otherwise>
   </xsl:choose>
 
-  <div id="{$id}" class="toc-foil">
-    <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">
-          <xsl:value-of select="titleabbrev"/>
-        </xsl:when>
-        <xsl:otherwise>
-          <xsl:value-of select="title"/>
-        </xsl:otherwise>
-      </xsl:choose>
-    </a>
-  </div>
+  <xsl:text disable-output-escaping="yes">&lt;div id="</xsl:text>
+  <xsl:value-of select="$id"/>
+  <xsl:text disable-output-escaping="yes">" class="toc-foil"&gt;</xsl:text>
+
+  <xsl:text disable-output-escaping="yes">&lt;img alt="-" src="</xsl:text>
+  <xsl:call-template name="graphics.dir"/>
+  <xsl:text>/</xsl:text>
+  <xsl:value-of select="$bullet.image"/>
+  <xsl:text disable-output-escaping="yes">"&gt;</xsl:text>
+
+  <xsl:text disable-output-escaping="yes">&lt;a href="</xsl:text>
+  <xsl:value-of select="$foil"/>
+  <xsl:text disable-output-escaping="yes">" target="foil"&gt;</xsl:text>
+
+  <xsl:choose>
+    <xsl:when test="titleabbrev">
+      <xsl:value-of select="titleabbrev"/>
+    </xsl:when>
+    <xsl:otherwise>
+      <xsl:value-of select="title"/>
+    </xsl:otherwise>
+  </xsl:choose>
+
+  <xsl:text disable-output-escaping="yes">&lt;/a&gt;&lt;/div&gt;</xsl:text>
   <xsl:text>');&#10;</xsl:text>
 </xsl:template>