Index: trunk/gsdl3/web/interfaces/nzdl/transform/style.xsl
===================================================================
--- trunk/gsdl3/web/interfaces/nzdl/transform/style.xsl	(revision 5387)
+++ trunk/gsdl3/web/interfaces/nzdl/transform/style.xsl	(revision 5388)
@@ -10,4 +10,9 @@
   <xsl:param name="interface_name"/>
   <xsl:param name="library_name"/>
+
+  <!-- some global variables -->
+  <xsl:variable name="colour-button-text">#345437</xsl:variable>
+  <xsl:variable name="colour-navbar-link-text">#345437</xsl:variable>
+  <xsl:variable name="colour-navbar-selected-text">#c6aa69</xsl:variable>
 
   <!-- the main page layout template is here -->
@@ -35,8 +40,14 @@
   </xsl:template>
 
+  <!-- any global java script should go in here -->
+  <xsl:template name="headScript">
+  </xsl:template>
+  
+  <!-- the old javascript for rollover images -->
+  <!--
   <xsl:template name="headScript">
     <script>
       <xsl:text disable-output-escaping="yes">
-	&lt;!--
+	&lt;!
 	var loaded = new Array();
 	function gbutton (image, onimage) {
@@ -59,10 +70,11 @@
 	}
 	}
-	//--&gt;
+	//&gt;
      </xsl:text>
      
     </script>
   </xsl:template>
-
+-->
+  
   <xsl:template name="genericPageBanner">
     <xsl:variable name="lang" select="/page/@lang"/>
@@ -71,5 +83,10 @@
 	<tr><td align="left"></td>
 	  <td align="right">
-	    <a href="{$library_name}?a=p&amp;sa=home" onMouseover="roll('homer',1);" onMouseOut="roll('homer',0);"><img name="homer" src="interfaces/nzdl/images/{$lang}/chomeof.gif" onLoad="gbutton(this, 'interfaces/nzdl/images/{$lang}/chomeon.gif');" border="0" alt="Home page"/></a>
+	    <table>
+	      <tr><td xsl:use-attribute-sets="td-brownbutton">
+		  <a style="text-decoration:none" href="{$library_name}?a=p&amp;sa=home">
+		    <b><font color='{$colour-button-text}'><xsl:value-of select="util:getInterfaceText($interface_name, /page/@lang, 'home_b')"/></font></b>
+		  </a>
+		</td></tr></table>
 	  </td>
 	</tr>
@@ -79,100 +96,132 @@
   </xsl:template>
   
-
-  <!-- just pass in collname cos use it everywhere - saves working it out lots of times -->
   <xsl:template name="standardPageBanner">
     <xsl:param name="collName"/>
     <xsl:param name="pageType"/>
-    <xsl:variable name="httpPath" select="/page/pageResponse/collection/metadataList/metadata[@name='httpPath']"/>
-    <xsl:variable name="colIcon" select="/page/pageResponse/collection/displayItem[@name='icon']"/>
-    <xsl:variable name="lang" select="/page/@lang"/>
-    <table width="537">
+    <xsl:param name="clTop"/>
+    <xsl:variable name="this-element" select="/page/pageResponse/collection"/>
+    <table width="100%">
       <tr>
 	<td align="left" rowspan="2">
 	  <a href="{$library_name}?a=p&amp;sa=about&amp;c={$collName}">
-	    <img border="1" src="{$httpPath}/images/{$colIcon}">
-	      <xsl:attribute name="alt">
-		<xsl:value-of select="util:getInterfaceText($interface_name, /page/@lang, 'aboutpage')"/>
-	      </xsl:attribute>
-	    </img>
+	    <xsl:choose>
+	      <xsl:when test="$this-element/displayItem[@name='icon']">
+		<img border="0">
+		  <xsl:attribute name="src">
+		    <xsl:value-of select="$this-element/metadataList/metadata[@name='httpPath']"/>/images/<xsl:value-of select="$this-element/displayItem[@name='icon']"/>
+		  </xsl:attribute>	
+		  <xsl:attribute name="alt">
+		    <xsl:value-of select="$this-element/displayItem[@name='name']"/>
+		  </xsl:attribute>
+		  <xsl:attribute name="title">
+		    <xsl:value-of select="util:getInterfaceText($interface_name, /page/@lang, 'aboutpage')"/>
+		  </xsl:attribute>
+		</img>
+	      </xsl:when>
+	      <xsl:otherwise>
+		<b><xsl:value-of select="$this-element/displayItem[@name='name']"/></b>
+	      </xsl:otherwise>
+	    </xsl:choose>
 	  </a>
 	</td>
 	<td align="right">
-	  <a href="{$library_name}?a=p&amp;sa=home" onMouseover="roll('homer',1);" onMouseOut="roll('homer',0);"><img name="homer" src="interfaces/nzdl/images/{$lang}/chomeof.gif" onLoad="gbutton(this, 'interfaces/nzdl/images/{$lang}/chomeon.gif');" border="0" alt="Home page"/></a>
-	  <a href="{$library_name}?a=p&amp;sa=help&amp;c={$collName}" onMouseover="roll('help',1);" onMouseOut="roll('help',0);"><img name="help" src="interfaces/nzdl/images/{$lang}/chelpof.gif" onLoad="gbutton(this, 'interfaces/nzdl/images/{$lang}/chelpon.gif');" border="0" alt="Help page"/></a>
-	  <a href="{$library_name}?a=p&amp;sa=pref&amp;c={$collName}" onMouseover="roll('pref',1);" onMouseOut="roll('pref',0);"><img name="pref" src="interfaces/nzdl/images/{$lang}/cprefof.gif" onLoad="gbutton(this, 'interfaces/nzdl/images/{$lang}/cprefon.gif');" border="0" alt="Preferences page"/></a>
+	  <table cellspacing='4'>
+	    <tr>
+	      <td xsl:use-attribute-sets="td-brownbutton">
+		<a style="text-decoration:none" href="{$library_name}?a=p&amp;sa=home">
+		  <b><font color='{$colour-button-text}'><xsl:value-of select="util:getInterfaceText($interface_name, /page/@lang, 'home_b')"/></font></b>
+		</a>
+	      </td>
+	      <xsl:choose>
+		<xsl:when test="$pageType='help'">
+		  <td xsl:use-attribute-sets="td-brownbutton-off">
+		    <b><font color='{$colour-button-text}'><xsl:value-of select="util:getInterfaceText($interface_name, /page/@lang, 'help_b')"/></font></b>
+		  </td>
+		</xsl:when>
+		<xsl:otherwise>
+		  <td xsl:use-attribute-sets="td-brownbutton">
+		    <a style="text-decoration:none" href="{$library_name}?a=p&amp;sa=help&amp;c={$collName}">
+		      <b><font color='{$colour-button-text}'><xsl:value-of select="util:getInterfaceText($interface_name, /page/@lang, 'help_b')"/></font></b>
+		    </a>
+		  </td>
+		</xsl:otherwise>
+	      </xsl:choose>
+	      <xsl:choose>
+		<xsl:when test="$pageType='pref'">
+		  <td  xsl:use-attribute-sets="td-brownbutton-off">
+		    <b><font color='{$colour-button-text}'><xsl:value-of select="util:getInterfaceText($interface_name, /page/@lang, 'pref_b')"/></font></b>
+		  </td>
+		</xsl:when>
+		<xsl:otherwise>
+		  <td xsl:use-attribute-sets="td-brownbutton">
+		    <a title="xxpref" style="text-decoration:none" href="{$library_name}?a=p&amp;sa=pref&amp;c={$collName}">
+		      <b><font color='{$colour-button-text}'><xsl:value-of select="util:getInterfaceText($interface_name, /page/@lang, 'pref_b')"/></font></b>
+		    </a>
+		  </td>
+		</xsl:otherwise>
+	      </xsl:choose>
+	    </tr>
+	  </table>
 	</td>
       </tr>
+      <xsl:if test="not(/page/pageRequest/@action='d')">
+	<xsl:variable name="text">
+	  <xsl:choose>
+	    <xsl:when test="$pageType='browse'">
+	      <xsl:value-of select="/page/pageResponse/collection/serviceList/service[@name='ClassifierBrowse']/classifierList/classifier[@name=$clTop]/displayItem[@name='name']"/>
+	    </xsl:when>
+	    <xsl:otherwise>
+	      <xsl:value-of select="util:getInterfaceText($interface_name, /page/@lang, concat($pageType, '_t'))"/>
+	    </xsl:otherwise>
+	  </xsl:choose>
+	</xsl:variable>
+	<tr>
+	  <td align='right' width="200" height="57" background='interfaces/nzdl/images/titleicon.gif'><font size="+2" color='black'><xsl:value-of select="$text"/>&#160;&#160;</font></td>
+	</tr>
+      </xsl:if>
+    </table>
+    <p/>
+  </xsl:template>
+
+
+  <xsl:template name="navigationBar">
+    <xsl:param name="collName"/>
+    <xsl:param name="clTop"/>
+    <xsl:variable name="this-element" select="/page/pageResponse/collection"/>
+    <xsl:variable name="this-service" select="/page/pageResponse/service/@name"/>
+    <xsl:variable name="classifiers" select="$this-element/serviceList/service[@name='ClassifierBrowse']/classifierList"/>
+    <table border='0' cellspacing='0' width='100%'>
       <tr>
-	<td align='right'><xsl:if test="$pageType"><img src="interfaces/nzdl/images/{$lang}/h_{$pageType}.gif"  width="200" height="57"/></xsl:if></td>
-      </tr>
-      
-      <tr>
-	<td colspan='2'></td>
+	<xsl:if test="$this-element/serviceList/service[@type='query']">
+	  <td xsl:use-attribute-sets="td-navbar">	    
+	    <xsl:call-template name="navbar-search"><xsl:with-param name="collName" select="$collName"/></xsl:call-template>
+	  </td>
+	</xsl:if>
+	
+	<xsl:for-each select="$classifiers/classifier">
+	  <td xsl:use-attribute-sets="td-navbar">
+	    <xsl:apply-templates select="." mode="navbar">
+	      <xsl:with-param name="collName" select="$collName"/>
+	      <xsl:with-param name="clTop" select="$clTop"/>
+	    </xsl:apply-templates>
+	  </td>
+	</xsl:for-each>
+	
+	<xsl:if test="$this-element/serviceList/service[@name='PhindApplet']">
+	  <td xsl:use-attribute-sets="td-navbar">
+	    <xsl:call-template name="navbar-phind"><xsl:with-param name="collName" select="$collName"/></xsl:call-template>
+	  </td>
+	</xsl:if>
       </tr>
     </table>
-    
-    <xsl:call-template name="navigationBar">
-      <xsl:with-param name="collName" select="$collName"/>
-    </xsl:call-template>
-  </xsl:template>
-
-  <xsl:template name="navigationBar">
-    <xsl:param name="collName"/>
-    <xsl:variable name="classifiers" select="/page/pageResponse/collection/serviceList/service[@name='ClassifierBrowse']/classifierList"/>
-    <xsl:variable name="action" select="/page/pageRequest/@action"/>
-    <xsl:variable name="classifier"><xsl:if test="$action='b'"><xsl:value-of select="/page/pageRequest/paramList/param[@name='cl']/@value"/></xsl:if></xsl:variable>
-    <xsl:variable name="lang" select="/page/@lang"/>
-    <!--action=<xsl:value-of select="$action"/>, classifier=<xsl:value-of select="$classifier"/>-->
-    <xsl:text disable-output-escaping='yes'>
-      &lt;!-- Navigation Bar --&gt;
-    </xsl:text>
-    <nobr>
-      <xsl:call-template name="nbSearch">
-	<xsl:with-param name="collName" select="$collName"/>
-	<xsl:with-param name="action" select="$action"/>
-      </xsl:call-template>
-      
-      <xsl:for-each select="$classifiers/classifier">
-	<xsl:apply-templates select="." mode="nav-bar-button">
-	  <xsl:with-param name="collName" select="$collName"/>
-	  <xsl:with-param name="classifier" select="$classifier"/>
-	</xsl:apply-templates>
-      </xsl:for-each>
-      <xsl:call-template name="nbPhrase"> <!-- this may be nothing if there is no phrase browsing for a collection -->
-	<xsl:with-param name="collName" select="$collName"/>
-	<xsl:with-param name="action" select="$action"/>
-      </xsl:call-template>  
-    </nobr>
-    <xsl:text disable-output-escaping='yes'>
-      &lt;!-- End of Navigation Bar --&gt;
-    </xsl:text>
-  </xsl:template>
-
-  <xsl:template name="dividerBar">
-    <xsl:param name='text'/>
-    <br/><table width='537' border="0" cellpadding="0" cellspacing="0">
-      <tr><td valign='bottom' height='20' background='interfaces/default/images/greenbar.gif'><font size="+1" color="black"><b>&#160;<xsl:value-of select='$text'/></b></font></td></tr></table><br/>
-  </xsl:template>
-
-  <xsl:template name="navBarImage">
-    <xsl:param name="url"/>
-    <xsl:param name="name"/>
-    <xsl:param name="alt"/>
-    <xsl:variable name="lang" select="/page/@lang"/>
-    <a href="{$url}" onMouseOver="roll('{$name}', 1);" onMouseOut="roll('{$name}', 0);"><img name="{$name}" src="interfaces/nzdl/images/{$lang}/t{$name}of.gif" onLoad="gbutton(this,'interfaces/nzdl/images/{$lang}/t{$name}on.gif');" border='0' alt="{$alt}" title="{alt}"/></a>
-  </xsl:template>
-  
-  <xsl:template name="nbSearch">
-    <xsl:param name="collName"/>
-    <xsl:param name="action"/>
-    <xsl:variable name="lang" select="/page/@lang"/>
-    <xsl:choose>
-      <xsl:when test="$action='q'">
-	<img src="interfaces/nzdl/images/{$lang}/tSearchgr.gif" border='0' alt="Search" title="Search"/>
-      </xsl:when>
-      <xsl:otherwise>
-	<!-- need to check for form search -->
-	<xsl:variable name="query-service">
+    <br/>
+  </xsl:template>
+
+  <xsl:template name="navbar-search">
+    <xsl:param name="collName"/>
+    <xsl:choose>
+      <xsl:when test="/page/pageRequest/@action='q'"><b><nobr><font size='+1' color='{$colour-navbar-selected-text}'>search</font></nobr></b></xsl:when>
+      <xsl:otherwise>
+	<xsl:variable name="service">
 	  <xsl:choose>
 	    <xsl:when test="not(/page/pageRequest/paramList/param[@name='ct'])">TextQuery</xsl:when>
@@ -182,52 +231,38 @@
 	  </xsl:choose>
 	</xsl:variable>
-	<xsl:call-template name="navBarImage">
-	  <xsl:with-param name="url">nzdl?a=q&amp;rt=d&amp;s=<xsl:value-of select="$query-service"/>&amp;c=<xsl:value-of select="$collName"/></xsl:with-param>
-	  <xsl:with-param name="name">Search</xsl:with-param>
-	  <xsl:with-param name="alt">Search</xsl:with-param>
-	</xsl:call-template>
-      </xsl:otherwise>
-    </xsl:choose>
-  </xsl:template>
-  
-  <xsl:template name="nbPhrase">
-    <xsl:param name="collName"/>
-    <xsl:param name="action"/>
-    <xsl:variable name="lang" select="/page/@lang"/>
-    <xsl:if test="/page/pageResponse/collection/serviceList/service[@name='PhindApplet']">
-      <xsl:choose>
-	<xsl:when test="$action='a'"><!-- note, this assumes that the phind applet is the only applet -->
-	  <img src="interfaces/nzdl/images/{$lang}/tPhrasegr.gif" border='0' alt="Phrase Browse" title="Phrase Browse"/>
-	</xsl:when>
-	<xsl:otherwise>
-	  <xsl:call-template name="navBarImage">
-	    <xsl:with-param name="url">nzdl?a=a&amp;rt=d&amp;s=PhindApplet&amp;c=<xsl:value-of select="$collName"/></xsl:with-param>
-	    <xsl:with-param name="name">Phrase</xsl:with-param>
-	    <xsl:with-param name="alt">Phrase Browse</xsl:with-param>
-	  </xsl:call-template>
-	</xsl:otherwise>
-      </xsl:choose>
-    </xsl:if>
-  </xsl:template>
-  
-  <xsl:template match="classifier" mode="nav-bar-button">
-    <xsl:param name="collName"/>
-    <xsl:param name="classifier"/>
-    <xsl:variable name="buttonname"><xsl:choose><xsl:when test="@buttonname"><xsl:value-of select="@buttonname"/></xsl:when><xsl:otherwise><xsl:value-of select="@content"/></xsl:otherwise></xsl:choose></xsl:variable>
-    <xsl:variable name="lang" select="/page/@lang"/>
-    <xsl:choose>
-      <xsl:when test="starts-with($classifier, @name)">
-	<img src="interfaces/nzdl/images/{$lang}/t{$buttonname}gr.gif" border='0' alt="{$buttonname}" title="{$buttonname}"/>
-      </xsl:when>
-      <xsl:otherwise>
-	<xsl:call-template name="navBarImage">
-	  <xsl:with-param name="url">nzdl?a=b&amp;rt=r&amp;s=ClassifierBrowse&amp;c=<xsl:value-of select="$collName"/>&amp;cl=<xsl:value-of select="@name"/></xsl:with-param>
-	  <xsl:with-param name="name" select="$buttonname"/>
-	  <xsl:with-param name="alt" select="$buttonname"/>
-	</xsl:call-template>
-      </xsl:otherwise>
-    </xsl:choose>
-  </xsl:template>
-    
+	
+	<a style="text-decoration:none" href="{$library_name}?a=q&amp;rt=d&amp;s={$service}&amp;c={$collName}"><xsl:attribute name='title'><xsl:value-of select="/page/pageResponse/collection/service[@name=$service]/displayItem[@name='description']"/></xsl:attribute><b><nobr><font size='+1' color='{$colour-navbar-link-text}'>search</font></nobr></b></a>
+      </xsl:otherwise>
+    </xsl:choose>
+  </xsl:template>
+  
+  <xsl:template name="navbar-phind">
+    <xsl:param name="collName"/>
+    <xsl:choose>
+      <xsl:when test="/page/pageRequest/paramList/param[@name='s']/@value='PhindApplet'"><b><nobr><font size='+1' color='{$colour-navbar-selected-text}'>phrases</font></nobr></b></xsl:when>
+      <xsl:otherwise>
+	<a style="text-decoration:none" href="{$library_name}?a=a&amp;rt=d&amp;s=PhindApplet&amp;c={$collName}"><xsl:if test="/page/pageResponse/collection/service[@name='PhindApplet']/displayItem[@name='description']"><xsl:attribute name='title'><xsl:value-of select="/page/pageResponse/collection/service[@name='PhindApplet']/displayItem[@name='description']"/></xsl:attribute></xsl:if><b><nobr><font size='+1' color='{$colour-navbar-link-text}'>phrases</font></nobr></b></a>
+      </xsl:otherwise>
+    </xsl:choose>
+  </xsl:template>
+
+  <xsl:template match="classifier" mode="navbar">
+    <xsl:param name="collName"/>
+    <xsl:param name="clTop"/>
+    <xsl:choose>
+      <xsl:when test="/page/pageRequest/@action='b' and $clTop=@name">
+	<b><nobr><font size='+1' color='{$colour-navbar-selected-text}'><xsl:value-of select="displayItem[@name='name']"/></font></nobr></b></xsl:when>
+      <xsl:otherwise>
+	<a style="text-decoration:none" href="{$library_name}?a=b&amp;rt=r&amp;s=ClassifierBrowse&amp;c={$collName}&amp;cl={@name}"><xsl:attribute name='title'><xsl:value-of select="displayItem[@name='description']"/></xsl:attribute><b><nobr><font size='+1' color='{$colour-navbar-link-text}'><xsl:value-of select="displayItem[@name='name']"/></font></nobr></b></a>
+      </xsl:otherwise>
+    </xsl:choose>
+  </xsl:template>
+
+  <xsl:template name="dividerBar">
+    <xsl:param name='text'/>
+    <br/><table width='537' border="0" cellpadding="0" cellspacing="0">
+      <tr><td valign='bottom' height='20' background='interfaces/default/images/greenbar.gif'><font size="+1" color="black"><b>&#160;<xsl:value-of select='$text'/></b></font></td></tr></table><br/>
+  </xsl:template>
+  
   <xsl:attribute-set name="body-style">
     <xsl:attribute name="bgcolor">#ffffff</xsl:attribute>
@@ -238,6 +273,23 @@
     <xsl:attribute name="background">interfaces/default/images/chalk.gif</xsl:attribute>
   </xsl:attribute-set>
-    
-  <!-- this should probably use a greenstone image rather than nzdl image -->
+
+  <xsl:attribute-set name="td-brownbutton">
+    <xsl:attribute name='background'>interfaces/default/images/brownbutton.gif</xsl:attribute>
+    <xsl:attribute name='height'>20</xsl:attribute>
+    <xsl:attribute name='align'>center</xsl:attribute>
+  </xsl:attribute-set>
+  
+  <xsl:attribute-set name="td-brownbutton-off">
+    <xsl:attribute name='background'>interfaces/default/images/greenbar.gif</xsl:attribute>
+    <xsl:attribute name='height'>20</xsl:attribute>
+    <xsl:attribute name='align'>center</xsl:attribute>
+  </xsl:attribute-set>
+  
+  <xsl:attribute-set name="td-navbar">
+    <xsl:attribute name='background'>interfaces/default/images/greenbar.gif</xsl:attribute>
+    <xsl:attribute name='height'>20</xsl:attribute>
+    <xsl:attribute name='align'>center</xsl:attribute>
+  </xsl:attribute-set>
+
   <xsl:template name="nzdlPageBanner">
     <center>
@@ -257,7 +309,5 @@
       </table>
     </center>
-    
-    <!-- end of page banner -->
-    
+    <!-- end of page banner -->  
   </xsl:template>
 
@@ -269,14 +319,8 @@
   </xsl:template>
   
-
-  <xsl:template name="iconblankbar">
-    <p/><img src="interfaces/default/images/divb.gif" width="537" height="17"/>
-  </xsl:template>
-  
   <xsl:template name="imagegreenstone">
     <img src="interfaces/nzdl/images/gsdl.gif" width="140" height="77" border="0" hspace='0'><xsl:attribute name='alt'><xsl:call-template name='textimagegreenstone'/></xsl:attribute></img>
   </xsl:template>
   
-
   <!-- Display the appropriate image, depending on the node type -->
   <xsl:template match="documentNode" mode="displayNodeIcon">
