Index: /greenstone3/trunk/web/interfaces/classic/transform/document.xsl
===================================================================
--- /greenstone3/trunk/web/interfaces/classic/transform/document.xsl	(revision 14572)
+++ /greenstone3/trunk/web/interfaces/classic/transform/document.xsl	(revision 14573)
@@ -63,5 +63,12 @@
   <xsl:template match="document">
     <xsl:param name="collName"/>
-    
+    <xsl:variable name="external"><xsl:value-of select="/page/pageResponse/document/@external"/></xsl:variable>
+   <xsl:if test="$external != ''">
+      <xsl:call-template name="externalPage">
+	<xsl:with-param name="external" select="$external"/>
+      </xsl:call-template>
+    </xsl:if>
+
+    <xsl:if test="$external = ''">
     <xsl:call-template name="documentHeading">
       <xsl:with-param name="collName" select="$collName"/>
@@ -78,4 +85,5 @@
     </xsl:call-template> 
     <br/>
+      </xsl:if>
   </xsl:template>
   
@@ -124,38 +132,37 @@
     <xsl:variable name="p.s" select="/page/pageRequest/paramList/param[@name='p.s']/@value"/>
     <xsl:variable name="p.c"><xsl:choose><xsl:when test="/page/pageRequest/paramList/param[@name='p.c']"><xsl:value-of select="/page/pageRequest/paramList/param[@name='p.c']/@value"/></xsl:when><xsl:otherwise><xsl:value-of select="$collName"/></xsl:otherwise></xsl:choose></xsl:variable>
-    
-    
-    <div class="heading_image">
-       <xsl:if test="string($doCoverImage) != 'false' and (@docType='paged' or @docType='hierarchy')">       
-	<xsl:call-template name="coverImage"/> 
-       </xsl:if>
-    </div>
-    
-    <div class="buttons" id="toc_buttons">
-        <xsl:call-template name="documentButtons">
-	    <xsl:with-param name="collName" select="$collName"/>
-	</xsl:call-template>
-    </div>
-
-    <!--<div><xsl:call-template name="enrichServices">
+    <div id="documentheading">
+	  <a href="{$library_name}?a={$p.a}&amp;sa={$p.sa}&amp;s={$p.s}&amp;c={$p.c}&amp;rt=rd"><xsl:call-template name="openbookimg"><xsl:with-param name="title">Close this book and return to search/browse</xsl:with-param>
+	  </xsl:call-template></a>
+	     <xsl:choose><xsl:when test="@docType='simple'"><xsl:value-of select="metadataList/metadata[@name='Title']" disable-output-escaping="yes"/></xsl:when><xsl:otherwise><xsl:value-of select="documentNode/metadataList/metadata[@name='Title']" disable-output-escaping="yes"/></xsl:otherwise></xsl:choose>
+  </div>
+
+ <div id="docheadwrapper">
+  <div id="documentinfo">
+    	<xsl:if test="string($doCoverImage) != 'false' and (@docType='paged' or @docType='hierarchy')">
+       	  <div id="headingimage">
+             <xsl:call-template name="coverImage"/> 
+          </div>
+        </xsl:if>
+     
+        <ul id="docbuttons" >
+         <xsl:call-template name="documentButtons">
+	   <xsl:with-param name="collName" select="$collName"/>
+         </xsl:call-template>
+       </ul>
+  </div>
+    
+      <!--<div><xsl:call-template name="enrichServices">
 	    <xsl:with-param name="collName" select="$collName"/>
 	  </xsl:call-template></div>-->
 
-    <div class="toc">
-        <table class="v_list"><tr valign="top"><td valign="top"> <a href="{$library_name}?a={$p.a}&amp;sa={$p.sa}&amp;s={$p.s}&amp;c={$collName}&amp;rt=r"><xsl:call-template name="openbookimg"><xsl:with-param name="title">Close this book and return to search/browse</xsl:with-param>
-	  </xsl:call-template></a></td><td valign="top"></td>
-         <td valign="top">
- 	    <xsl:choose><xsl:when test="@docType='simple'"><xsl:value-of select="metadataList/metadata[@name='Title']" disable-output-escaping="yes"/></xsl:when><xsl:otherwise><xsl:value-of select="documentNode/metadataList/metadata[@name='Title']" disable-output-escaping="yes"/></xsl:otherwise></xsl:choose>
-          </td></tr>
-         </table>
-        <xsl:if test="string($doTOC) != 'false'">
-	  <table><tr valign="top"><td><img alt="" src="/gsdl/images/space.gif" width="25"/></td><td><table class="v_list">
-	    <xsl:call-template name="TOC">
-	      <xsl:with-param name="collName" select="$collName"/>
-	    </xsl:call-template>
-	    </table>
-          </td></tr></table>
-	</xsl:if>  	 	   
+    <xsl:if test="string($doTOC) != 'false'">
+       <div id="toc">
+	 <xsl:call-template name="TOC">
+	   <xsl:with-param name="collName" select="$collName"/>
+	 </xsl:call-template>
       </div>
+    </xsl:if>
+    </div>
    </xsl:template>
 
@@ -257,13 +264,13 @@
     
     <xsl:if test="documentNode[@nodeID]">
-	<tr valign='top'><td>
+	<ul id="tocnodes">
+	<li>
 	    <xsl:choose><xsl:when test="string($oc)='0'">
 		<a href="{$library_name}?a=d&amp;c={$collName}&amp;d={$d}&amp;sib={$sib}&amp;oc=1&amp;p.s={$p.s}&amp;p.sa={$p.sa}&amp;p.a={$p.a}&amp;p.c={$p.c}"><xsl:call-template name="closedfolderimg"><xsl:with-param name="title">open the table of contents</xsl:with-param></xsl:call-template></a>
 	      </xsl:when>
 	      <xsl:otherwise><a href="{$library_name}?a=d&amp;c={$collName}&amp;d={$d}&amp;sib={$sib}&amp;oc=0&amp;p.s={$p.s}&amp;p.sa={$p.sa}&amp;p.a={$p.a}&amp;p.c={$p.c}"><xsl:call-template name="openfolderimg"><xsl:with-param name="title">close the table of contents</xsl:with-param></xsl:call-template></a></xsl:otherwise></xsl:choose>
-	  </td><td>Table of Contents</td></tr>
+	  Table of Contents
 	<xsl:if test="string($oc)!='0'">
-	  <tr><td>&#160;</td><td>
-	      <table>
+	  <ul class="tocnode">
 		<xsl:for-each select="documentNode/documentNode[@nodeID]">
 		  <xsl:apply-templates select='.'>
@@ -278,7 +285,8 @@
 		</xsl:apply-templates>
 		</xsl:for-each>
-	      </table>
-	    </td></tr>
-	</xsl:if>
+	     </ul>
+	  </xsl:if>
+ </li> 
+      </ul>
     </xsl:if>
   </xsl:template>
@@ -296,5 +304,5 @@
     <!-- Display the appropriate image, depending on the node type -->
     	
-    <tr><td valign="top">
+     <li>
     <!--
 	<a><xsl:attribute name="href"><xsl:value-of select='$library_name'/>?a=d&amp;c=<xsl:value-of select='$collName'/>&amp;d=<xsl:value-of select='@nodeID'/><xsl:if test="documentNode">.pr</xsl:if><xsl:if test="@nodeType='leaf'">&amp;sib=1</xsl:if><xsl:if test="string($ec) = '1'">&amp;ec=1</xsl:if></xsl:attribute>
@@ -305,11 +313,9 @@
 	  <xsl:apply-templates select="." mode="displayNodeIcon"/>
 	</a>
-      </td>
       
       <!-- Display associated title, bolded if the node has content -->
-      <td valign="top">
 	<xsl:choose>
 	  <xsl:when test="nodeContent">
-	    <b><xsl:value-of disable-output-escaping="yes" select="metadataList/metadata[@name='Title']"/></b>
+	     <span class="bold"><xsl:value-of disable-output-escaping="yes" select="metadataList/metadata[@name='Title']"/></span>
 	  </xsl:when>
 	  <xsl:otherwise>
@@ -317,10 +323,9 @@
 	  </xsl:otherwise>
 	</xsl:choose>
-      </td>
-    </tr>
+
     <!-- Apply recursively to the children of this node -->
     <xsl:if test="documentNode[@nodeID]">
-      <tr><td>&#160;</td><td><table>
-	    <xsl:apply-templates select="documentNode[@nodeID]">
+      
+	     <ul class="tocnode"> <xsl:apply-templates select="documentNode[@nodeID]">
 	      <xsl:with-param name="collName" select="$collName"/>
 	      <xsl:with-param name="ec" select="$ec"/>
@@ -330,7 +335,7 @@
 	      <!--<xsl:with-param name="depth" select="$depth + 1"/>-->
 	    </xsl:apply-templates>
-	  </table>
-	</td></tr>
-    </xsl:if>
+	   </ul>
+      </xsl:if>
+    </li>
   </xsl:template>
   
@@ -490,5 +495,12 @@
     </xsl:for-each>
   </xsl:template>
-  
+
+  <xsl:template name="externalPage">
+    <xsl:param name="external"/>
+    <h2>External Link</h2>
+    <p>The link you have selected is external to any of your currently selected collections. If you still wish to view this link and your browser has access to the Web, you can <a><xsl:attribute name="href"><xsl:value-of select="$external"/></xsl:attribute>go forward</a> to this page; otherwise use your browsers "back" button to return to the previous document.
+    </p>
+  </xsl:template>
+
 </xsl:stylesheet>
 
