Index: /greenstone3/trunk/web/interfaces/gs2/interfaceConfig.xml
===================================================================
--- /greenstone3/trunk/web/interfaces/gs2/interfaceConfig.xml	(revision 16861)
+++ /greenstone3/trunk/web/interfaces/gs2/interfaceConfig.xml	(revision 16861)
@@ -0,0 +1,75 @@
+<interfaceConfig baseInterface="default">
+  <actionList>
+    <action name='p' class='PageAction'>
+      <subaction name='home' xslt='home.xsl'/>
+      <subaction name='about' xslt='about.xsl'/>
+      <subaction name='help' xslt='help.xsl'/>
+      <subaction name='pref' xslt='pref.xsl'/>
+      <subaction name='nav' xslt='nav.xsl'/>
+      <subaction name="html" xslt="html.xsl"/>
+      <subaction name='gli4gs3' xslt='gli4gs3.xsl'/>
+    </action>
+    <action name='q' class='QueryAction' xslt='query.xsl'/>
+    <action name='b' class='GS2BrowseAction' xslt='classifier.xsl'/>
+    <action name='a' class='AppletAction' xslt='applet.xsl'/>
+    <action name='d' class='DocumentAction' xslt='document.xsl'/>
+    <action name='pr' class='ProcessAction' xslt='process.xsl'/>
+    <action name='s' class='SystemAction' xslt='system.xsl'/>
+    <action name='g' class='GeneralAction'>
+      <subaction name="authen" xslt='authen.xsl'/>
+      <subaction name="berry" xslt='berry.xsl'/>
+    </action>
+  </actionList>
+  <languageList>
+  	<language name='ar' displayname='Arabic' default_encoding='windows-1256'/>
+  	<language name='bg' displayname='Bulgarian' default_encoding='utf-8'/>
+  	<language name='bn' displayname='àŠ¬àŠŸàŠàŠ²àŠŸ (Bengali)' default_encoding='utf-8'/>
+  	<language name='ca' displayname='CatalÃ  (Catalan)' default_encoding='utf-8'/>
+  	<language name='cs' displayname='Äesky (Czech)' default_encoding='utf-8'/>
+  	<language name='de' displayname='Deutsch (German)' default_encoding='utf-8'/>
+  	<language name='el' displayname='ÎÎ»Î»Î·ÎœÎ¹ÎºÎ¬ (Greek)' default_encoding='windows-1253'/>
+    <language name='en' displayname='English' default_encoding='utf-8'/>
+    <language name='es' displayname='EspaÃ±ol' default_encoding='utf-8'/>
+    <language name='fa' displayname='Farsi' default_encoding='utf-8'/>
+    <language name='fi' displayname='Finnish' default_encoding='utf-8'/>
+    <language name='fr' displayname='FranÃ§ais' default_encoding='utf-8'/>    
+    <language name='gd' displayname='Gaelic (Scottish)' default_encoding='utf-8'/>
+    <language name='gl' displayname='Galician' default_encoding='utf-8'/>
+    <language name='he' displayname='Hebrew' default_encoding='windows-1255'/>
+    <language name='hi' displayname='Hindi' default_encoding='utf-8'/>
+    <language name='hu' displayname='Hungarian' default_encoding='utf-8'/>
+    <language name='hy' displayname='Armenian' default_encoding='utf-8'/>
+    <language name='id' displayname='Bahasa Indonesia (Indonesian)' default_encoding='utf-8'/>
+    <language name='it' displayname='Italiano' default_encoding='utf-8'/>    
+    <language name='jp' displayname='ã«ã»ãã' default_encoding='utf-8'/>
+    <language name='ka' displayname='Georgian' default_encoding='utf-8'/>
+    <language name='kk' displayname='ÒÐ°Ð·Ð°Ò (Kazakh)' default_encoding='utf-8'/>
+    <language name='kn' displayname='Kannada' default_encoding='utf-8'/>
+    <language name='ky' displayname='ÐÑÑÐ³ÑÐ·ÑÐ° (Kirghiz)' default_encoding='utf-8'/>    
+    <language name='lv' displayname='Latvian' default_encoding='utf-8'/>
+	<language name='mi' displayname='MÄori' default_encoding='utf-8'/>
+	<language name='ml' displayname='Malayalam' default_encoding='utf-8'/>
+	<language name='mn' displayname='ÐÐŸÐœÐ³ÐŸÐ» (Mongolian)' default_encoding='utf-8'/>
+	<language name='mr' displayname='Marathi' default_encoding='utf-8'/>
+	<language name='nl' displayname='Nederlands (Dutch)' default_encoding='utf-8'/>
+	<language name='pl' displayname='polski (Polish)' default_encoding='utf-8'/>
+	<language name='pt-br' displayname='portuguÃªs-BR (Brasil)' default_encoding='utf-8'/>
+	<language name='pt-pt' displayname='portuguÃªs-PT (Portugal)' default_encoding='utf-8'/>
+	<language name='ps' displayname='Pushto' default_encoding='utf-8'/>
+	<language name='prs' displayname='Dari' default_encoding='utf-8'/>
+	<language name='ro' displayname='Romanian' default_encoding='utf-8'/>
+	<language name='ru' displayname='ÑÑÑÑÐºÐžÐ¹ (Russian)' default_encoding='windows-1251'/>
+	<language name='si' displayname='Sinhalese' default_encoding='utf-8'/>
+	<language name='sk' displayname='SlovenÄina (Slovak)' default_encoding='utf-8'/>
+	<language name='sr' displayname='Serbian' default_encoding='utf-8'/>
+	<language name='ta' displayname='Tamil' default_encoding='utf-8'/>	
+	<language name='te' displayname='Telugu' default_encoding='utf-8'/>
+	<language name='th' displayname='Thai' default_encoding='utf-8'/>
+	<language name='tr' displayname='Turkish' default_encoding='windows-1254'/>
+	<language name='uk' displayname='Ukrainian' default_encoding='utf-8'/>
+	<language name='ur' displayname='Urdu' default_encoding='utf-8'/>
+	<language name='vi' displayname='Tiáº¿ng Viá»t' default_encoding='utf-8'/>
+	<language name='zh' displayname='ç®äœäž­æ (Simplified Chinese)' default_encoding='gbk'/>
+	<language name='zh-tr' displayname='ç¹é«äž­æ (Traditional Chinese)' default_encoding='big5'/>
+  </languageList>
+</interfaceConfig>
Index: /greenstone3/trunk/web/interfaces/gs2/js/pref.js
===================================================================
--- /greenstone3/trunk/web/interfaces/gs2/js/pref.js	(revision 16861)
+++ /greenstone3/trunk/web/interfaces/gs2/js/pref.js	(revision 16861)
@@ -0,0 +1,55 @@
+function changePref(val){
+  document.PrefForm.qfm.value = val;
+  // display different options associated with different modes
+  if(val=='1') {    
+    for (var i=0; i<document.getElementsByTagName('tr').length;i++) {
+      var id = document.getElementsByTagName('tr')[i].id;
+      if(id.indexOf("text")!=-1){
+        document.getElementById(id).style.display='none';
+      } else if(id.indexOf("tf")!=-1) {
+        document.getElementById(id).style.display='none';
+      } else if(id.indexOf("adv")!=-1){
+          document.getElementById(id).style.display='table-row';
+      }      
+    }
+  } else if (val=='0') {
+    for (var i=0; i<document.getElementsByTagName('tr').length;i++) {
+      var id = document.getElementsByTagName('tr')[i].id;
+      if(id.indexOf("text")!=-1) {
+        document.getElementById(id).style.display='none';
+      } else if(id.indexOf("adv")!=-1){
+        document.getElementById(id).style.display='none';
+      } else if(id.indexOf("tf")!=-1) {
+        document.getElementById(id).style.display='table-row';
+      }
+    }
+  } else {
+    for (var i=0; i<document.getElementsByTagName('tr').length;i++) {
+      var id = document.getElementsByTagName('tr')[i].id;
+      if(id.indexOf("text")!=-1){
+        document.getElementById(id).style.display='table-row';
+      } else if(id.indexOf("tf")!=-1) {
+        document.getElementById(id).style.display='table-row';
+      } else if(id.indexOf("adv")!=-1){
+        document.getElementById(id).style.display='none';
+      }
+    }
+  }        
+}
+
+function checkForm(){       
+  var qfm = "2";
+  for (var i=0; i<document.getElementsByName('qfm').length; i++) {
+  	if(document.getElementsByName('qfm')[i].checked == true){
+  		qfm = document.getElementsByName('qfm')[i].value;
+  	}	
+  }    
+  // this is actually the text query mode
+  if(qfm=='2'){
+    document.PrefForm.qt.value = '0';
+  }
+  else {
+    document.PrefForm.qt.value = '1';
+  }
+  return true;
+}
Index: /greenstone3/trunk/web/interfaces/gs2/style/classic.css
===================================================================
--- /greenstone3/trunk/web/interfaces/gs2/style/classic.css	(revision 16861)
+++ /greenstone3/trunk/web/interfaces/gs2/style/classic.css	(revision 16861)
@@ -0,0 +1,311 @@
+/* classic stylesheet for greenstone3 */
+
+
+a:link { color: #006666; } 
+
+a:hover { color: #cc9900; }
+
+a:visited { color: #666633; } 
+
+
+.bgimage { background-image: url("../images/chalk.gif"); }
+
+/* this contains everything - all the other divs */
+#page {
+  margin: 0 3em 0 5em;
+  padding: 0;
+}
+
+#banner {
+  margin: 0 0 5px 0;
+  padding:0;
+ 
+}
+
+/* this div contains the bannerlinks and bannertitle paragraphs */
+div.pageinfo {
+  float: right;
+  text-align: right;
+  padding: 0;
+  margin:0 0 3px 0;	
+  width: 50%;
+}
+
+/* home, help, preferences links */
+p.bannerlinks {
+  font-family: sans-serif, arial, helvetica;
+  font-size: 10pt;
+  font-weight: bold;
+  margin:0;
+  padding:0;
+}
+
+/* the title set by the receptionist based on the page action */
+p.bannertitle {
+  font-family: sans-serif, arial, helvetica;
+  font-size: 24px;
+  font-weight: bold;
+  margin: 10px 0 0 0;
+  text-transform: lowercase;
+  white-space: nowrap;
+  padding: 6px 2px 10px 0px;
+  background-repeat: repeat-y;
+  background-position: top right; 
+  background-image: url("../images/banner_bg.png");  
+ 
+ }
+
+
+/* home, help, preferences links */
+p.bannerlinks {
+  font-family: sans-serif, arial, helvetica;
+  font-size: 10pt;
+  font-weight: bold;
+  margin:0;
+  padding:0;
+}
+
+/* the image for the collection, shown in the banner */
+div.collectimage {
+  text-align: left;
+  #height: 100%; /* for IE5/6 to make containing div the full height */
+  float: left;
+  width: 45%;
+  padding:0;
+  margin:0;
+}
+
+p.collectiontitle {
+  font-family: sans-serif, arial, helvetica;
+  font-size: 24px;
+  font-weight: bold;
+  text-transform: lowercase;
+  white-space: nowrap;
+  padding: 8px 0px 12px 2px;
+  background-repeat: repeat-y;
+  background-position: top left; 
+  margin:0;
+}
+
+a.collectiontitle {
+  color: black;
+  text-decoration: none;
+}
+
+/* make sure this is shown under the other divs (which may be floating) */
+div.bannerextra {
+   clear: both;
+}
+
+/* bg image set in style macro */
+div.divbar { /* for "select a collection" */
+  background-image: url("../images/bg_green.png"); 
+  font-family: arial;
+  font-size: 10pt;
+  font-weight: bold;
+  border: 0;
+  width: 100%; /* for ns4 */
+}
+
+/* bg image set in style macro */
+div.navbar {
+  background-image: url("../images/bg_green.png"); 	
+  min-width: 500px;
+  white-space: nowrap;
+  font-family: sans-serif, arial, helvetica;
+  font-size: 10pt;
+  font-weight: bold;
+  text-transform: lowercase;
+  border: 0;
+  width: 100%; /* for ns4 */
+}
+
+
+p.navbar { /* opt navbar text inside a divbar div */
+  text-align: center; 
+  margin: 0;
+  padding: 0;	
+}
+
+/* bg image set in style macro */
+a.navlink {
+  vertical-align: top; 
+  padding: 0 10px; 
+  color: black;
+  text-decoration: none;
+  background-image: url("../images/bg_off.png");
+  margin: 0 0 0 20px;
+}
+
+/* bg image set in style macro */
+a.navlink_sel {
+  vertical-align: top;
+  padding: 0 10px;
+  color: black;
+  text-decoration: none;
+  background-image: url("../images/bg_green.png"); 	
+}
+
+a.navlink:visited {
+  color: black;
+}
+
+/* for the nav_ns4.dm macro only (for netscape4 support) */
+a.navlink_ns4 {
+  background-color: #e8d9b1;
+}
+
+a.navlink:hover { 
+   background-image: url("../images/bg_on.png");
+ }
+
+span.narspace{
+  padding:0;
+  margin: 0 0 0 20px;		
+}
+
+div.document {
+  padding: 5px 0 0 0;
+  margin:0;
+}
+
+span.textselect { white-space: nowrap; }
+
+div.documenttext { clear: both; } /* come after any floating divs */
+
+div.heading_title {
+ font-size: 16pt;
+ font-weight: bold;
+
+} /* alternate to cover image */
+
+div.heading_image { float: left; } /* optional cover image */
+
+div.document div.buttons {
+   /* anything that holds buttons... toc_buttons but also continue button */
+   width: 100px; /* each button (inside its own div) can overflow this */
+}
+
+div#toc_buttons { /* expand/contract etc "buttons" */
+  clear: left; /* don't put next to another float on our left-hand side */
+  float: left;
+  margin: 0 15px 5px 0; 
+}
+
+div.button {
+  font-size: 11px;
+  font-weight: bold;
+  line-height: 1.2em;
+  /*background: #ffeecc; */
+  background: #f7e7c5;
+  margin: 1px;
+  border: 1px solid #eeddbb;
+  text-align: center;
+  vertical-align: middle;
+  height: 30px; /* IE6 and NS4 treat width/height as min-width/min-height */
+  width: 110px;
+}
+
+*>div.button { /* for other browsers - IE6 doesn't apply this */
+  height: auto;
+  width: auto;
+  min-height: 30px; 
+  min-width: 110px;
+}
+
+span.button {}
+span.button a { text-decoration: none; color: black; }
+span.button a:hover { /* IE6 doesn't do :hover for things that aren't <A> */
+  background: #eeddbb;
+}
+
+/* new added */
+div.formheading{
+  font-size: 16pt;
+  font-weight: bold;
+  margin: .5em 0 0;
+  padding:0;
+}
+
+table{table-layout:fixed;}
+tr{overflow:hidden;}
+td{overflow:hidden;}
+
+td.col1{width:25%;}
+td.col2{width:15;}
+td.col3{width:75%;}
+
+div.documentarrows{
+  clear: both; 
+  margin: 0 0 0 0;
+  padding: 1em 0 0 0;   
+}
+
+img.lessarrow{
+  float:left;
+  border: none;  
+}
+
+img.morearrow{
+  float:right;
+  border:none; 
+}
+
+img.lessarrowrtl{
+  float:right;
+  border: none;  
+}
+
+img.morearrowrtl{
+  float:left;
+  border:none; 
+}
+
+div#documentinfo { 
+  float:left;
+  padding-right: 10px;
+  margin:0;
+ } 
+
+ul#docbuttons li {
+  display: block;
+  font-size: 11px;
+  font-weight: bold;
+  background: #f7e7c5;
+  margin: 1px;
+  border: 1px solid #eeddbb;
+  text-align: center;
+  vertical-align: middle;
+  height: 30px; /* IE6 and NS4 treat width/height as min-width/min-height */
+    
+}
+
+div#toc{
+ float: left;	
+}
+
+ul#tocnodes li{
+ margin: 0;
+ padding: 5px 0 0 0;
+ display:block;
+}
+
+ul.tocnode {
+  margin:0;
+  padding:5px 0 0 20px;
+}
+
+ul.tocnode  a{
+ margin: 0;
+ padding:0 5px 0 0;
+ }
+
+span.bold{
+  font-weight: bold;	   
+}
+
+
+div.simplehelp li {
+ margin:0;
+ display:block;
+}
Index: /greenstone3/trunk/web/interfaces/gs2/style/classic2.css
===================================================================
--- /greenstone3/trunk/web/interfaces/gs2/style/classic2.css	(revision 16861)
+++ /greenstone3/trunk/web/interfaces/gs2/style/classic2.css	(revision 16861)
@@ -0,0 +1,59 @@
+ul {
+  margin:0;
+  padding:0; 
+  list-style-type: none; 
+}
+
+ul li{
+  margin:0;
+  padding:0;
+  display: inline;
+}
+
+ul#resultlist li{
+  display:block;
+}
+
+
+ul#classifiernodelist li{
+  list-style: none;
+  margin: 0;
+  padding: 0;
+  display: block;
+}
+
+ul.childrenlist{
+  margin: 0 0 0 20px ;
+  padding: 0;
+  display: block;
+}
+
+div#navbar{
+  clear:both;
+}
+
+ul#navbarlist{
+  margin:0;
+  padding:0; 
+  list-style-type: none; 
+  text-align:center;
+  width: 100%;
+  font-size: 80%;
+  background-image: url('../images/bg_green.png');	  
+  background-color: #99CC99
+ }
+
+ul#navbarlist li a {
+  padding: 0 20px 0 20px; 
+  margin: 0;
+  color: #000000; 
+  text-decoration: none;
+}
+
+ul#navbarlist li a:link, ul#navbarlist li a:visited{
+   background-image: url('../images/bg_off.png') ;
+ }
+
+ul#navbarlist li a:hover{
+  background-image: url('../images/bg_on.png') ;
+}
Index: /greenstone3/trunk/web/interfaces/gs2/transform/about.xsl
===================================================================
--- /greenstone3/trunk/web/interfaces/gs2/transform/about.xsl	(revision 16861)
+++ /greenstone3/trunk/web/interfaces/gs2/transform/about.xsl	(revision 16861)
@@ -0,0 +1,56 @@
+<?xml version="1.0" encoding="ISO-8859-1"?>
+<xsl:stylesheet version="1.0"
+  xmlns:xsl="http://www.w3.org/1999/XSL/Transform"
+  xmlns:java="http://xml.apache.org/xslt/java"
+  xmlns:util="xalan://org.greenstone.gsdl3.util.XSLTUtil"
+  extension-element-prefixes="java util"
+  exclude-result-prefixes="java util">
+
+  <!-- style includes global params interface_name, library_name -->
+  <xsl:include href="style.xsl"/>
+  <xsl:include href="help-common.xsl"/>
+  <xsl:include href="query-common.xsl"/>
+  <xsl:include href="service-params.xsl"/>
+  <xsl:output method="html"/>  
+
+  <xsl:template name="pageTitle">
+    <xsl:value-of select="/page/pageResponse/collection/displayItem[@name='name']"/>  
+  </xsl:template>
+
+  <!-- page specific style goes here -->
+  <xsl:template name="pageStyle"/>
+
+
+  <xsl:template match="pageResponse">
+    <xsl:variable name="collName" select="/page/pageRequest/paramList/param[@name='c']/@value"/>
+      <xsl:apply-templates select="collection"><xsl:with-param name="collName" select="$collName"/></xsl:apply-templates>
+
+  </xsl:template>
+
+  <xsl:template match="collection">
+    <xsl:param name="collName"/>
+    <xsl:call-template name="standardPageBanner">
+      <xsl:with-param name="collName" select="$collName"/>
+      <xsl:with-param name="pageType">about</xsl:with-param>
+    </xsl:call-template>
+    <xsl:call-template name="navigationBar">
+      <xsl:with-param name="collName" select="$collName"/>
+    </xsl:call-template>
+    <div class="document">
+    <xsl:if test="/page/pageRequest/paramList/param[@name='ct']/@value = 0">
+    <xsl:apply-templates select="serviceList/service[@name='TextQuery']">
+      <xsl:with-param name="collName" select="$collName"/></xsl:apply-templates>
+    <xsl:call-template name="dividerBar"/>
+    </xsl:if>
+    </div>
+    <div>
+    <xsl:if test="displayItem[@name='description']">
+    <h3><xsl:value-of select="util:getInterfaceText($interface_name, /page/@lang, 'about.aboutcoll')"/></h3>
+    <p><xsl:value-of select="displayItem[@name='description']" disable-output-escaping='yes'/></p>
+    </xsl:if>
+    <xsl:apply-templates select="." mode="simplehelp"/>
+    </div>	
+  </xsl:template>
+
+</xsl:stylesheet>  
+
Index: /greenstone3/trunk/web/interfaces/gs2/transform/applet.xsl
===================================================================
--- /greenstone3/trunk/web/interfaces/gs2/transform/applet.xsl	(revision 16861)
+++ /greenstone3/trunk/web/interfaces/gs2/transform/applet.xsl	(revision 16861)
@@ -0,0 +1,40 @@
+<?xml version="1.0" encoding="ISO-8859-1"?>
+<xsl:stylesheet version="1.0"
+  xmlns:xsl="http://www.w3.org/1999/XSL/Transform"
+  xmlns:java="http://xml.apache.org/xslt/java"
+  xmlns:util="xalan://org.greenstone.gsdl3.util.XSLTUtil"
+  extension-element-prefixes="java util"
+  exclude-result-prefixes="java util">
+  
+  <xsl:include href="style.xsl"/>
+  
+  <xsl:output method="html"/>  
+
+  <xsl:template name="pageTitle">
+    <xsl:value-of select="pageResponse/service/applet"/>
+  </xsl:template>
+
+  <!-- page specific style goes here -->
+  <xsl:template name="pageStyle"/>
+
+  <xsl:template match="pageResponse">
+    <xsl:variable name="collName"><xsl:value-of select="../pageRequest/paramList/param[@name='c']/@value"/></xsl:variable>
+    <center>
+      <xsl:call-template name="standardPageBanner">
+	<xsl:with-param name="collName" select="$collName"/>
+	<xsl:with-param name="pageType"><xsl:choose><xsl:when test="service[@name='PhindApplet']">phrases</xsl:when><xsl:otherwise>applet</xsl:otherwise></xsl:choose></xsl:with-param>
+      </xsl:call-template>
+      <p/>
+    <xsl:call-template name="navigationBar">
+      <xsl:with-param name="collName" select="$collName"/>
+    </xsl:call-template>      
+<!--      <xsl:call-template name="dividerBar">
+	<xsl:with-param name="text" select="service/displayItem[@name='name']"/>
+      </xsl:call-template>-->
+      <p/>
+      <xsl:copy-of select="service/applet"/>
+      <xsl:call-template name="dividerBar"/>
+    </center>
+  </xsl:template>
+</xsl:stylesheet>  
+
Index: /greenstone3/trunk/web/interfaces/gs2/transform/authen.xsl
===================================================================
--- /greenstone3/trunk/web/interfaces/gs2/transform/authen.xsl	(revision 16861)
+++ /greenstone3/trunk/web/interfaces/gs2/transform/authen.xsl	(revision 16861)
@@ -0,0 +1,644 @@
+<?xml version="1.0" encoding="ISO-8859-1"?>
+<xsl:stylesheet version="1.0"
+  xmlns:xsl="http://www.w3.org/1999/XSL/Transform"
+  xmlns:java="http://xml.apache.org/xslt/java"
+  xmlns:util="xalan://org.greenstone.gsdl3.util.XSLTUtil"
+  extension-element-prefixes="java util"
+  exclude-result-prefixes="java util">
+
+  <xsl:include href="style.xsl"/>
+  <xsl:include href="service-params.xsl"/>
+
+  <xsl:output method="html"/>  
+
+  <xsl:param name="library_name"/> 
+
+  <xsl:template name="pageTitle">
+    <xsl:value-of select="util:getInterfaceText($interface_name, /page/@lang, 'authen.authentication')"/>
+  </xsl:template>
+
+ <xsl:template name="pageStyle"/>
+
+  <xsl:template match="page">
+    <html>
+      <xsl:call-template name="pageHead" />
+      <xsl:call-template name="addGroup" />
+      <body class="bgimage">
+	<div id="page">
+ 	  <xsl:variable name="authen_service" select="/page/pageRequest/paramList/param[@name='s']/@value"/>
+	  <xsl:variable name="sub_action" select="/page/pageRequest/@subaction"/>
+	  <xsl:variable name="asn_param" select ="/page/pageRequest/paramList/param[@name='s1.asn']/@value"/>
+	  <xsl:variable name="uan" select ="/page/pageRequest/paramList/param[@name='s1.uan']/@value"/>
+	  <xsl:variable name="pro_action" select ="/page/pageResponse/authenticationNode/service/@aup"/>
+	  <xsl:variable name="au_node" select ="/page/pageResponse/authenticationNode"/>
+	  <xsl:variable name="asn" select ="/page/pageResponse/authenticationNode/service/@asn"/>
+	  <xsl:variable name="info" select ="/page/pageResponse/authenticationNode/service/@info"/>
+	  <xsl:variable name="err" select ="/page/pageResponse/authenticationNode/service/@err"/>
+	  <xsl:variable name="rt" select="/page/pageRequest/paramList/param[@name='rt']/@value"/>
+	  <xsl:variable name="un_s" select="/page/pageResponse/authenticationNode/service/@un"/>
+	  <xsl:variable name="pw_s" select="/page/pageResponse/authenticationNode/service/@pw"/>
+	  
+	  <div align="left" >
+	    <table align="left" border="0" width="100%">
+	      <tr align="left">
+		<td><h2><xsl:value-of select="util:getInterfaceText($interface_name, /page/@lang, 'authen.authentication')"/></h2></td>
+		<td><xsl:if test="$un_s!=''">
+		    <xsl:if test="$asn!='' and $asn!='0'">
+		    <xsl:value-of select="util:getInterfaceText($interface_name, /page/@lang, 'authen.username')"/>  :  <xsl:value-of select="$un_s"/>
+		    </xsl:if>
+		  </xsl:if></td>
+	      </tr>
+	    </table>
+	  </div>
+
+	  <div id="navbar">
+	     
+	    <ul id="navbarlist">
+	      <!--greenstone home-->
+	      <li><a href="{$library_name}"><xsl:value-of select="util:getInterfaceText($interface_name, /page/@lang, 'authen.greenstone_home')"/></a></li>
+	      
+	      <!--list users-->
+	      <li>
+		<xsl:choose>
+		  <xsl:when test="$asn!='' and $asn!='0' and $un_s!=''">
+		    <a href="{$library_name}?a=g&amp;rt=r&amp;sa=authen&amp;s=Authentication&amp;s1.aup=ListUsers&amp;s1.asn={$asn}&amp;s1.uan=1&amp;s1.un={$un_s}&amp;s1.pw="><xsl:value-of select="util:getInterfaceText($interface_name, /page/@lang, 'authen.list_users')"/></a>
+	    </xsl:when>
+	      <xsl:otherwise>
+		<a href="{$library_name}?a=g&amp;rt=r&amp;sa=authen&amp;s=Authentication&amp;s1.asn=&amp;s1.aup=Login"><xsl:value-of select="util:getInterfaceText($interface_name, /page/@lang, 'authen.list_users')"/></a>
+	      </xsl:otherwise>
+	    </xsl:choose></li>
+	      
+	      <!--add a new user-->
+	      <li>
+		<xsl:choose>
+		  <xsl:when test="$asn!='' and $asn!='0' and $un_s!=''">
+		    <a href="{$library_name}?a=g&amp;rt=r&amp;sa=authen&amp;s=Authentication&amp;s1.aup=AddUser&amp;s1.asn={$asn}&amp;s1.uan=1&amp;s1.un={$un_s}&amp;s1.pw=&amp;s1.umun=&amp;s1.umpw=&amp;s1.umgp=&amp;s1.umas=&amp;s1.umc="><xsl:value-of select="util:getInterfaceText($interface_name, /page/@lang, 'authen.add_a_new_user')"/></a> 
+		  </xsl:when>
+		  <xsl:otherwise>
+		    <a href="{$library_name}?a=g&amp;rt=r&amp;sa=authen&amp;s=Authentication&amp;s1.asn=&amp;s1.aup=Login"><xsl:value-of select="util:getInterfaceText($interface_name, /page/@lang, 'authen.add_a_new_user')"/></a>
+		  </xsl:otherwise>
+		</xsl:choose>
+	      </li>
+	     
+	      <!-- change password-->
+	      <li>
+		<xsl:choose>
+		  <xsl:when test="$asn!='' and $asn!='0' and $un_s!=''">
+		    <a href="{$library_name}?a=g&amp;rt=r&amp;sa=authen&amp;s=Authentication&amp;s1.aup=ModifyPassword&amp;s1.asn={$asn}&amp;s1.uan=1&amp;s1.un={$un_s}&amp;s1.pw=&amp;s1.umpw1=&amp;s1.umpw2=&amp;s1.umpw="><xsl:value-of select="util:getInterfaceText($interface_name, /page/@lang, 'authen.change_password')"/></a>
+		  </xsl:when>
+		  <xsl:otherwise>
+		    <a href="{$library_name}?a=g&amp;rt=r&amp;sa=authen&amp;s=Authentication&amp;s1.asn=&amp;s1.aup=Login"><xsl:value-of select="util:getInterfaceText($interface_name, /page/@lang, 'authen.change_password')"/></a>
+		  </xsl:otherwise>
+		</xsl:choose>
+	      </li>
+
+	      <li>
+		<xsl:choose>
+		  <xsl:when test="$un_s!='' and $asn!='' and $asn!='0'">
+		    <a href="{$library_name}?a=g&amp;rt=r&amp;sa=authen&amp;s=Authentication&amp;s1.asn=&amp;s1.aup=Login&amp;s1.un=&amp;s1.pw="><xsl:value-of select="util:getInterfaceText($interface_name, /page/@lang, 'authen.logout')"/></a>
+		  </xsl:when>
+		  <xsl:otherwise>
+		    <a href="{$library_name}?a=g&amp;rt=r&amp;sa=authen&amp;s=Authentication&amp;s1.asn=&amp;s1.aup=Login"><xsl:value-of select="util:getInterfaceText($interface_name, /page/@lang, 'authen.login')"/></a>
+		  </xsl:otherwise>
+		</xsl:choose>
+	      </li>
+	    </ul>
+	  </div>
+
+	  <table align="left" border="0" width="100%">
+	    <tr>
+	      <td>
+		<div id="content" align="center">
+		  <!-- login -->
+		  <xsl:if test="$pro_action='Login'">
+		    <xsl:choose>
+		      <xsl:when test="$asn!='' and $asn!='0'">
+			<p align="left"> <xsl:value-of select="util:getInterfaceText($interface_name, /page/@lang, 'authen.login_successfully')"/></p>
+		      </xsl:when>
+		      <xsl:otherwise>
+
+			  <p align="left">
+			    <xsl:value-of select="util:getInterfaceText($interface_name, /page/@lang, 'authen.login_descibe_line_3')"/><br/></p>
+			  <xsl:if test="$err='un-pw-err'">
+			    <p align="left"><font color='red'><xsl:value-of select="util:getInterfaceText($interface_name, /page/@lang, 'authen.wrong_password_warning')"/></font></p>
+			  </xsl:if>
+			  <xsl:if test="$err='no-permission' and $info='Login'">
+			    <p align="left"><font color='red'><xsl:value-of select="util:getInterfaceText($interface_name, /page/@lang, 'authen.no_permission')"/></font></p>
+			  </xsl:if>
+			 <xsl:if test="$err='as-false'">
+			    <p align="left"><font color='red'><xsl:value-of select="util:getInterfaceText($interface_name, /page/@lang, 'authen.account_status_false')"/></font></p>
+			  </xsl:if>
+			  <xsl:call-template name="login">
+			    <xsl:with-param name="sub_action" select="$sub_action"/>
+			    <xsl:with-param name="authen_service" select="$authen_service"/>
+			    <xsl:with-param name="pro_action" select="$pro_action"/>	
+			  </xsl:call-template>
+
+		      </xsl:otherwise>
+		   </xsl:choose>
+		  </xsl:if>
+
+		  <!-- list users-->
+		  <xsl:if test="$pro_action='ListUsers'">
+		    
+		    <xsl:if test="$asn='1' and $info='all-un'">
+		      <xsl:call-template name="listusers" >
+		      </xsl:call-template>
+		    </xsl:if>
+
+		    <xsl:if test="$info='Login'">
+		      <p align="left">
+			<xsl:value-of select="util:getInterfaceText($interface_name, /page/@lang, 'authen.login_descibe_line_2')"/><br/></p>
+		      <xsl:if test="$err='no-permission' and $info='Login'">
+			<p align="left"><font color='red'><xsl:value-of select="util:getInterfaceText($interface_name, /page/@lang, 'authen.no_permission')"/></font></p>
+		      </xsl:if>
+		    </xsl:if>
+		  </xsl:if>
+		  
+		  <!-- add a new user-->
+		  <xsl:if test="$pro_action='AddUser'"> 
+		    <xsl:if test="$err!='' and $err!='no-permission' and $err!='un-exist' and $err!='un-err' and $err!='pw-err'">
+			<p align="left"><font color='red'><xsl:value-of select="$err" /></font></p>
+		    </xsl:if>
+
+		    <xsl:if test="$asn!='1'">
+		      <p align="left">
+			<xsl:value-of select="util:getInterfaceText($interface_name, /page/@lang, 'authen.login_descibe_line_2')"/><br/>
+		</p>
+		      <xsl:if test="$err='no-permission'">
+			<p align="left"><font color='red'><xsl:value-of select="util:getInterfaceText($interface_name, /page/@lang, 'authen.no_permission')"/></font></p>
+		      </xsl:if>
+		    </xsl:if>
+		    
+		    <xsl:if test="count(/page/pageResponse/authenticationNode/service/userNodeList) = 1">
+		      <xsl:call-template name="listusers" >
+		      </xsl:call-template>
+		    </xsl:if>
+		    
+		    <xsl:if test="$info='adduser_interface'">
+		      <h2 align="left"><xsl:value-of select="util:getInterfaceText($interface_name, /page/@lang, 'authen.add_a_new_user_title')"/></h2>
+		      <xsl:if test="$err='pw-err'">
+			<p align="left"><font color="red"><xsl:value-of select="util:getInterfaceText($interface_name, /page/@lang, 'authen.password_err')"/></font></p>
+		      </xsl:if>	
+		      <xsl:if test="$err='un-err'">
+			<p align="left"><font color="red"><xsl:value-of select="util:getInterfaceText($interface_name, /page/@lang, 'authen.unsername_err')"/></font></p>
+		      </xsl:if>	
+		    <xsl:if test="$err='un-exist'">
+			<p align="left"><font color='red'><xsl:value-of select="util:getInterfaceText($interface_name, /page/@lang, 'authen.user_has_existed')"/></font></p>
+		      </xsl:if>
+		      <xsl:call-template name="edituser" >
+			<xsl:with-param name="sub_action" select="$sub_action"/>
+			<xsl:with-param name="authen_service" select="$authen_service"/>
+			<xsl:with-param name="pro_action" select="$pro_action"/>
+			<xsl:with-param name="umun_s" />
+			<xsl:with-param name="umpw_s" />
+			<xsl:with-param name="umas_s" />
+			<xsl:with-param name="umgp_s" />
+			<xsl:with-param name="umc_s" />
+			<xsl:with-param name="oumun_s" />
+			<xsl:with-param name="un_s" select="$un_s"/>
+			<xsl:with-param name="pw_s" select="$pw_s"/>
+			<xsl:with-param name="asn" select="$asn"/>
+		      </xsl:call-template>
+
+		    </xsl:if> 
+		  </xsl:if>
+		  
+		  <!-- modify the passwrod of a user-->
+		  <xsl:if test="$pro_action='ModifyPassword'">
+		    
+		    <xsl:if test="$err!='' and $err!='umpw1-err' and $err!='umpw2-err' and $err!='pw-umpw-nm-err' and $err!='umpw-null-err' and $err!='umpw1-umpw2-nm-err' and $err!='umpw1-umpw2-null-err'"><p align="left"><font color='red'><xsl:value-of select="$err" /></font></p>
+		    </xsl:if>
+
+		    <xsl:if test="$err=''">
+		      <h2 align="left"><xsl:value-of select="util:getInterfaceText($interface_name, /page/@lang, 'authen.change_password_title')"/></h2>
+		      <p align="left"><xsl:value-of select="util:getInterfaceText($interface_name, /page/@lang, 'authen.change_password_successed_content')"/></p>
+		    </xsl:if>
+		    
+		    <xsl:if test="$asn!='0' and $info='modify_interface'">
+		      <h2 align="left"><xsl:value-of select="util:getInterfaceText($interface_name, /page/@lang, 'authen.change_password_title')"/></h2>
+		      <p align="left"><font color="grey"><xsl:value-of select="util:getInterfaceText($interface_name, /page/@lang, 'authen.change_password_describe_line_1')"/></font></p>
+
+		      <xsl:if test="$err='umpw1-err'">
+			<p align="left"><font color="red"><xsl:value-of select="util:getInterfaceText($interface_name, /page/@lang, 'authen.new_password_invalid')"/></font></p>
+		      </xsl:if>
+		      <xsl:if test="$err='umpw2-err'">
+			<p align="left"><font color="red"><xsl:value-of select="util:getInterfaceText($interface_name, /page/@lang, 'authen.retyped_password_invalid')"/></font></p>
+		      </xsl:if>
+		      <xsl:if test="$err='pw-umpw-nm-err' or $err='umpw-null-err'">
+			<p align="left"><font color="red"><xsl:value-of select="util:getInterfaceText($interface_name, /page/@lang, 'authen.old_password_warning')"/></font></p>
+		      </xsl:if>  
+		      <xsl:if test="$err='umpw1-umpw2-nm-err'">
+			<p align="left"><font color="red"><xsl:value-of select="util:getInterfaceText($interface_name, /page/@lang, 'authen.two_password_not_match')"/></font></p>
+		      </xsl:if> 
+		      <xsl:if test="$err='umpw1-umpw2-null-err'">
+			<p align="left"><font color="red"><xsl:value-of select="util:getInterfaceText($interface_name, /page/@lang, 'authen.password_empty_warning')"/></font></p>
+		      </xsl:if> 
+		      
+		      <xsl:call-template name="modifypassword">
+			<xsl:with-param name="sub_action" select="$sub_action"/>
+			<xsl:with-param name="authen_service" select="$authen_service"/>
+			<xsl:with-param name="pro_action" select="$pro_action"/>
+			<xsl:with-param name="un_s" select="$un_s"/>
+			<xsl:with-param name="pw_s" select="$pw_s"/>
+			<xsl:with-param name="asn" select="$asn"/>
+		      </xsl:call-template>
+		    </xsl:if>
+		  </xsl:if> 
+
+		  <!-- delete a user -->
+		  <xsl:if test="$pro_action='DeleteUser'"> 
+		    <xsl:if test="$err!=''">
+		      <p align="left"><font color='red'><xsl:value-of select="$err" /></font></p>
+		    </xsl:if>
+
+		    <xsl:if test="$info='confirm'">
+		      <xsl:call-template name="deleteuser"> 
+			<xsl:with-param name="sub_action" select="$sub_action"/>
+			<xsl:with-param name="authen_service" select="$authen_service"/>
+			<xsl:with-param name="pro_action" select="$pro_action"/>
+			<xsl:with-param name="un_s" select="$un_s"/>
+			<xsl:with-param name="umun_s" select="/page/pageResponse/authenticationNode/service/@umun"/>	
+			<xsl:with-param name="asn" select="$asn"/>
+		      </xsl:call-template>
+		    </xsl:if>
+		    <xsl:if test="count(/page/pageResponse/authenticationNode/service/userNodeList) = 1">
+		      <xsl:call-template name="listusers" >
+		      </xsl:call-template>
+		    </xsl:if>
+		  </xsl:if>
+		  
+		  <!-- edit the user's info -->
+		  <xsl:if test="$pro_action='EditUser'"> 
+		    <xsl:if test="$err!='' and $err!='umpw-err' and $err!='umun-err' and $err!='ini-umpw-err' and $err!='un-exist'">
+		      <p align="left"><font color='red'><xsl:value-of select="$err" /></font></p>
+		    </xsl:if>
+
+		    <xsl:if test="$info='edituser-interface'"> 
+		      <h2 align="left"><xsl:value-of select="util:getInterfaceText($interface_name, /page/@lang, 'authen.edit_user_information')"/></h2>
+		      <xsl:if test="$err='umpw-err'"> 
+			<p align="left"><font color="red"><xsl:value-of select="util:getInterfaceText($interface_name, /page/@lang, 'authen.password_err')"/></font></p>
+		      </xsl:if>
+		      <xsl:if test="$err='umun-err'"> 
+			<p align="left"><font color="red"><xsl:value-of select="util:getInterfaceText($interface_name, /page/@lang, 'authen.unsername_err')"/></font></p>
+		      </xsl:if>
+		      <xsl:if test="$err='ini-umpw-err'"> 
+			<p align="left"><font color="red"><xsl:value-of select="util:getInterfaceText($interface_name, /page/@lang, 'authen.password_initial')"/></font></p>
+		      </xsl:if>
+		       <xsl:if test="$err='un-exist'">
+			<p align="left"><font color='red'><xsl:value-of select="util:getInterfaceText($interface_name, /page/@lang, 'authen.user_has_existed')"/></font></p>
+		      </xsl:if>
+		      <xsl:call-template name="edituser" >
+			<xsl:with-param name="sub_action" select="$sub_action"/>
+			<xsl:with-param name="authen_service" select="$authen_service"/>
+			<xsl:with-param name="pro_action" select="$pro_action"/>
+			<xsl:with-param name="umun_s" select="/page/pageResponse/authenticationNode/service/@umun"/>
+			<xsl:with-param name="umpw_s" select="/page/pageResponse/authenticationNode/service/@umpw"/>
+			<xsl:with-param name="umas_s" select="/page/pageResponse/authenticationNode/service/@umas"/>
+			<xsl:with-param name="umgp_s" select="/page/pageResponse/authenticationNode/service/@umgp"/>
+			<xsl:with-param name="umc_s" select="/page/pageResponse/authenticationNode/service/@umc"/>
+			<xsl:with-param name="oumun_s" select="/page/pageResponse/authenticationNode/service/@oumun"/>
+			<xsl:with-param name="un_s" select="$un_s"/>
+			<xsl:with-param name="pw_s" select="$pw_s"/>
+			<xsl:with-param name="asn" select="$asn"/>
+		      </xsl:call-template>
+		    </xsl:if> 
+		    <xsl:if test="$info='all-un'">
+		      <xsl:if test="count(/page/pageResponse/authenticationNode/service/userNodeList) = 1">
+			<xsl:call-template name="listusers" >
+			</xsl:call-template>
+		      </xsl:if>
+		    </xsl:if>
+		  </xsl:if>
+		  
+		</div>
+	      </td>
+	    </tr>
+	  </table>
+	  <div id="navbar">
+	    <xsl:call-template name="greenstoneFooter" />
+	  </div>
+	</div>
+      </body>
+    </html>
+  </xsl:template>
+  
+ <!--template name="login"-->
+  <xsl:template name="login">
+    <xsl:param name="sub_action"/>
+    <xsl:param name="authen_service"/>
+    <xsl:param name="pro_action"/>
+    <div>
+      <form id="LoginForm" method="get" action="{$library_name}">
+	<input type='hidden' name='a' value='g'/>
+	<input type='hidden' name='sa' value='{$sub_action}'/>
+	<input type='hidden' name='s' value='{$authen_service}'/>
+	<input type='hidden' name='rt' value='r'/>
+	<input type='hidden' name='s1.asn' value='0'/>
+	<input type='hidden' name='s1.uan' value='1'/>
+	<input type='hidden' name='s1.aup' value='{$pro_action}'/>
+	<input type='hidden' name='s1.umpw1' value=''/>
+	<input type='hidden' name='s1.umpw2' value=''/>
+	<input type='hidden' name='s1.umc' value=''/>
+	<input type='hidden' name='s1.umgp' value=''/>
+	<input type='hidden' name='s1.umun' value=''/>
+	<input type='hidden' name='s1.umpw' value=''/>
+	<input type='hidden' name='s1.umas' value=''/>
+
+	<table align="center">
+	  <tr>
+	    <td><xsl:value-of select="util:getInterfaceText($interface_name, /page/@lang, 'authen.username')"/></td><td><input type="string" name="s1.un" size="10" value=""/></td><td></td>
+	  </tr>
+	  <tr>
+	    <td><xsl:value-of select="util:getInterfaceText($interface_name, /page/@lang, 'authen.password')"/></td><td><input type="password" name="s1.pw" size="10" value=""/></td><td>
+	      <input type="submit" value="submit"></input></td>
+	  </tr>
+	  </table>
+      </form>
+    </div>
+  </xsl:template>
+
+ <!--template name="listusers"-->
+  <xsl:template name="listusers" >
+   <h2 align="left"><xsl:value-of select="util:getInterfaceText($interface_name, /page/@lang, 'authen.list_of_current_users_title')"/></h2>
+
+    <table id='mainTable' align="left" border="0" cellspacing="1" cellpadding="3" width="100%" >
+      <tr>
+	<th bgcolor="#d0d0d0"><xsl:value-of select="util:getInterfaceText($interface_name, /page/@lang, 'authen.username')"/></th>
+	<th bgcolor="#d0d0d0"><xsl:value-of select="util:getInterfaceText($interface_name, /page/@lang, 'authen.account_status')"/></th>
+	<th bgcolor="#d0d0d0"><xsl:value-of select="util:getInterfaceText($interface_name, /page/@lang, 'authen.groups')"/></th>
+	<th bgcolor="#d0d0d0"><xsl:value-of select="util:getInterfaceText($interface_name, /page/@lang, 'authen.comment')"/></th>
+	<th bgcolor="#d0d0d0"></th>
+      </tr>
+      <xsl:for-each select="/page/pageResponse/authenticationNode/service/userNodeList/userNode">
+      <tr>
+	<td bgcolor="#eeeeee"><xsl:value-of select="@umun"/></td>
+	<td id="status" bgcolor="#eeeeee">
+	    <script type="text/javascript">
+	      <xsl:text disable-output-escaping="yes">
+		var status="</xsl:text><xsl:value-of select="@umas"/><xsl:text disable-output-escaping="yes">";
+		if (status=="true"){
+		   document.getElementById("status").innerHTML="enabled";
+		}
+		if (status=="false"){
+		   document.getElementById("status").innerHTML="disabled";
+		}
+	      </xsl:text>		 
+	    </script>
+	  </td>
+	<td id="group" bgcolor="#eeeeee">
+	     <script type="text/javascript">
+	      <xsl:text disable-output-escaping="yes">
+		var groups="</xsl:text><xsl:value-of select="@umgp"/><xsl:text disable-output-escaping="yes">";
+		var split_groups= groups.split(",");
+		var new_groups="";
+		for (j=0; j &lt; split_groups.length ; j++){
+                   new_groups+=split_groups[j]+" &lt;br /&gt; ";
+	       }
+	      document.getElementById('group').innerHTML=new_groups;
+	      </xsl:text>		 
+	    </script>
+	  </td>
+	<td bgcolor="#eeeeee"><xsl:value-of select="@umc"/></td>
+	<td bgcolor="#eeeeee">
+	    <form name="ListUsersForm" method="get" action="{$library_name}">
+	      <input type='hidden' name='a' value='g'/>
+	      <input type='hidden' name='sa' value='authen'/>
+	      <input type='hidden' name='s' value='Authentication'/>
+	      <input type='hidden' name='rt' value='r'/>
+	      <input type='hidden' name='s1.asn' value='1'/>
+	      <input type='hidden' name='s1.uan' value='1'/>
+
+	      <input type='hidden'><xsl:attribute name="name">s1.oumun</xsl:attribute><xsl:attribute name="value"><xsl:value-of select="@umun"/></xsl:attribute></input>
+	      <input type='hidden'><xsl:attribute name="name">s1.umun</xsl:attribute><xsl:attribute name="value"><xsl:value-of select="@umun"/></xsl:attribute></input>
+	      <input type='hidden' name='s1.cm' value=''/>
+
+	      <input type="submit"><xsl:attribute name="name">s1.aup</xsl:attribute><xsl:attribute name="value">EditUser</xsl:attribute></input>
+	      <input type="submit"><xsl:attribute name="name">s1.aup</xsl:attribute><xsl:attribute name="value">DeleteUser</xsl:attribute></input>
+	    </form>
+	</td>
+	</tr>
+       </xsl:for-each>
+    </table>
+  </xsl:template>
+
+ <!--template name="modifypassword"-->
+ <xsl:template name="modifypassword" >
+    <xsl:param name="sub_action"/>
+    <xsl:param name="authen_service"/>
+    <xsl:param name="pro_action"/>
+    <xsl:param name="un_s"/>
+    <xsl:param name="pw_s"/>
+    <xsl:param name="asn"/>
+    <div>
+      <form id="modifyForm" method="get" action="{$library_name}">
+	<input type='hidden' name='a' value='g'/>
+	<input type='hidden' name='sa' value='{$sub_action}'/>
+	<input type='hidden' name='s' value='{$authen_service}'/>
+	<input type='hidden' name='rt' value='r'/>
+	<input type='hidden' name='s1.un' value='{$un_s}'/>
+	<input type='hidden' name='s1.pw' value='{$pw_s}'/>
+	<input type='hidden' name='s1.asn' value='{$asn}'/>
+	<input type='hidden' name='s1.uan' value='1'/>
+	<input type='hidden' name='s1.aup' value='{$pro_action}'/>
+	
+	<table align="center"><tr><td align="right">
+	<xsl:value-of select="util:getInterfaceText($interface_name, /page/@lang, 'authen.old_password')"/></td><td><input type="password" name="s1.umpw" size="10" value=""/></td></tr>
+	  <tr><td align="right">
+	<xsl:value-of select="util:getInterfaceText($interface_name, /page/@lang, 'authen.new_password')"/></td><td><input type="password" name="s1.umpw1" size="10" value=""/></td></tr>
+	  <tr><td align="right">
+	<xsl:value-of select="util:getInterfaceText($interface_name, /page/@lang, 'authen.retype_new_password')"/></td><td><input type="password" name="s1.umpw2" size="10" value=""/></td></tr>
+	  <tr><td></td><td>
+	<input type="submit" value="submit"></input></td>
+	    </tr>
+	  </table>
+	</form>
+      </div>
+  </xsl:template>
+
+<!--template name="deleteuser"-->
+  <xsl:template name="deleteuser">
+    <xsl:param name="sub_action"/>
+    <xsl:param name="authen_service"/>
+    <xsl:param name="pro_action"/>
+    <xsl:param name="un_s"/>
+    <xsl:param name="umun_s"/>
+    <xsl:param name="asn"/>
+    <div >
+      <form id="deleteForm" method="get" action="{$library_name}">
+	<input type='hidden' name='a' value='g'/>
+	<input type='hidden' name='sa' value='{$sub_action}'/>
+	<input type='hidden' name='s' value='{$authen_service}'/>
+	<input type='hidden' name='rt' value='r'/>
+	<input type='hidden' name='s1.aup' value='{$pro_action}'/>
+	<input type='hidden' name='s1.asn' value='{$asn}'/>
+	<input type='hidden' name='s1.uan' value='1'/>
+	<input type='hidden' name='s1.umun' value='{$umun_s}'/>
+	<p><font color='red'><xsl:value-of select="util:getInterfaceText($interface_name, /page/@lang, 'authen.do_you_really_want_to_permanently_remove_user')"/> <xsl:value-of select="$umun_s"/>" ?</font></p>
+	<input type="submit" value="yes"><xsl:attribute name="name">s1.cm</xsl:attribute></input>
+	<input type="submit" value="no"><xsl:attribute name="name">s1.cm</xsl:attribute></input>
+      </form>
+    </div>
+  </xsl:template>
+  
+<!--template name="edituser"-->
+  <xsl:template name="edituser" >
+    <xsl:param name="sub_action"/>
+    <xsl:param name="authen_service"/>
+    <xsl:param name="pro_action"/>
+    <xsl:param name="un_s"/>
+    <xsl:param name="pw_s"/>
+    <xsl:param name="umun_s"/>
+    <xsl:param name="umpw_s"/>
+    <xsl:param name="umas_s"/>
+    <xsl:param name="umgp_s"/>
+    <xsl:param name="umc_s"/>
+    <xsl:param name="oumun_s"/>	
+    <xsl:param name="asn"/>
+    <div>
+      <form id="editForm" method="get" action="{$library_name}">
+	<input type='hidden' name='a' value='g'/>
+	<input type='hidden' name='sa' value='{$sub_action}'/>
+	<input type='hidden' name='s' value='{$authen_service}'/>
+	<input type='hidden' name='rt' value='r'/>
+	<input type='hidden' name='s1.asn' value='{$asn}'/>
+	<input type='hidden' name='s1.uan' value='1'/>
+	<input type='hidden' name='s1.aup' value='{$pro_action}'/>
+	<input type='hidden' name='s1.un' value='{$un_s}'/>
+	<input type='hidden' name='s1.pw' value='{$pw_s}'/>
+	
+	<table align="left" ><tr><td>
+	      <xsl:value-of select="util:getInterfaceText($interface_name, /page/@lang, 'authen.username')"/></td><td><input type="text" name="s1.umun" size="15" value="{$umun_s}"/></td><td><font color="gray"><xsl:value-of select="util:getInterfaceText($interface_name, /page/@lang, 'authen.username_describe')"/></font></td></tr>
+	  <tr><td>
+	      <xsl:value-of select="util:getInterfaceText($interface_name, /page/@lang, 'authen.password')"/></td><td><input type="password" name="s1.umpw" size="15" value="{$umpw_s}"/></td><td><font color="gray"><xsl:value-of select="util:getInterfaceText($interface_name, /page/@lang, 'authen.password_describe')"/></font></td></tr>
+	  <tr><td>
+	      <xsl:value-of select="util:getInterfaceText($interface_name, /page/@lang, 'authen.account_status')"/></td><td>	
+	      <select name="s1.umas">
+		<xsl:if test="$umas_s=''">
+		  <option value="true" selected="selected"><xsl:value-of select="util:getInterfaceText($interface_name, /page/@lang, 'authen.enabled')"/></option>
+		  <option value="false"><xsl:value-of select="util:getInterfaceText($interface_name, /page/@lang, 'authen.disabled')"/></option>
+		</xsl:if> 
+		<xsl:if test="$umas_s='true'">
+		  <option value="true" selected="selected"><xsl:value-of select="util:getInterfaceText($interface_name, /page/@lang, 'authen.enabled')"/></option>
+		  <option value="false"><xsl:value-of select="util:getInterfaceText($interface_name, /page/@lang, 'authen.disabled')"/></option>
+		</xsl:if> 
+		<xsl:if test="$umas_s='false'">
+		  <option value="true"><xsl:value-of select="util:getInterfaceText($interface_name, /page/@lang, 'authen.enabled')"/></option>
+		  <option value="false" selected="selected"><xsl:value-of select="util:getInterfaceText($interface_name, /page/@lang, 'authen.disabled')"/></option>
+		</xsl:if> 
+	      </select></td><td></td></tr>
+	  <tr><td>
+	      <xsl:value-of select="util:getInterfaceText($interface_name, /page/@lang, 'authen.groups')"/></td><td><input type="text" id="group" name="s1.umgp" size="70" value="{$umgp_s}"/></td><td><font color="gray"><xsl:value-of select="util:getInterfaceText($interface_name, /page/@lang, 'authen.groups_describe')"/></font></td></tr>
+	  <tr>
+	    <td></td>
+	    <td  align="right"> <select id="groups" size="0">
+		<script type="text/javascript">
+		    <xsl:text disable-output-escaping="yes">
+		    var group_arr=Array("administrator","all-collections-editor","personal-collections-editor");
+		    var group_string=document.getElementById("group").value;
+		    var split_group_string=group_string.split(",");
+		    var find=0;
+		    for (i=0; i &lt; group_arr.length; i++){
+		         find=0;
+		         for (j=0; j &lt; group_arr.length; j++){
+		            if (split_group_string[j]==group_arr[i]){
+		               find=1;
+                      	    }
+		         }
+	                 if (find==0){
+		             op = document.createElement('option');
+		             op.innerHTML = group_arr[i];
+		             op.setAttribute("value", group_arr[i]);
+		             document.getElementById("groups").appendChild(op);
+                         }
+	            }
+		   
+		  </xsl:text>		 
+		</script>
+	      </select></td><td><input type="button" name="addGroupButton" value="add" onClick="addGroup('groups')"/></td>
+	  </tr>
+	  <tr>
+	    <td></td>
+	    <td  align="right"> 
+	      <select  id="collects" size="0">
+		<xsl:for-each select="/page/pageResponse/collectionList/collection">
+		  <script type="text/javascript">
+		    <xsl:text disable-output-escaping="yes">
+		      var group="</xsl:text><xsl:value-of select="@name"/>-collection-editor<xsl:text disable-output-escaping="yes">";
+		      var group_string=document.getElementById("group").value;
+		      var split_group_string=group_string.split(",");
+		      var find=0;
+		      for (i=0; i &lt; split_group_string.length; i++){
+		          if (split_group_string[i]==group){
+		              find=1;
+		          }
+		      }
+		      if (find==0){
+		          op = document.createElement('option');
+		          op.innerHTML = group;
+		          op.setAttribute("value", group);
+		          document.getElementById("collects").appendChild(op);
+		      }
+		    </xsl:text>		 
+		  </script>
+		 </xsl:for-each>
+	      </select>
+	    </td>
+	    <td><input type="button" name="addGroupButton" value="add" onClick="addGroup('collects')"/></td>
+	  </tr>
+	  <tr><td>
+	      <xsl:value-of select="util:getInterfaceText($interface_name, /page/@lang, 'authen.comment')"/></td><td colspan="2"><div><textarea cols="40" rows="5" name="s1.umc"><xsl:value-of select="$umc_s"/>
+
+</textarea></div></td></tr> 
+	  <tr>
+
+<td></td><td>
+	      <input type="submit" value="submit"><xsl:attribute name="name">s1.cm</xsl:attribute></input>
+	       <xsl:if test="$pro_action!='AddUser'">
+	      <input type="submit" value="cancel"><xsl:attribute name="name">s1.cm</xsl:attribute></input>
+		</xsl:if>
+	    </td><td></td></tr>
+	</table>
+	<input type='hidden' name='s1.oumun' value='{$oumun_s}'/>
+      </form>
+    </div>
+  </xsl:template>
+
+<!-- addGroup() javascript -->
+  <xsl:template name="addGroup">
+    <script type="text/javascript">
+      <xsl:text disable-output-escaping="yes">
+	function addGroup(g){
+	    var itemSelected;
+	    var splitGroup;
+	    var groupExit;
+
+	if (document.getElementById("editForm")!=null){
+	    //itemSelected=document.getElementById("editForm").groups.options.selectedIndex;
+	    itemSelected=document.getElementById(g).options.selectedIndex;
+	    if (document.getElementById(g).options[itemSelected].text!=""){
+	       if (document.getElementById("group").value==""){
+	           document.getElementById("group").value=document.getElementById("group").value+document.getElementById(g).options[itemSelected].text;
+	       }else{
+	           splitGroup=document.getElementById("group").value.split(",");
+	           for (var i=0; i &lt; splitGroup.length; i++){
+	              if (splitGroup[i]==document.getElementById(g).options[itemSelected].text){
+	                  alert(document.getElementById(g).options[itemSelected].text + " has been added.");
+	                  groupExit=1;
+	                  break;
+	              }
+	           }
+	           if (groupExit!=1) {
+	              document.getElementById("group").value=document.getElementById("group").value+","+document.getElementById(g).options[itemSelected].text;
+	           }
+	       }
+	       document.getElementById(g).options[itemSelected]=new Option("",itemSelected);
+	   }
+	}
+	}
+      </xsl:text>
+    </script>    
+  </xsl:template>
+  
+</xsl:stylesheet>  
+
Index: /greenstone3/trunk/web/interfaces/gs2/transform/classifier.xsl
===================================================================
--- /greenstone3/trunk/web/interfaces/gs2/transform/classifier.xsl	(revision 16861)
+++ /greenstone3/trunk/web/interfaces/gs2/transform/classifier.xsl	(revision 16861)
@@ -0,0 +1,57 @@
+<?xml version="1.0" encoding="ISO-8859-1"?>
+<xsl:stylesheet version="1.0"
+  xmlns:xsl="http://www.w3.org/1999/XSL/Transform"
+  xmlns:java="http://xml.apache.org/xslt/java"
+  xmlns:util="xalan://org.greenstone.gsdl3.util.XSLTUtil"
+  extension-element-prefixes="java util"
+  exclude-result-prefixes="java util">
+  
+  <xsl:include href="style.xsl"/>
+  <xsl:include href="classifiertools.xsl"/>
+  
+  <xsl:output method="html"/>  
+
+  <xsl:template name="pageTitle">
+    <xsl:value-of select="util:getInterfaceText($interface_name, /page/@lang, 'nzdl')"/>
+  </xsl:template>
+
+  <!-- page specific style goes here -->
+  <xsl:template name="pageStyle"/>
+
+  <xsl:template match="pageResponse">
+    <xsl:variable name="collName"><xsl:value-of select="/page/pageRequest/paramList/param[@name='c']/@value"/></xsl:variable>
+    <xsl:variable name="serviceName"><xsl:value-of select="service/@name"/></xsl:variable>
+    <xsl:variable name="cl" select="/page/pageRequest/paramList/param[@name='cl']/@value"/>
+    <xsl:variable name="clTop">
+      <xsl:choose>
+	<xsl:when test="contains($cl, '.')"><xsl:value-of select="substring-before($cl, '.')"/></xsl:when>
+	<xsl:otherwise>
+	  <xsl:value-of select="$cl"/>
+	</xsl:otherwise>
+      </xsl:choose>
+    </xsl:variable>
+      <xsl:call-template name="standardPageBanner">
+	<xsl:with-param name="collName" select="$collName"/>
+	<xsl:with-param name="pageType">browse</xsl:with-param>
+	<xsl:with-param name="clTop" select="$clTop"/>
+      </xsl:call-template>
+      <xsl:call-template name="navigationBar">
+	<xsl:with-param name="collName" select="$collName"/>
+	<xsl:with-param name="clTop" select="$clTop"/>
+      </xsl:call-template>      
+      <div class="document">
+      <xsl:apply-templates select="classifier">
+	<xsl:with-param name="collName" select="$collName"/>
+	<xsl:with-param name="serviceName" select="$serviceName"/>
+      </xsl:apply-templates>
+      </div>
+  </xsl:template>
+  
+
+</xsl:stylesheet>
+
+
+
+
+
+
Index: /greenstone3/trunk/web/interfaces/gs2/transform/document.xsl
===================================================================
--- /greenstone3/trunk/web/interfaces/gs2/transform/document.xsl	(revision 16861)
+++ /greenstone3/trunk/web/interfaces/gs2/transform/document.xsl	(revision 16861)
@@ -0,0 +1,537 @@
+<?xml version="1.0" encoding="ISO-8859-1"?>
+<xsl:stylesheet version="1.0"
+  xmlns:xsl="http://www.w3.org/1999/XSL/Transform"
+  xmlns:java="http://xml.apache.org/xslt/java"
+  xmlns:util="xalan://org.greenstone.gsdl3.util.XSLTUtil"
+  xmlns:gsf="http://www.greenstone.org/greenstone3/schema/ConfigFormat"
+  extension-element-prefixes="java util"
+  exclude-result-prefixes="java util gsf">
+
+  <xsl:include href="style.xsl"/>
+  <xsl:include href="service-params.xsl"/>
+  <xsl:output method="html"/>
+
+  <!-- the main page layout template is here -->
+  <!-- override the one in style so we can display the doc over the whole page and get rid of the green bar down the side --> 
+  <xsl:template match="page" priority='2'>
+    <html>
+      <xsl:call-template name="pageHead"/>
+      <body>
+        <xsl:attribute name="dir"><xsl:call-template name="direction"/></xsl:attribute>
+        <div id="page">
+           <xsl:apply-templates select="pageResponse"/>
+	   <xsl:call-template name="greenstoneFooter"/>
+	</div>  
+       </body>
+    </html>
+  </xsl:template>
+  
+  <xsl:template name="pageTitle">
+    <xsl:variable name="docID" select="/page/pageResponse/document/@selectedNode"/>
+    <xsl:for-each select='/page/pageResponse/document/descendant::documentNode[@nodeID=$docID]/ancestor-or-self::documentNode'><xsl:if test='position()!=1'>::</xsl:if><xsl:value-of select="metadataList/metadata[@name='Title']"/></xsl:for-each>
+  </xsl:template>
+
+  <!-- this is hard coded for GATE, should somehow do it dynamically-->
+  <xsl:template name="pageStyle">
+    <style type="text/css">
+      <xsl:text disable-output-escaping="yes">
+	span.Location {  display:inline; color : red }
+	span.Person {  display:inline; color : green }
+	span.Organization {  display:inline; color : yellow }
+	span.Date {  display:inline; color : blue }
+	span.query_term {display: inline; background-color : yellow }
+      </xsl:text>
+    </style>
+  </xsl:template>
+  
+  <xsl:template match="pageResponse">
+    <xsl:variable name="collName"><xsl:value-of select="/page/pageRequest/paramList/param[@name='c']/@value"/></xsl:variable>
+    <xsl:call-template name="standardPageBanner">
+      <xsl:with-param name="collName" select="$collName"/>
+    </xsl:call-template>
+    <xsl:call-template name="navigationBar">
+      <xsl:with-param name="collName" select="$collName"/>
+    </xsl:call-template>
+    <div class="document">     
+    <!-- display the document -->
+    <xsl:apply-templates select="document">
+      <xsl:with-param name="collName" select="$collName"/>
+    </xsl:apply-templates>
+   </div>
+  </xsl:template>
+	
+  <xsl:template match="document">
+    <xsl:param name="collName"/>
+
+    <xsl:variable name="external"><xsl:value-of select="/page/pageResponse/document/@external"/></xsl:variable>
+	<xsl:choose><xsl:when test="$external != ''">
+	    <xsl:call-template name="externalPage">
+	      <xsl:with-param name="external" select="$external"/>
+	    </xsl:call-template>
+	  </xsl:when>
+	  <xsl:otherwise>
+	    
+	<xsl:call-template name="documentHeading">
+      <xsl:with-param name="collName" select="$collName"/>
+    </xsl:call-template>
+    
+    <xsl:call-template name="documentArrows">
+      <xsl:with-param name="collName" select="$collName"/>
+    </xsl:call-template>         
+    <xsl:call-template name="documentContent">
+      <xsl:with-param name="collName" select="$collName"/>
+    </xsl:call-template>
+    <xsl:call-template name="documentArrows">
+      <xsl:with-param name="collName" select="$collName"/>
+    </xsl:call-template> 
+    <br/>
+      </xsl:otherwise></xsl:choose>
+  </xsl:template>
+  
+  <xsl:template name="documentArrows">
+    <xsl:param name="collName"/>    
+    <xsl:variable name="ed" select="/page/pageRequest/paramList/param[@name='ed']/@value"/>    
+    <xsl:variable name="dir"><xsl:call-template name="direction"/></xsl:variable>    
+    <xsl:variable name="firstDir"><xsl:choose><xsl:when test="$dir='rtl'">forward</xsl:when><xsl:otherwise>back</xsl:otherwise></xsl:choose></xsl:variable>
+    <xsl:variable name="secondDir"><xsl:choose><xsl:when test="$dir='rtl'">back</xsl:when><xsl:otherwise>forward</xsl:otherwise></xsl:choose></xsl:variable>    
+    
+    <div class="documentarrows">
+    <xsl:if test="not(string($ed)='1')">
+       <xsl:call-template name="documentArrow">
+        <xsl:with-param name="collName" select="$collName"/>
+        <xsl:with-param name="direction" select="$firstDir"/>
+        <xsl:with-param name="pageDir" select="$dir"/>
+     </xsl:call-template>
+    <xsl:call-template name="documentArrow">
+      <xsl:with-param name="collName" select="$collName"/>
+      <xsl:with-param name="direction" select="$secondDir"/>
+      <xsl:with-param name="pageDir" select="$dir"/>
+    </xsl:call-template>
+    </xsl:if>
+    </div>    
+  </xsl:template>
+  
+  <xsl:template name="documentArrow">
+    <xsl:param name="collName"/>
+    <xsl:param name="direction"/>
+    <xsl:param name="pageDir"/>
+        
+    <xsl:variable name="disp">
+    	<xsl:choose>
+		    <xsl:when test="$direction ='back' and nodeStructureInfo/info[@name='siblingPosition']/@value = -1">n</xsl:when>
+		    <xsl:when test="$direction ='forward' and nodeStructureInfo/info[@name='siblingPosition']/@value = nodeStructureInfo/info[@name='numSiblings']/@value">n</xsl:when>		    
+		    <xsl:otherwise>y</xsl:otherwise>
+		</xsl:choose>
+    </xsl:variable>
+
+    <xsl:variable name="request-params" select="/page/pageRequest/paramList"/>
+    <xsl:if test='$request-params/param[@name="dt"]/@value != "simple" and $disp = "y"'>  
+    <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="@selectedNode"/><xsl:choose><xsl:when test="$direction='back'">.pp</xsl:when><xsl:otherwise>.np</xsl:otherwise></xsl:choose>&amp;sib=1&amp;p.s=<xsl:value-of select='$request-params/param[@name="p.s"]/@value'/>&amp;p.sa=<xsl:value-of select='$request-params/param[@name="p.sa"]/@value'/>&amp;p.a=<xsl:value-of select='$request-params/param[@name="p.a"]/@value'/></xsl:attribute><xsl:choose>
+    <xsl:when test="$direction='back'"><img class="lessarrow{$pageDir}" src="interfaces/default/images/less.gif" /></xsl:when><xsl:otherwise><img class="morearrow{$pageDir}" src="interfaces/default/images/more.gif"  /></xsl:otherwise></xsl:choose></a>
+    </xsl:if>
+  </xsl:template>
+         
+
+  <xsl:template name="documentHeading">
+    <xsl:param name="collName"/>
+    <xsl:variable name="doCoverImage" select="/page/pageResponse/format/gsf:option[@name='coverImages']/@value"/>
+    <xsl:variable name="doTOC" select="/page/pageResponse/format/gsf:option[@name='documentTOC']/@value"/>
+    <xsl:variable name="p.a" select="/page/pageRequest/paramList/param[@name='p.a']/@value"/>
+    <xsl:variable name="p.sa" select="/page/pageRequest/paramList/param[@name='p.sa']/@value"/>
+    <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 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>-->
+ 
+    <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>
+
+  <xsl:template name="coverImage">
+    <img alt="" onError="src='interfaces/classic/images/blank.gif'"><xsl:attribute name='src'><xsl:value-of select="/page/pageResponse/collection/metadataList/metadata[@name='httpPath']"/>/index/assoc/<xsl:value-of select="metadataList/metadata[@name='archivedir']"/>/cover.jpg</xsl:attribute></img>
+  </xsl:template>
+
+  <xsl:template name="documentButtons">
+    <xsl:param name="collName"/>
+    <xsl:variable name="docID" select="/page/pageRequest/paramList/param[@name='d']/@value"/>
+    <xsl:variable name="sib" select="/page/pageRequest/paramList/param[@name='sib']/@value"/>
+    <xsl:variable name="ec" select="/page/pageRequest/paramList/param[@name='ec']/@value"/>
+    <xsl:variable name="ed" select="/page/pageRequest/paramList/param[@name='ed']/@value"/>
+    
+    <!-- added params, otherwise the bookicon link becomes broken after click one of these buttons -->
+    <xsl:variable name="p.s" select="/page/pageRequest/paramList/param[@name='p.s']/@value"/>
+    <xsl:variable name="p.sa" select="/page/pageRequest/paramList/param[@name='p.sa']/@value"/>
+    <xsl:variable name="p.a" select="/page/pageRequest/paramList/param[@name='p.a']/@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>
+      
+      <!-- expand document -->
+      <!-- this doesn't work with MG so comment it out for now -->      
+      <!--<xsl:if test="@docType = 'hierarchy' or @docType = 'paged'">-->
+      <!-- shouldn't appear for paged document -->
+      <xsl:if test="@docType = 'hierarchy'">
+      <div class="button">
+        <span class="button">
+	  <xsl:choose><xsl:when test="string($ed)='1'">
+	      <a href="{$library_name}?a=d&amp;d={$docID}&amp;c={$collName}&amp;sib={$sib}&amp;ed=0&amp;p.s={$p.s}&amp;p.sa={$p.sa}&amp;p.a={$p.a}&amp;p.c={$p.c}"><xsl:attribute name="title"><xsl:value-of select="util:getInterfaceText($interface_name, /page/@lang, 'doc.contract_doc_tip')"/></xsl:attribute>
+		  <xsl:value-of disable-output-escaping='yes' select="util:getInterfaceText($interface_name, /page/@lang, 'doc.contract_doc_b')"/>
+	      </a>
+	    </xsl:when>
+	    <xsl:otherwise>
+	        <a href="{$library_name}?a=d&amp;d={$docID}&amp;c={$collName}&amp;sib={$sib}&amp;ed=1&amp;p.s={$p.s}&amp;p.sa={$p.sa}&amp;p.a={$p.a}&amp;p.c={$p.c}"><xsl:attribute name="title"><xsl:value-of select="util:getInterfaceText($interface_name, /page/@lang, 'doc.expand_doc_tip')"/></xsl:attribute>
+	   <xsl:value-of disable-output-escaping='yes' select="util:getInterfaceText($interface_name, /page/@lang, 'doc.expand_doc_b')"/>
+	      </a>
+	    </xsl:otherwise>
+	  </xsl:choose>
+         </span>
+	</div>
+      </xsl:if> 
+      
+      <!-- expand contents -->
+      <xsl:if test="@docType = 'hierarchy' and string(/page/pageResponse/format/gsf:option[@name='documentTOC']/@value) != 'false'">
+      <div class="button">
+        <span class="button">
+	  <xsl:choose><xsl:when test="string($ec)='1'">
+	      <a  href="{$library_name}?a=d&amp;d={$docID}&amp;c={$collName}&amp;sib={$sib}&amp;ec=0&amp;p.s={$p.s}&amp;p.sa={$p.sa}&amp;p.a={$p.a}&amp;p.c={$p.c}"><xsl:attribute name="title"><xsl:value-of select="util:getInterfaceText($interface_name, /page/@lang, 'doc.contract_contents_tip')"/></xsl:attribute>
+		 <xsl:value-of disable-output-escaping='yes' select="util:getInterfaceText($interface_name, /page/@lang, 'doc.contract_contents_b')"/>
+	      </a>
+	    </xsl:when>
+	    <xsl:otherwise>
+	      <a  href="{$library_name}?a=d&amp;d={$docID}&amp;c={$collName}&amp;sib={$sib}&amp;ec=1&amp;p.s={$p.s}&amp;p.sa={$p.sa}&amp;p.a={$p.a}&amp;p.c={$p.c}"><xsl:attribute name="title"><xsl:value-of select="util:getInterfaceText($interface_name, /page/@lang, 'doc.expand_contents_tip')"/></xsl:attribute>
+		<xsl:value-of disable-output-escaping='yes' select="util:getInterfaceText($interface_name, /page/@lang, 'doc.expand_contents_b')"/>
+	      </a>
+	    </xsl:otherwise>
+	  </xsl:choose>
+	 </span>
+	</div>
+      </xsl:if>
+      <!-- detach page -->
+      <xsl:variable name="paramList" select="/page/pageRequest/paramList"/>
+      <div class="button">
+        <span class="button">
+	  <a  target="_blank"><xsl:attribute name="href"><xsl:value-of select="$library_name"/>?a=d&amp;d=<xsl:value-of select="$docID"/>&amp;c=<xsl:value-of select="$collName"/>&amp;sib=<xsl:value-of select="$sib"/>&amp;dt=<xsl:value-of select="$paramList/param[@name='dt']/@value"/>&amp;ec=<xsl:value-of select="$paramList/param[@name='ec']/@value"/>&amp;et=<xsl:value-of select="$paramList/param[@name='et']/@value"/>&amp;p.a=<xsl:value-of select="$paramList/param[@name='p.a']/@value"/>&amp;p.s=<xsl:value-of select="$paramList/param[@name='p.s']/@value"/>&amp;p.sa=<xsl:value-of select="$paramList/param[@name='p.sa']/@value"/></xsl:attribute><xsl:attribute name="title"><xsl:value-of select="util:getInterfaceText($interface_name, /page/@lang, 'doc.detach_page_tip')"/></xsl:attribute>
+	    <xsl:value-of disable-output-escaping='yes' select="util:getInterfaceText($interface_name, /page/@lang, 'doc.detach_page_b')"/>
+	  </a>
+         </span>
+      </div>
+   </xsl:template>
+
+  <xsl:template name="TOC">
+    <xsl:param name="collName"/>
+    <xsl:choose>
+      <xsl:when test="@docType='hierarchy'">
+	<xsl:call-template name="hierarchicalContents">
+	  <xsl:with-param name="collName" select="$collName"/>
+	</xsl:call-template>
+      </xsl:when>
+      <xsl:when test="@docType='paged'">
+	<xsl:call-template name="pagedContents">
+	  <xsl:with-param name="collName" select="$collName"/>
+	</xsl:call-template>
+      </xsl:when>
+    </xsl:choose>
+  </xsl:template>
+    
+  <xsl:template name="hierarchicalContents">
+    <xsl:param name="collName"/>
+    <xsl:variable name="oc" select="/page/pageRequest/paramList/param[@name='oc']/@value"/>
+    <xsl:variable name="d" select="/page/pageRequest/paramList/param[@name='d']/@value"/>
+    <xsl:variable name="sib" select="/page/pageRequest/paramList/param[@name='sib']/@value"/>
+    <xsl:variable name="ec" select="/page/pageRequest/paramList/param[@name='ec']/@value"/>
+    
+    <!-- added parameters -->
+    <xsl:variable name="p.s" select="/page/pageRequest/paramList/param[@name='p.s']/@value"/>
+    <xsl:variable name="p.sa" select="/page/pageRequest/paramList/param[@name='p.sa']/@value"/>
+    <xsl:variable name="p.a" select="/page/pageRequest/paramList/param[@name='p.a']/@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>
+    
+    <xsl:if test="documentNode[@nodeID]">
+	<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>
+	  Table of Contents
+	<xsl:if test="string($oc)!='0'">
+	  <ul class="tocnode">
+		<xsl:for-each select="documentNode/documentNode[@nodeID]">
+		  <xsl:apply-templates select='.'>
+		  <xsl:with-param name="collName" select="$collName"/><xsl:with-param name="ec" select="$ec"/>
+		  
+		  <!-- added parameters -->
+		  <xsl:with-param name="p.a" select="$p.a"/>
+		  <xsl:with-param name="p.s" select="$p.s"/>
+		  <xsl:with-param name="p.sa" select="$p.sa"/>
+		  <xsl:with-param name="p.c" select="$p.c"/>
+		  
+		</xsl:apply-templates>
+		</xsl:for-each>
+	     </ul>
+	  </xsl:if>
+ </li> 
+      </ul>
+    </xsl:if>
+  </xsl:template>
+  
+  <!-- each icon-title pair is a row in a table. children go in a table in another row -->
+  <xsl:template match="documentNode">
+    <xsl:param name="collName"/>
+    <xsl:param name="ec"/>
+    
+    <!-- added these parameters to be carried when changing in toc -->
+    <xsl:param name="p.a"/>
+    <xsl:param name="p.s"/>
+    <xsl:param name="p.sa"/>
+    <xsl:param name="p.c"/>
+    <!-- Display the appropriate image, depending on the node type -->
+    	
+     <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>
+	-->	
+	
+	<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>&amp;sib=1<xsl:if test="string($ec) = '1'">&amp;ec=1</xsl:if>&amp;p.a=<xsl:value-of select="$p.a"/>&amp;p.sa=<xsl:value-of select="$p.sa"/>&amp;p.s=<xsl:value-of select="$p.s"/>&amp;p.c=<xsl:value-of select="$p.c"/></xsl:attribute>
+	
+	  <xsl:apply-templates select="." mode="displayNodeIcon"/>
+	</a>
+      
+      <!-- Display associated title, bolded if the node has content -->
+	<xsl:choose>
+	  <xsl:when test="nodeContent">
+	     <span class="bold"><xsl:value-of disable-output-escaping="yes" select="metadataList/metadata[@name='Title']"/></span>
+	  </xsl:when>
+	  <xsl:otherwise>
+	    <xsl:value-of disable-output-escaping="yes" select="metadataList/metadata[@name='Title']"/>
+	  </xsl:otherwise>
+	</xsl:choose>
+
+    <!-- Apply recursively to the children of this node -->
+    <xsl:if test="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"/>
+	      
+	      <!-- added parameters -->
+	      <xsl:with-param name="p.a" select="$p.a"/><xsl:with-param name="p.s" select="$p.s"/><xsl:with-param name="p.sa" select="$p.sa"/><xsl:with-param name="p.c" select="$p.c"/>
+	      <!--<xsl:with-param name="depth" select="$depth + 1"/>-->
+	    </xsl:apply-templates>
+	   </ul>
+      </xsl:if>
+    </li>
+  </xsl:template>
+  
+  <!-- default content is to print the title and content of any documentNodes that have nodeContent -->
+  <xsl:template name="documentContent">
+    <div class="documenttext">
+      <xsl:choose>
+        <xsl:when test="@docType='simple'">
+	  <xsl:apply-templates select="nodeContent"/>
+	</xsl:when>
+        <xsl:otherwise>
+	  <xsl:apply-templates select="descendant-or-self::node()/documentNode" mode="content"/>
+        </xsl:otherwise>
+      </xsl:choose>
+    </div>
+  </xsl:template>
+  
+  <xsl:template match="documentNode" mode="content">
+    <xsl:if test="nodeContent and string(nodeContent)">
+      <xsl:if test="metadataList/metadata[@name='Title']">
+	<h3><xsl:value-of disable-output-escaping="yes" select="metadataList/metadata[@name='Title']"/></h3>
+      </xsl:if>
+      <xsl:apply-templates select="nodeContent"/>
+      </xsl:if>
+    
+  </xsl:template>
+
+  <!-- the actual text/content -->
+  <xsl:template match="nodeContent">
+    <p/>
+    <xsl:for-each select="node()">
+      <xsl:choose>
+	<xsl:when test="not(name())"><xsl:value-of select="." disable-output-escaping="yes"/></xsl:when>
+	<xsl:otherwise><xsl:apply-templates select="."/></xsl:otherwise>
+      </xsl:choose>
+    </xsl:for-each>
+  </xsl:template>
+  
+  <!-- match any file nodes -->
+  <xsl:template match="file">
+    <xsl:variable name="httpPath" select="/page/pageResponse/collection/metadataList/metadata[@name='httpPath']"/>
+    <xsl:choose>
+      <xsl:when test="util:isImage(@mimeType)">
+	<img src="{$httpPath}/{@href}"/>
+      </xsl:when>
+      <xsl:otherwise>
+	<a href="{$httpPath}/{@href}"><xsl:value-of select="@href"/></a>
+      </xsl:otherwise>
+    </xsl:choose>
+  </xsl:template>
+  
+  <!-- match any link nodes -->
+  <xsl:template match="link">
+    <xsl:variable name="collName" select="/page/pageRequest/paramList/param[@name='c']/@value"/> 
+    <xsl:variable name="actionargs">
+      <xsl:choose>
+	<xsl:when test="@type='document'">a=d</xsl:when>
+	<xsl:when test="@type='query'">a=q&amp;s=<xsl:value-of select="@service"/>&amp;rt=r</xsl:when>
+	<xsl:otherwise>
+	  p
+	</xsl:otherwise>
+      </xsl:choose>
+    </xsl:variable>
+    <xsl:variable name="serviceargs">
+      <xsl:for-each select="param">&amp;s1.<xsl:value-of select="@name"/>=<xsl:value-of select="@value"/></xsl:for-each>
+  </xsl:variable>
+    <a href="{$library_name}?{$actionargs}&amp;c={$collName}{$serviceargs}"><xsl:value-of disable-output-escaping="yes" select="."/></a>
+  </xsl:template>
+
+  <!-- match any annotations and make them span elements -->
+  <xsl:template match="annotation">
+    <span class="{@type}"><xsl:value-of disable-output-escaping="yes" select="."/></span>
+  </xsl:template>
+  
+  <!-- paged naviagtion : INCOMPLETE!!-->
+  <xsl:template name="pagedContents">
+    <xsl:param name="collName"/>
+    <xsl:variable name="pos" select="nodeStructureInfo/info[@name='siblingPosition']/@value"/>
+    <xsl:variable name="length" select="nodeStructureInfo/info[@name='numSiblings']/@value"/>
+    <xsl:variable name="children" select="nodeStructureInfo/info[@name='numChildren']/@value"/>
+    <!-- parameters for the bookicon to work properly -->
+    <xsl:variable name="p.s" select="/page/pageRequest/paramList/param[@name='p.s']/@value"/>
+   	<xsl:variable name="p.sa" select="/page/pageRequest/paramList/param[@name='p.sa']/@value"/>
+   	<xsl:variable name="p.a" select="/page/pageRequest/paramList/param[@name='p.a']/@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>
+
+    <xsl:choose>
+	<xsl:when test="$pos=-1"><!-- a doc -->
+	  <tr valign="top">
+	    <td align="left">
+	    </td>
+	    <td align="center"><center>
+		<b><xsl:value-of select="util:getInterfaceText($interface_name, /page/@lang, 'document.pages', $children)"/></b>
+	      </center></td>
+	    <td align="right">
+	      <a href="{$library_name}?a=d&amp;c={$collName}&amp;d={@selectedNode}.fc&amp;p.s={$p.s}&amp;p.sa={$p.sa}&amp;p.a={$p.a}&amp;p.c={$p.c}"><img src="interfaces/default/images/more.gif" border="0" align="absbottom" /></a>
+	    </td>
+	  </tr>
+	</xsl:when>
+	
+	<xsl:otherwise> <!-- an internal node -->	  
+	  <tr valign="top">
+	    <td align="left">
+	      <xsl:if test=" not ( $pos = 1 )">
+		<a href="{$library_name}?a=d&amp;c={$collName}&amp;d={@selectedNode}.ps&amp;p.s={$p.s}&amp;p.sa={$p.sa}&amp;p.a={$p.a}&amp;p.c={$p.c}"><img src="interfaces/default/images/less.gif" border="0" align="absbottom" /></a>
+	      </xsl:if>
+	    </td>
+	    <td align="center"><center>
+		<b><xsl:value-of select="util:getInterfaceText($interface_name, /page/@lang, 'document.pageof', concat($pos, ';', $length))"/></b>
+	      </center></td>
+	    <td align="right">
+	      <xsl:if test=" not($pos = $length)">
+		<a href="{$library_name}?a=d&amp;c={$collName}&amp;d={@selectedNode}.ns&amp;p.s={$p.s}&amp;p.sa={$p.sa}&amp;p.a={$p.a}&amp;p.c={$p.c}"><img src="interfaces/default/images/more.gif" border="0" align="absbottom" /></a>
+	      </xsl:if>
+	    </td>
+	  </tr>
+	</xsl:otherwise>
+      </xsl:choose>
+      <tr valign="middle">
+	<td align='center' valign='top' colspan='3'>
+	  <form name="GotoForm" method="get" action="{$library_name}">
+	    <input type='hidden' name='a' value='d'/>
+	    <input type='hidden' name='c' value='{$collName}'/>
+	    <!--<input type='hidden' name='d' value='{@selectedNode}'/>-->
+	    <input type='hidden' name='d'>
+	    	<xsl:attribute name='value'>
+	    		<xsl:if test="contains(@selectedNode, '.')"><xsl:value-of select="@selectedNode"/></xsl:if>
+	    		<xsl:if test="not(contains(@selectedNode, '.'))"><xsl:value-of select="@selectedNode"/>.0</xsl:if>
+	    	</xsl:attribute>
+	    </input>    	    	
+	    
+    	<input type='hidden' name='p.s' value='{$p.s}'/>
+    	<input type='hidden' name='p.sa' value='{$p.sa}'/>
+    	<input type='hidden' name='p.a' value='{$p.a}'/>
+    	<input type='hidden' name='p.c' value='{$p.c}'/>    
+    	
+	    <input type="text" name="gp" size="3" maxlength="4"/>
+	    <input type="submit"><xsl:attribute name='value'><xsl:value-of select="util:getInterfaceText($interface_name, /page/@lang, 'document.gotopage')"/></xsl:attribute></input>
+	  </form>
+	</td>
+      </tr>
+   </xsl:template>
+  
+  <xsl:template name="enrichServices">
+    <xsl:param name="collName"/>
+    <xsl:variable name="docID" select="/page/pageRequest/paramList/param[@name='d']/@value"/>
+    <xsl:variable name="request-params" select="/page/pageRequest/paramList"/>
+    <xsl:for-each select="../serviceList/service">
+      <table border='1' cellspacing='0'>
+	<tr><td>
+	    <p /><xsl:value-of select="displayItem[@name='name']"/><p/>
+	    <form name="EnrichForm" method="get" action="{$library_name}">
+	      <xsl:apply-templates select="paramList"/>
+	      <input type='hidden' name='a' value='d'/>
+	      <input type='hidden' name='d' value='{$docID}'/>
+	      <input type='hidden' name='c' value='{$collName}'/>
+	      <xsl:if test='$request-params/param[@name="sib"]'>
+		<input type='hidden' name='sib'><xsl:attribute name='value'><xsl:value-of select='$request-params/param[@name="sib"]/@value'/></xsl:attribute></input></xsl:if>
+	      <input type='hidden' name='s' value='{@name}'/>
+	      <input type='hidden' name='p.a'><xsl:attribute name='value'><xsl:value-of select='$request-params/param[@name="p.a"]'/></xsl:attribute></input>
+	      <input type='hidden' name='p.sa'><xsl:attribute name='value'><xsl:value-of select='$request-params/param[@name="p.sa"]'/></xsl:attribute></input>
+	      <input type='hidden' name='p.s'><xsl:attribute name='value'><xsl:value-of select='$request-params/param[@name="p.s"]'/></xsl:attribute></input>
+	      <input type='hidden' name='end' value='1'/>
+	      <input type="submit"><xsl:attribute name="value"><xsl:value-of select="displayItem[@name='submit']"/></xsl:attribute></input>
+	    </form>
+	  </td></tr>
+      </table>
+    </xsl:for-each>
+  </xsl:template>
+
+  <xsl:template match="paramList" mode="hidden">
+    <xsl:for-each select="param">
+      <input type='hidden' name='{@name}' value='{@value}'/><xsl:text>
+      </xsl:text>
+    </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>
+
+
+
+
Index: /greenstone3/trunk/web/interfaces/gs2/transform/gli4gs3.xsl
===================================================================
--- /greenstone3/trunk/web/interfaces/gs2/transform/gli4gs3.xsl	(revision 16861)
+++ /greenstone3/trunk/web/interfaces/gs2/transform/gli4gs3.xsl	(revision 16861)
@@ -0,0 +1,32 @@
+<?xml version="1.0" encoding="ISO-8859-1"?>
+<xsl:stylesheet version="1.0"
+  xmlns:xsl="http://www.w3.org/1999/XSL/Transform"
+  xmlns:java="http://xml.apache.org/xslt/java"
+  xmlns:util="xalan://org.greenstone.gsdl3.util.XSLTUtil"
+  extension-element-prefixes="java util"
+  exclude-result-prefixes="java util">
+  
+  <xsl:include href="style.xsl"/>
+  
+  <xsl:output method="html"/>  
+
+  <xsl:template name="pageTitle">
+    <xsl:value-of select="pageResponse/service/applet"/>
+  </xsl:template>
+
+  <!-- page specific style goes here -->
+  <xsl:template name="pageStyle"/>
+
+  <xsl:template match="pageResponse">
+    <xsl:variable name="collName"><xsl:value-of select="../pageRequest/paramList/param[@name='c']/@value"/></xsl:variable>
+    
+   <!-- <xsl:call-template name="navigationBar">
+      <xsl:with-param name="collName" select="$collName"/>
+    </xsl:call-template>-->      
+    <div >
+      <xsl:copy-of select="Applet"/>
+    </div>
+  </xsl:template>
+
+</xsl:stylesheet>  
+
Index: /greenstone3/trunk/web/interfaces/gs2/transform/help-common.xsl
===================================================================
--- /greenstone3/trunk/web/interfaces/gs2/transform/help-common.xsl	(revision 16861)
+++ /greenstone3/trunk/web/interfaces/gs2/transform/help-common.xsl	(revision 16861)
@@ -0,0 +1,45 @@
+<?xml version="1.0" encoding="ISO-8859-1"?>
+<xsl:stylesheet version="1.0"
+  xmlns:xsl="http://www.w3.org/1999/XSL/Transform"
+  xmlns:java="http://xml.apache.org/xslt/java"
+  xmlns:util="xalan://org.greenstone.gsdl3.util.XSLTUtil"
+  extension-element-prefixes="java util"
+  exclude-result-prefixes="java util">
+
+
+  <xsl:template match="collection" mode="simplehelp">
+    <xsl:variable name="longCollName"><xsl:value-of select="displayItem[@name='name']" disable-output-escaping='yes'/></xsl:variable>
+    <!--<xsl:variable name="numoptions">5</xsl:variable>-->
+    <xsl:variable name="has_search"><xsl:choose><xsl:when test="serviceList/service[@name='TextQuery']">1</xsl:when><xsl:otherwise>0</xsl:otherwise></xsl:choose></xsl:variable>
+    <xsl:variable name="has_phrase"><xsl:choose><xsl:when test="serviceList/service[@name='PhindApplet']">1</xsl:when><xsl:otherwise>0</xsl:otherwise></xsl:choose></xsl:variable>
+    <xsl:variable name="numoptions" select="count(serviceList/service[@name='ClassifierBrowse']/classifierList[position() mod 2 = 1]/classifier)"/>
+    <div class="simplehelp">
+    <h3><xsl:value-of select="util:getInterfaceText($interface_name, /page/@lang, 'help.simplehelpheading', $longCollName)"/></h3>
+    <xsl:value-of select="util:getInterfaceText($interface_name, /page/@lang, 'help.numbrowseoptions', $numoptions+$has_search+$has_phrase)"/>
+    <ul>
+      <xsl:if test="$has_search =1">
+	<li><xsl:value-of select="util:getInterfaceText($interface_name, /page/@lang, 'help.Searchshort')" disable-output-escaping='yes'/></li>
+      </xsl:if>
+      <xsl:for-each select="serviceList/service[@name='ClassifierBrowse']/classifierList/classifier">
+	<xsl:variable name="title">help.<xsl:value-of select="@content"/>short</xsl:variable>
+	<li><xsl:value-of select="util:getInterfaceText($interface_name, /page/@lang, $title)" disable-output-escaping='yes'/></li>
+      </xsl:for-each>
+      <xsl:if test="$has_phrase =1">
+	<li><xsl:value-of select="util:getInterfaceText($interface_name, /page/@lang, 'help.Phraseshort')" disable-output-escaping='yes'/></li>
+      </xsl:if>
+    </ul>
+    <xsl:if test="$has_search =1">
+      <xsl:value-of select="util:getInterfaceText($interface_name, /page/@lang, 'help.Searchlong')" disable-output-escaping='yes'/>
+    </xsl:if>
+    <xsl:for-each select="serviceList/service[@name='ClassifierBrowse']/classifierList[position() mod 2 = 1]/classifier">
+      <xsl:variable name="title">help.<xsl:value-of select="@content"/>long</xsl:variable>
+      <xsl:value-of select="util:getInterfaceText($interface_name, /page/@lang, $title)" disable-output-escaping='yes'/>
+    </xsl:for-each>
+    <xsl:if test="$has_phrase =1">
+      <xsl:value-of select="util:getInterfaceText($interface_name, /page/@lang, 'help.Phraselong')" disable-output-escaping='yes'/>
+    </xsl:if>
+    </div>
+  </xsl:template>
+  
+   
+</xsl:stylesheet>
Index: /greenstone3/trunk/web/interfaces/gs2/transform/help.xsl
===================================================================
--- /greenstone3/trunk/web/interfaces/gs2/transform/help.xsl	(revision 16861)
+++ /greenstone3/trunk/web/interfaces/gs2/transform/help.xsl	(revision 16861)
@@ -0,0 +1,38 @@
+<?xml version="1.0" encoding="ISO-8859-1"?>
+<xsl:stylesheet version="1.0"
+  xmlns:xsl="http://www.w3.org/1999/XSL/Transform"
+  xmlns:java="http://xml.apache.org/xslt/java"
+  xmlns:util="xalan://org.greenstone.gsdl3.util.XSLTUtil"
+  extension-element-prefixes="java util"
+  exclude-result-prefixes="java util">
+
+  <xsl:include href="style.xsl"/>
+  <!--<xsl:include href="help-text.xsl"/>-->
+  <xsl:include href="page-common.xsl"/>
+  
+  <xsl:output method="html"/>  
+  
+  <xsl:template name="pageTitle">
+    <xsl:value-of select="util:getInterfaceText($interface_name, /page/@lang, 'help_tip')"/>
+  </xsl:template>
+
+  <!-- page specific style goes here -->
+  <xsl:template name="pageStyle"/>
+
+
+  <xsl:template match="pageResponse">
+    <xsl:variable name="collName" select="/page/pageRequest/paramList/param[@name='c']/@value"/>
+    <center>
+      <xsl:call-template name="standardPageBanner">
+	<xsl:with-param name="collName" select="$collName"/>
+	<xsl:with-param name="pageType">help</xsl:with-param>
+      </xsl:call-template>
+      <xsl:call-template name="navigationBar">
+	<xsl:with-param name="collName" select="$collName"/>
+      </xsl:call-template>      
+      <p />Help text to go here!!
+    </center>
+  </xsl:template>
+
+
+</xsl:stylesheet>
Index: /greenstone3/trunk/web/interfaces/gs2/transform/home.xsl
===================================================================
--- /greenstone3/trunk/web/interfaces/gs2/transform/home.xsl	(revision 16861)
+++ /greenstone3/trunk/web/interfaces/gs2/transform/home.xsl	(revision 16861)
@@ -0,0 +1,67 @@
+<?xml version="1.0" encoding="ISO-8859-1"?>
+<xsl:stylesheet version="1.0"
+  xmlns:xsl="http://www.w3.org/1999/XSL/Transform"
+  xmlns:java="http://xml.apache.org/xslt/java"
+  xmlns:util="xalan://org.greenstone.gsdl3.util.XSLTUtil"
+  extension-element-prefixes="java util"
+  exclude-result-prefixes="java util">
+
+  <!-- style includes global params interface_name, library_name -->
+  <xsl:include href="style.xsl"/>
+
+  <xsl:output method="html"/>  
+
+  <xsl:template name="pageTitle">
+    <xsl:value-of select="util:getInterfaceText($interface_name, /page/@lang, 'gsdl')"/>
+  </xsl:template>
+  
+  <!-- page specific style goes here -->
+  <xsl:template name="pageStyle"/>
+
+  <xsl:template match="pageResponse">
+    <xsl:call-template name="greenstonePageBanner"/> 
+    <xsl:apply-templates select="collectionList"/>   
+    <xsl:apply-templates select="serviceList"/>
+  </xsl:template>
+
+  <xsl:template match="collectionList">
+    <xsl:for-each select="collection"> 
+      <xsl:variable name="ct"><xsl:choose><xsl:when test="metadataList/metadata[@name='buildType']='mgpp'">1</xsl:when><xsl:otherwise>0</xsl:otherwise></xsl:choose></xsl:variable>
+
+      <p>
+      <a href="{$library_name}?a=p&amp;sa=about&amp;c={@name}&amp;ct={$ct}">
+	  <img width="150" border="1">
+	    <xsl:attribute name="src">
+	      <xsl:value-of select="metadataList/metadata[@name='httpPath']"/>/images/<xsl:choose><xsl:when test="displayItem[@name='smallicon']"><xsl:value-of select="displayItem[@name='smallicon']"/></xsl:when><xsl:otherwise><xsl:value-of select="displayItem[@name='icon']"/></xsl:otherwise></xsl:choose>
+	    </xsl:attribute>
+	    <xsl:attribute name="alt">
+	      <xsl:value-of select="displayItem[@name='name']"/>
+	    </xsl:attribute>
+	  </img>
+	</a>
+      </p>
+    </xsl:for-each> 
+    <xsl:call-template name="collWarning"/>
+  </xsl:template> 
+  
+  <xsl:template name="collWarning">
+    <xsl:call-template name="dividerBar"/>	
+    <div>
+      <xsl:value-of select="util:getInterfaceText('classic', /page/@lang, 'home.coll_warning')"/>
+    </div>	
+   </xsl:template>
+
+<xsl:template match="serviceList">
+   <!--<xsl:call-template name="dividerBar"/>-->
+    <ul id="servicelist">
+      <!--uncomment to display an authentication link-->
+      <!--<xsl:for-each select="service[@type='authen']">
+      <li><a href="{$library_name}?a=g&amp;rt=r&amp;sa=authen&amp;s={@name}&amp;s1.aup=Login&amp;s1.un=&amp;s1.asn="><xsl:value-of select="displayItem[@name='name']"/></a><xsl:value-of select="displayItem[@name='description']"/></li> <br/>     </xsl:for-each>-->
+      <!--uncomment to display a library interface link-->
+     <!--<li><a href="{$library_name}?a=p&amp;sa=gli4gs3">The Librarian Interface</a></li>-->
+    </ul>
+    </xsl:template>
+
+</xsl:stylesheet>  
+
+
Index: /greenstone3/trunk/web/interfaces/gs2/transform/nav.xsl
===================================================================
--- /greenstone3/trunk/web/interfaces/gs2/transform/nav.xsl	(revision 16861)
+++ /greenstone3/trunk/web/interfaces/gs2/transform/nav.xsl	(revision 16861)
@@ -0,0 +1,51 @@
+<?xml version="1.0" encoding="ISO-8859-1"?>
+<xsl:stylesheet version="1.0"
+  xmlns:xsl="http://www.w3.org/1999/XSL/Transform"
+  xmlns:java="http://xml.apache.org/xslt/java"
+  xmlns:util="xalan://org.greenstone.gsdl3.util.XSLTUtil"
+  extension-element-prefixes="java util"
+  exclude-result-prefixes="java util">
+  
+   <!-- style includes global params interface_name, library_name -->
+  <xsl:include href="style.xsl"/>
+
+  <xsl:output method="html"/>  
+  
+  <xsl:template match="page">
+    <html>
+      <head>
+	<title>
+	  <xsl:call-template name="pageTitle"/><xsl:text> </xsl:text>
+	</title>
+	<xsl:call-template name="globalStyle"/>
+	<base target="_top"/>
+      </head>
+      <body style="background-image: none;">
+	<center>
+	  <table width="537">
+	    <tr><td>
+		<xsl:apply-templates select="pageResponse"/>
+	      </td></tr>
+	  </table>
+	</center>
+      </body>
+    </html>
+  </xsl:template>
+
+  <xsl:template name="pageTitle">
+    <xsl:value-of select="/page/pageResponse/*/displayItem[@name='name']"/>
+  </xsl:template>
+
+  <xsl:template match="pageResponse">
+    <xsl:variable name="collName" select="/page/pageRequest/paramList/param[@name='c']/@value"/>
+    <div align="right">
+    <xsl:call-template name="top-buttons">
+      <xsl:with-param name="collName" select="$collName"/>
+    </xsl:call-template>
+      </div>
+    <xsl:call-template name="navigationBar">
+      <xsl:with-param name="collName" select="$collName"/>
+    </xsl:call-template>      
+  </xsl:template>
+
+</xsl:stylesheet>
Index: /greenstone3/trunk/web/interfaces/gs2/transform/pref.xsl
===================================================================
--- /greenstone3/trunk/web/interfaces/gs2/transform/pref.xsl	(revision 16861)
+++ /greenstone3/trunk/web/interfaces/gs2/transform/pref.xsl	(revision 16861)
@@ -0,0 +1,232 @@
+<?xml version="1.0" encoding="ISO-8859-1"?>
+<xsl:stylesheet version="1.0"
+  xmlns:xsl="http://www.w3.org/1999/XSL/Transform"
+  xmlns:java="http://xml.apache.org/xslt/java"
+  xmlns:util="xalan://org.greenstone.gsdl3.util.XSLTUtil"
+  extension-element-prefixes="java util"
+  exclude-result-prefixes="java util">
+  
+  <xsl:include href="style.xsl"/>
+  <xsl:output method="html"/>  
+  
+  <xsl:template name="pageTitle">
+    <xsl:value-of select="util:getInterfaceText($interface_name, /page/@lang, 'pref_tip')"/>
+  </xsl:template>
+
+  <!-- page specific style goes here -->
+  <xsl:template name="pageStyle">
+    <script type="text/javascript" src="interfaces/classic/js/pref.js"><xsl:text disable-output-escaping="yes"> </xsl:text></script>
+    <link rel="stylesheet" href="interfaces/classic/style/classic.css" type="text/css"/>
+  </xsl:template>
+
+  <xsl:template match="pageResponse">
+    <xsl:variable name="collName" select="/page/pageRequest/paramList/param[@name='c']/@value"/>
+    <!-- check whether these search modes are supported -->    
+    <xsl:variable name="simplestatus"><xsl:choose><xsl:when test="/page/pageResponse//service[@name='TextQuery']">y</xsl:when><xsl:otherwise>n</xsl:otherwise></xsl:choose></xsl:variable>
+    <xsl:variable name="formstatus"><xsl:choose><xsl:when test="/page/pageResponse//service[@name='FieldQuery']">y</xsl:when><xsl:otherwise>n</xsl:otherwise></xsl:choose></xsl:variable>
+    <xsl:variable name="advancedstatus"><xsl:choose><xsl:when test="/page/pageResponse//service[@name='AdvancedFieldQuery']">y</xsl:when><xsl:otherwise>n</xsl:otherwise></xsl:choose></xsl:variable>
+    
+    <center>
+      <xsl:call-template name="standardPageBanner">
+	<xsl:with-param name="collName" select="$collName"/>
+	<xsl:with-param name="pageType">pref</xsl:with-param>
+      </xsl:call-template>
+      <xsl:call-template name="navigationBar">
+	<xsl:with-param name="collName" select="$collName"/>
+      </xsl:call-template>
+      <form name="PrefForm" method="get" action="{$library_name}" onsubmit="return checkForm();">        
+	<input type='hidden' name='a' value='p'/>
+	<input type='hidden' name='sa' value='pref'/>
+        <input type='hidden' name='c' value="{$collName}"/>
+        
+	<table width="800">
+          <tr><td><div class="formheading"><xsl:value-of select="util:getInterfaceText($interface_name, /page/@lang, 'pref.prespref')"/></div></td></tr>
+          <tr><td><xsl:call-template name="pres-prefs"/></td></tr>
+	  <tr><td><div class="formheading"><xsl:value-of select="util:getInterfaceText($interface_name, /page/@lang, 'pref.searchpref')"/></div></td></tr>
+          <tr><td><xsl:call-template name="search-mode-prefs"><xsl:with-param name="simplestatus" select="$simplestatus"/><xsl:with-param name="formstatus" select="$formstatus"/><xsl:with-param name="advancedstatus" select="$advancedstatus"/></xsl:call-template></td></tr>
+	</table>
+      </form>
+    </center>
+  </xsl:template>
+
+  
+  <xsl:template name="pres-prefs">
+    <table>
+      <tr><td><xsl:value-of select="util:getInterfaceText($interface_name, /page/@lang, 'pref.interfacelang')"/></td><td align='left'><xsl:call-template name="lang-list"/><!--English--></td></tr>      
+      <!--<tr><td><xsl:value-of select="util:getInterfaceText($interface_name, /page/@lang, 'pref.encoding')"/></td><td align='left'>UTF-8</td></tr> -->
+    </table>
+  </xsl:template>
+  
+  <xsl:template name="lang-list">
+    <xsl:variable name="current" select="/page/@lang"/>
+    <select name="l">
+      <xsl:for-each select="/page/pageResponse/languageList/language">        
+	<option value="{@name}"><xsl:if test="@name=$current"><xsl:attribute name="selected"></xsl:attribute></xsl:if><xsl:if test="displayItem"><xsl:value-of select="displayItem[@name='name']"/></xsl:if><xsl:if test="not(displayItem)"><xsl:value-of select="@displayname"/></xsl:if></option>
+      </xsl:for-each>
+    </select>
+  </xsl:template>
+  
+  <xsl:template name="search-mode-prefs">
+    <xsl:param name="ns">s1.</xsl:param>
+    <!-- variables that indicates whether these mode are supported by current collection -->
+    <xsl:param name="simplestatus"/>
+    <xsl:param name="formstatus"/>
+    <xsl:param name="advancedstatus"/>
+	    
+    <!-- search type : 0(default, simple); 1(form) -->
+    <xsl:variable name="qt"><xsl:choose><xsl:when test="/page/pageRequest/paramList/param[@name='qt']"><xsl:value-of select="/page/pageRequest/paramList/param[@name='qt']/@value"/></xsl:when><xsl:otherwise>0</xsl:otherwise></xsl:choose></xsl:variable>    
+    <!-- search form type : 0(default, simple form); 1(advanced form) -->
+    <xsl:variable name="queryfmode"><xsl:choose><xsl:when test="/page/pageRequest/paramList/param[@name='qfm']"><xsl:value-of select="/page/pageRequest/paramList/param[@name='qfm']/@value"/></xsl:when><xsl:otherwise>0</xsl:otherwise></xsl:choose></xsl:variable>    
+    <!-- search mode: text, form, advanced -->
+    <xsl:variable name="mode"><xsl:choose><xsl:when test="$qt=0">text</xsl:when><xsl:when test="$queryfmode=0">form</xsl:when><xsl:when test="$queryfmode=1">advanced</xsl:when><xsl:otherwise>text</xsl:otherwise></xsl:choose></xsl:variable>
+            
+    <table>
+      <tr><td> </td><td> </td><td align='right'><input type='submit' name="submit" value='set prefs'/></td></tr>
+      <!-- search type -->       
+      <!-- values are updated by either xslt or javascript -->      
+      <input type="hidden" name="qt" value="{$qt}"/>
+      
+      <tr><td valign='baseline' class='col1'>Type of search </td><td class='col2'><input type='radio' name='qfm' value='2' onclick="javascript:changePref(2)"><xsl:if test="$qt=0 or $queryfmode=2"><xsl:attribute name="checked"/></xsl:if></input></td><td class='col3'> <font><xsl:if test="$qt=0 or $queryfmode=2"><xsl:attribute name="style">font-weight: bold;</xsl:attribute></xsl:if>simple text</font> 
+      
+      <xsl:if test="$formstatus='y'"><input name="qfm" onclick="javascript:changePref(0)" type="radio" value="0"><xsl:if test="$mode='form'"><xsl:attribute name="checked"/></xsl:if></input> <font><xsl:if test="$mode='form'"><xsl:attribute name="style">font-weight: bold;</xsl:attribute></xsl:if>simple form</font></xsl:if>
+       
+      <xsl:if test="$advancedstatus='y'"><input name="qfm" onclick="javascript:changePref(1)" type="radio" value="1" ><xsl:if test="$mode='advanced'"><xsl:attribute name="checked"/></xsl:if></input> <font><xsl:if test="$mode='advanced'"><xsl:attribute name="style">font-weight: bold;</xsl:attribute></xsl:if>advanced form</font></xsl:if>
+      </td></tr>
+      
+      <!-- search options -->
+      <tr><td><div class="formheading">Options</div></td></tr>
+      <xsl:call-template name="search-options-prefs"><xsl:with-param name="mode" select="$mode"/><xsl:with-param name="simplestatus" select="$simplestatus"/><xsl:with-param name="formstatus" select="$formstatus"/><xsl:with-param name="advancedstatus" select="$advancedstatus"/></xsl:call-template>
+    </table>
+  </xsl:template>
+  
+  <xsl:template name="search-options-prefs">
+    <xsl:param name="ns">s1.</xsl:param>
+    <xsl:param name="mode">text</xsl:param>
+    <xsl:param name="simplestatus"/>
+    <xsl:param name="formstatus"/>
+    <xsl:param name="advancedstatus"/>
+    
+    <!-- extract service parameters, avoid hard coding params in this xslt --> 
+    <!-- mode specific options -->
+    <xsl:call-template name="text-search-prefs"><xsl:with-param name="display"><xsl:if test="$mode='text'">y</xsl:if><xsl:if test="$mode='advanced' or $mode='form'">n</xsl:if></xsl:with-param></xsl:call-template>
+    <!-- simple form search mode doesn't have any specific options -->
+    <!-- <xsl:if test="$mode='form'"><xsl:apply-templates select="/page/pageResponse//service[@name='FieldQuery']"/></xsl:if> -->    
+    <xsl:call-template name="advanced-search-prefs"><xsl:with-param name="display"><xsl:if test="$mode='advanced'">y</xsl:if><xsl:if test="$mode='text' or $mode='form'">n</xsl:if></xsl:with-param></xsl:call-template>
+      
+    <!-- search type specific options -->
+    <xsl:apply-templates select="/page/pageResponse//service[@name='TextQuery']">
+      <xsl:with-param name="display"><xsl:if test="$mode='text' or $mode='form'">y</xsl:if><xsl:if test="$mode='advanced'">n</xsl:if></xsl:with-param>
+      <xsl:with-param name="prefix">tf</xsl:with-param>
+    </xsl:apply-templates>
+    <xsl:apply-templates select="/page/pageResponse//service[@name='AdvancedFieldQuery']">
+      <xsl:with-param name="display"><xsl:if test="$mode='advanced'">y</xsl:if><xsl:if test="$mode='text' or $mode='form'">n</xsl:if></xsl:with-param>
+      <xsl:with-param name="prefix">adv</xsl:with-param>
+    </xsl:apply-templates>
+    
+    <!-- General options -->
+    <!-- sort order -->
+    <xsl:variable name="sort"><xsl:choose><xsl:when test="/page/pageResponse//service[@name='TextQuery']//param[@name='sortBy']">y</xsl:when><xsl:otherwise>n</xsl:otherwise></xsl:choose></xsl:variable>
+    <xsl:if test="$sort='y'"> 
+      <xsl:variable name="sortvar" select="concat($ns,'sortBy')"/>    
+      <xsl:variable name="sortparam" select="//param[@name='sortBy']"/>
+      <xsl:variable name="cachedValue" select="/page/pageRequest/paramList/param[@name=$sortvar]/@value"/>      
+      <xsl:variable name="defaultValue" select="$sortparam/@default"/>            
+      <xsl:variable name="optionVal" select="$sortparam/option[1]/@name"/>      
+      
+      <tr><td rowspan='2' valign='baseline'><xsl:value-of select="$sortparam/displayItem"/></td><td><input type='radio' name='{$sortvar}' value='{$optionVal}'><xsl:choose><xsl:when test="$cachedValue=$optionVal"><xsl:attribute name="checked"/></xsl:when><xsl:when test="normalize-space($cachedValue)='' and $optionVal=$defaultValue"><xsl:attribute name="checked"/></xsl:when></xsl:choose></input></td>
+      <td><xsl:value-of select="$sortparam/option[1]/displayItem"/></td></tr>
+      
+      <xsl:variable name="optionVal" select="$sortparam/option[2]/@name"/>
+      <tr><td><input type='radio' name='{$sortvar}' value='{$optionVal}'><xsl:choose><xsl:when test="$cachedValue=$optionVal"><xsl:attribute name="checked"/></xsl:when><xsl:when test="normalize-space($cachedValue)='' and $optionVal=$defaultValue"><xsl:attribute name="checked"/></xsl:when></xsl:choose></input></td><td><xsl:value-of select="$sortparam/option[2]/displayItem"/></td></tr>
+    </xsl:if>
+    
+    <!-- hit display -->
+    <!-- normally all the collections support customized number of returned records and displayed records. Just to be consistent with the other two options. -->
+    <xsl:variable name="maxstatus"><xsl:choose><xsl:when test="/page/pageResponse//service[@name='TextQuery']//param[@name='maxDocs']">y</xsl:when><xsl:otherwise>n</xsl:otherwise></xsl:choose></xsl:variable>
+    <xsl:if test="$maxstatus='y'">      
+      <xsl:variable name="maxvar" select="concat($ns,'maxDocs')"/>
+      <xsl:variable name="maxdocs"><xsl:choose><xsl:when test="/page/pageRequest/paramList/param[@name=$maxvar]"><xsl:value-of select="/page/pageRequest/paramList/param[@name=$maxvar]/@value"/></xsl:when><xsl:otherwise>50</xsl:otherwise></xsl:choose></xsl:variable>
+      <xsl:variable name="hits"><xsl:choose><xsl:when test="/page/pageRequest/paramList/param[@name='hitsPerPage']"><xsl:value-of select="/page/pageRequest/paramList/param[@name='hitsPerPage']/@value"/></xsl:when><xsl:otherwise>20</xsl:otherwise></xsl:choose></xsl:variable>
+      <tr><td colspan='3'>Return up to 
+          <select name="{$ns}maxDocs">
+            <option value="50"><xsl:if test="$maxdocs=50"><xsl:attribute name="selected"></xsl:attribute></xsl:if>50</option>
+            <option value="100"><xsl:if test="$maxdocs=100"><xsl:attribute name="selected"></xsl:attribute></xsl:if>100</option>
+            <option value="200"><xsl:if test="$maxdocs=200"><xsl:attribute name="selected"></xsl:attribute></xsl:if>200</option>
+            <option value="-1"><xsl:if test="$maxdocs=-1"><xsl:attribute name="selected"></xsl:attribute></xsl:if>all</option>
+          </select>
+          hits with 
+          <select name="hitsPerPage">
+            <option value="10"><xsl:if test="$hits=10"><xsl:attribute name="selected"></xsl:attribute></xsl:if>10 </option> 
+            <option value="20"><xsl:if test="$hits=20"><xsl:attribute name="selected"></xsl:attribute></xsl:if>20</option>
+            <option value="50"><xsl:if test="$hits=50"><xsl:attribute name="selected"></xsl:attribute></xsl:if>50</option>
+            <option value="-1"><xsl:if test="$hits=-1"><xsl:attribute name="selected"></xsl:attribute></xsl:if>all</option>
+          </select>
+          hits per page.
+        </td></tr>
+      </xsl:if>
+  </xsl:template>
+    
+  <xsl:template name="advanced-search-prefs">
+    <xsl:param name="display">n</xsl:param>    
+    <xsl:variable name="numbox"><xsl:choose><xsl:when test="/page/pageRequest/paramList/param[@name='qfn']"><xsl:value-of select="/page/pageRequest/paramList/param[@name='qfn']/@value"/></xsl:when><xsl:otherwise>4</xsl:otherwise></xsl:choose></xsl:variable>
+    <tr id="adv-qnb"><xsl:if test="$display='n'"><xsl:attribute name="style">display:none</xsl:attribute></xsl:if>
+      <td colspan='2'>Number of fields: </td><td><select name="qfn">
+      <option value="2"><xsl:if test="$numbox=2"><xsl:attribute name="selected"></xsl:attribute></xsl:if>2</option> 
+      <option value="4"><xsl:if test="$numbox=4"><xsl:attribute name="selected"></xsl:attribute></xsl:if>4</option>
+      <option value="6"><xsl:if test="$numbox=6"><xsl:attribute name="selected"></xsl:attribute></xsl:if>6</option>
+      <option value="8"><xsl:if test="$numbox=8"><xsl:attribute name="selected"></xsl:attribute></xsl:if>8</option>
+    </select></td><td/></tr>
+  </xsl:template>
+
+  <xsl:template name="text-search-prefs">
+    <xsl:param name="display">n</xsl:param>
+    <!-- query mode : 0(default, simple); 1(advanced, boolean)-->
+    <xsl:variable name="querymode"><xsl:choose><xsl:when test="/page/pageRequest/paramList/param[@name='qm']"><xsl:value-of select="/page/pageRequest/paramList/param[@name='qm']/@value"/></xsl:when><xsl:otherwise>0</xsl:otherwise></xsl:choose></xsl:variable>
+    <tr id="text-qm1"><xsl:if test="$display='n'"><xsl:attribute name="style">display:none</xsl:attribute></xsl:if><td rowspan='2' valign='baseline'>Query mode </td><td><input type='radio' name='qm' value='0'><xsl:if test="$querymode=0"><xsl:attribute name="checked"></xsl:attribute></xsl:if></input></td><td> simple query mode</td></tr>
+    <tr id="text-qm2"><xsl:if test="$display='n'"><xsl:attribute name="style">display:none</xsl:attribute></xsl:if><td><input type='radio' name='qm' value='1'><xsl:if test="$querymode=1"><xsl:attribute name="checked"/></xsl:if></input></td><td> advanced query mode (allows boolean searching using !, &amp;, |, and parentheses)</td></tr>
+    
+    <!-- query box size -->
+    <xsl:variable name="boxsize"><xsl:choose><xsl:when test="/page/pageRequest/paramList/param[@name='qb']"><xsl:value-of select="/page/pageRequest/paramList/param[@name='qb']/@value"/></xsl:when><xsl:otherwise>0</xsl:otherwise></xsl:choose></xsl:variable>
+    <tr id="text-qb1"><xsl:if test="$display='n'"><xsl:attribute name="style">display:none</xsl:attribute></xsl:if><td rowspan='2' valign='baseline'>Query box size</td><td><input type='radio' name='qb' value='0'><xsl:if test="$boxsize=0"><xsl:attribute name="checked"></xsl:attribute></xsl:if></input></td><td> regular query box</td></tr>
+    <tr id="text-qb2"><xsl:if test="$display='n'"><xsl:attribute name="style">display:none</xsl:attribute></xsl:if><td><input type='radio' name='qb' value='1'><xsl:if test="$boxsize=1"><xsl:attribute name="checked"></xsl:attribute></xsl:if></input></td><td> large query box</td></tr>    
+  </xsl:template>
+  
+  
+  <xsl:template match="service">
+    <xsl:param name="display">n</xsl:param>
+    <xsl:param name="prefix"/>    
+    <xsl:apply-templates select="paramList/param[not(@type='invisible')]"><xsl:with-param name="display" select="$display"/><xsl:with-param name="prefix" select="$prefix"/></xsl:apply-templates>
+  </xsl:template>
+  
+  <xsl:template match="param"> 
+    <xsl:param name="ns">s1.</xsl:param>
+    <xsl:param name="display">n</xsl:param>
+    <xsl:param name="prefix"/>
+    
+    <xsl:if test="not(@name='matchMode') and not(@name='level') and not(@name='index') and not(@name='sortBy') and not(@name='indexSubcollection') and not(@name='indexLanguage') and (@type='boolean' or @type='enum_single')"><xsl:apply-templates select="." mode="radio"><xsl:with-param name="display" select="$display"/><xsl:with-param name="prefix" select="$prefix"/><xsl:with-param name="paramIdx" select="position()"/></xsl:apply-templates></xsl:if>    
+  </xsl:template>
+  
+  <xsl:template match="param" mode="radio"> 
+    <xsl:param name="ns">s1.</xsl:param>
+    <xsl:param name="display">n</xsl:param>
+    <xsl:param name="prefix"/>
+    <xsl:param name="paramIdx"/>
+    
+    <xsl:variable name="cachedName" select="concat($ns, @name)"/>
+    <xsl:variable name="cachedValue"><xsl:choose><xsl:when test="/page/pageRequest/paramList/param[@name=$cachedName]"><xsl:value-of select="/page/pageRequest/paramList/param[@name=$cachedName]/@value"/></xsl:when><xsl:otherwise><xsl:value-of select="@default"/></xsl:otherwise></xsl:choose></xsl:variable>
+    <!-- number of options, for rowspan attribute -->
+    <xsl:variable name="numOptions" select="count(option)"/>
+    <xsl:variable name="displayName"><xsl:value-of select="displayItem"/></xsl:variable>
+    <xsl:variable name="paramName"><xsl:value-of select="@name"/></xsl:variable>    
+    
+    <xsl:for-each select="option">     
+      <xsl:variable name="value" select="@name"/>
+      <tr><xsl:attribute name="id"><xsl:value-of select="concat($prefix, '-', $paramIdx, '-', position())"/></xsl:attribute><xsl:if test="$display='n'"><xsl:attribute name="style">display:none</xsl:attribute></xsl:if>
+      <xsl:if test="position()=1"><td rowspan='{$numOptions}' valign='baseline'><xsl:value-of select="../displayItem"/></td></xsl:if>
+      <td><input type='radio' name='{$cachedName}' value="{$value}"><xsl:if test="$cachedValue=$value"><xsl:attribute name="checked">true</xsl:attribute></xsl:if></input></td>
+      <td><xsl:value-of select="displayItem"/></td>
+      </tr>
+    </xsl:for-each>
+  </xsl:template>
+ 
+</xsl:stylesheet>
Index: /greenstone3/trunk/web/interfaces/gs2/transform/query-common.xsl
===================================================================
--- /greenstone3/trunk/web/interfaces/gs2/transform/query-common.xsl	(revision 16861)
+++ /greenstone3/trunk/web/interfaces/gs2/transform/query-common.xsl	(revision 16861)
@@ -0,0 +1,157 @@
+<?xml version="1.0" encoding="ISO-8859-1"?>
+<xsl:stylesheet version="1.0"
+  xmlns:xsl="http://www.w3.org/1999/XSL/Transform"
+  xmlns:java="http://xml.apache.org/xslt/java"
+  xmlns:util="xalan://org.greenstone.gsdl3.util.XSLTUtil"
+  extension-element-prefixes="java util"
+  exclude-result-prefixes="java util">
+
+  <!--<xsl:include href="service-params.xsl"/>-->
+  <xsl:template match="service">
+    <xsl:param name="collName"/>
+    <xsl:variable name="subaction" select="../pageRequest/@subaction"/>
+    <div class="queryform">
+     <p> 
+      <form name="QueryForm" method="get" action="{$library_name}">
+        <input type="hidden" name="a" value="q"/>
+        <input type="hidden" name="sa" value="{$subaction}"/>
+        <input type="hidden" name="rt" value="rd"/>
+        <input type="hidden" name="s" value="{@name}"/>
+        <input type="hidden" name="c" value="{$collName}"/>
+        <input type="hidden" name="startPage" value="1"/>
+      <xsl:apply-templates select="paramList"/>
+      </form>
+     </p> 
+    </div>
+  </xsl:template>
+  
+  <!-- a special handling of the param list - we override the one in service-params -->
+  <xsl:template match="paramList" priority='2'>    	
+	<span class="textselect">
+		Search for <xsl:apply-templates select="param[@name='index']"><xsl:with-param name="default"><xsl:apply-templates select="param[@name='index']" mode="calculate-default"/></xsl:with-param></xsl:apply-templates><xsl:if test="param[@name='indexSubcollection']"> of <xsl:apply-templates select="param[@name='indexSubcollection']"><xsl:with-param name="default"><xsl:apply-templates select="param[@name='indexSubcollection']" mode="calculate-default"/></xsl:with-param></xsl:apply-templates></xsl:if><xsl:if test="param[@name='indexLanguage']"> in <xsl:apply-templates select="param[@name='indexLanguage']"><xsl:with-param name="default"><xsl:apply-templates select="param[@name='indexLanguage']" mode="calculate-default"/></xsl:with-param></xsl:apply-templates></xsl:if><xsl:if test="param[@name='level' and not(@type='invisible')]"> at <xsl:apply-templates select="param[@name='level']"><xsl:with-param name="default"><xsl:apply-templates select="param[@name='level']" mode="calculate-default"/></xsl:with-param></xsl:apply-templates> level</xsl:if><xsl:call-template name='query_mode'/>
+    </span>	
+    <span class="querybox"> 
+     <xsl:call-template name="query-and-submit"/>
+    </span>
+  </xsl:template>
+  
+  <!-- new template for match mode -->
+  <xsl:template name='query_mode'>
+    <xsl:variable name="qt" select="/page/pageRequest/paramList/param[@name='qt']/@value"/>
+    <xsl:choose>
+      <xsl:when test="$qt=1">
+	<xsl:variable name="qfm" select="/page/pageRequest/paramList/param[@name='qfm']/@value"/>
+	<xsl:choose>
+	  <xsl:when test="$qfm=1">
+	    <!-- and display results in <xsl:apply-templates select="param[@name='sortBy']"><xsl:with-param name="default"><xsl:apply-templates select="param[@name='sortBy']" mode="calculate-default"/></xsl:with-param></xsl:apply-templates> order -->
+	  </xsl:when>
+	  <xsl:otherwise>
+	    which contain <xsl:apply-templates select="param[@name='matchMode']"><xsl:with-param name="default"><xsl:apply-templates select="param[@name='matchMode']" mode="calculate-default"/></xsl:with-param></xsl:apply-templates> of
+	  </xsl:otherwise>
+	</xsl:choose>
+      </xsl:when>
+      <xsl:otherwise>
+	<xsl:variable name="ct" select="/page/pageRequest/paramList/param[@name='ct']/@value"/>
+	<xsl:variable name="qm" select="/page/pageRequest/paramList/param[@name='qm']/@value"/>
+	<xsl:choose>
+	  <xsl:when test="$qm=1 and $ct=0">
+	    using ranked/bool query
+	  </xsl:when>
+	  <xsl:when test="$qm=1 and $ct=1">
+	    and display results in <xsl:apply-templates select="param[@name='sortBy']"><xsl:with-param name="default"><xsl:apply-templates select="param[@name='sortBy']" mode="calculate-default"/></xsl:with-param></xsl:apply-templates> order
+	  </xsl:when>
+	  <xsl:otherwise>
+	    which contain <xsl:apply-templates select="param[@name='matchMode']"><xsl:with-param name="default"><xsl:apply-templates select="param[@name='matchMode']" mode="calculate-default"/></xsl:with-param></xsl:apply-templates> of the words
+	  </xsl:otherwise>
+	</xsl:choose>
+      </xsl:otherwise>
+    </xsl:choose>
+  </xsl:template>
+   
+  <xsl:template match="param[@name='matchMode']" mode='query1'>
+   <xsl:param name='default'/>
+    <xsl:variable name="qfm" select="/page/pageRequest/paramList/param[@name='qfm']/@value"/>
+    <xsl:choose>
+      <xsl:when test="$qfm=1">
+	and display results in <xsl:apply-templates select="../param[@name='sortBy']"><xsl:with-param name="default" select="$default"/></xsl:apply-templates> order
+      </xsl:when>
+      <xsl:otherwise>
+	which contain <xsl:apply-templates select='.'><xsl:with-param name="default" select="$default"/></xsl:apply-templates> of the words
+      </xsl:otherwise>
+    </xsl:choose>
+  </xsl:template>
+  
+  <xsl:template name="query-and-submit">
+    <xsl:variable name="qt" select="/page/pageRequest/paramList/param[@name='qt']/@value"/>
+    <xsl:choose>
+      <xsl:when test="$qt=1"> <!-- doing form query -->
+	<xsl:variable name="qfm" select="/page/pageRequest/paramList/param[@name='qfm']/@value"/>
+	<xsl:choose>
+	  <xsl:when test="$qfm=1">
+	     <xsl:apply-templates select="param[@name='complexField']"/>
+	  </xsl:when>
+	  <xsl:otherwise>
+	     <xsl:apply-templates select="param[@name='simpleField']"/>
+	  </xsl:otherwise>
+	</xsl:choose>
+	    <input type="submit"><xsl:attribute name="value"><xsl:value-of select="../displayItem[@name='submit']"/></xsl:attribute></input>
+	 
+      </xsl:when>
+      <xsl:otherwise> <!-- doing text query -->
+    <xsl:variable name="qb" select="/page/pageRequest/paramList/param[@name='qb']/@value"/>
+	<xsl:choose>
+	  <xsl:when test="$qb=1"><!-- large query box -->
+	       <textarea name="s1.query" cols='63' rows='10'>
+		  <xsl:apply-templates select="param[@name='query']" mode="calculate-default"/><xsl:text> </xsl:text><!-- put a space here just in case there is no value- mozilla craps out if have a <textarea /> element -->
+		</textarea>
+	   <input type="submit"><xsl:attribute name="value"><xsl:value-of select="../displayItem[@name='submit']"/></xsl:attribute></input>
+	   </xsl:when>
+	  <xsl:otherwise>
+	 	<xsl:variable name="qs"><xsl:apply-templates select="param[@name='query']" mode="calculate-default"/></xsl:variable>
+		<nobr><xsl:apply-templates select="param[@name='query']"><xsl:with-param name="default" select="java:org.greenstone.gsdl3.util.XSLTUtil.tidyWhitespace($qs)"/></xsl:apply-templates><input type="submit"><xsl:attribute name="value"><xsl:value-of select="../displayItem[@name='submit']"/></xsl:attribute></input></nobr>
+	   </xsl:otherwise>
+	</xsl:choose>
+      </xsl:otherwise>
+    </xsl:choose>
+  </xsl:template>
+  
+  <!-- overwrite the multi param to use our value of occurs, not the one with the param -->
+  <xsl:template match="param[@type='multi']" priority='2'>
+    <xsl:variable name="parent" select="@name"/>
+    <table>
+      <tr>
+	<xsl:for-each select="param">
+	  <xsl:variable name='pname' select='@name'/>
+	  <td><xsl:value-of select="displayItem[@name='name']"/></td>
+	</xsl:for-each>
+      </tr>
+      <!-- the number of times to display this is the qfn variable -->
+      <xsl:variable name="numbox"><xsl:choose><xsl:when test="/page/pageRequest/paramList/param[@name='qfn']"><xsl:value-of select="/page/pageRequest/paramList/param[@name='qfn']/@value"/></xsl:when><xsl:otherwise>4</xsl:otherwise></xsl:choose></xsl:variable>
+      <xsl:apply-templates select="." mode="contents"><xsl:with-param name="occurs" select="$numbox"/><xsl:with-param name="pos" select="0"/></xsl:apply-templates>
+    </table>
+  </xsl:template>
+
+  <xsl:template match="param[@type='multi']" mode="contents">
+    <xsl:param name="occurs"/>
+    <xsl:param name="ns">s1.</xsl:param>
+    <xsl:param name="pos"/>
+ <!--   <xsl:variable name="pos" select="@occurs - $occurs"/>-->
+    <tr><xsl:for-each select="param">
+	<xsl:variable name="pname" select="@name"/>
+	<xsl:variable name="values" select="/page/pageRequest/paramList/param[@name=concat($ns,$pname)]/@value"/>
+	<td><xsl:choose>
+	    <xsl:when test="not(@ignore) or  @ignore != $pos">      
+	      <xsl:apply-templates select='.'><xsl:with-param name="default" select="java:org.greenstone.gsdl3.util.XSLTUtil.getNumberedItem($values, $pos)"/></xsl:apply-templates>
+	    </xsl:when>
+	    <xsl:otherwise><!-- put in a hidden placeholder -->
+	      <input type="hidden" name='{$ns}{@name}' value=''/>
+	    </xsl:otherwise>
+	  </xsl:choose></td>
+      </xsl:for-each></tr> 
+    <!-- recursively call this template to get multiple entries -->
+    <xsl:if test="$pos &lt; ($occurs - 1)">
+      <xsl:apply-templates select="." mode="contents"><xsl:with-param name="occurs" select="$occurs"/><xsl:with-param name="pos" select="$pos+1"/></xsl:apply-templates>
+    </xsl:if>
+  </xsl:template>
+
+</xsl:stylesheet>
Index: /greenstone3/trunk/web/interfaces/gs2/transform/query.xsl
===================================================================
--- /greenstone3/trunk/web/interfaces/gs2/transform/query.xsl	(revision 16861)
+++ /greenstone3/trunk/web/interfaces/gs2/transform/query.xsl	(revision 16861)
@@ -0,0 +1,66 @@
+<?xml version="1.0" encoding="ISO-8859-1"?>
+<xsl:stylesheet version="1.0"
+  xmlns:xsl="http://www.w3.org/1999/XSL/Transform"
+  xmlns:java="http://xml.apache.org/xslt/java"
+  xmlns:util="xalan://org.greenstone.gsdl3.util.XSLTUtil"
+  extension-element-prefixes="java util"
+  exclude-result-prefixes="java util">
+
+  
+  <xsl:include href="style.xsl"/>
+  <xsl:include href="service-params.xsl"/>
+  <xsl:include href="querytools.xsl"/>
+  <xsl:include href="query-common.xsl"/>  
+  <xsl:output method="html"/>
+  
+  <xsl:template name="pageTitle">
+    <xsl:value-of select="util:getInterfaceText($interface_name, /page/@lang, 'nzdl')"/>
+  </xsl:template>
+
+  <!-- page specific style goes here -->
+  <xsl:template name="pageStyle"/>
+
+
+  <xsl:template match="pageResponse">
+    <xsl:variable name="collName"><xsl:value-of select="/page/pageRequest/paramList/param[@name='c']/@value"/></xsl:variable>
+
+      <xsl:call-template name="standardPageBanner">
+	<xsl:with-param name="collName" select="$collName"/>
+	<xsl:with-param name="pageType">search</xsl:with-param>
+      </xsl:call-template>
+      <xsl:call-template name="navigationBar">
+	<xsl:with-param name="collName" select="$collName"/>
+      </xsl:call-template>      
+    <div class="document">
+     <xsl:apply-templates select="service">
+	<xsl:with-param name="collName" select="$collName"/>
+      </xsl:apply-templates>
+    <xsl:if test="documentNodeList">
+      <xsl:call-template name="query-response">
+	<xsl:with-param name="collName" select="$collName"/>
+      </xsl:call-template>
+    </xsl:if>
+   </div>
+  </xsl:template>
+  
+  <xsl:template name="query-response">
+    <xsl:param name="collName"/>
+    <xsl:call-template name="dividerBar">
+      <xsl:with-param name='text'><xsl:value-of select="util:getInterfaceText($interface_name, /page/@lang, 'query.results')"/></xsl:with-param></xsl:call-template>
+
+    <!-- If query term information is available, display it -->
+    <xsl:call-template name="termInfo"/>    
+    <!-- If the number of matching documents is known, display it -->
+    <xsl:call-template name="matchDocs"/>
+    
+    <!-- Display the matching documents -->
+    <xsl:call-template name="resultList">
+      <xsl:with-param name="collName" select="$collName"/>
+    </xsl:call-template>
+    <!-- next and prev links at bottom of page -->
+    <xsl:call-template name="resultNavigation">
+    	<xsl:with-param name="collName" select="$collName"/>
+    </xsl:call-template>	
+  </xsl:template>
+
+</xsl:stylesheet>  
Index: /greenstone3/trunk/web/interfaces/gs2/transform/style.xsl
===================================================================
--- /greenstone3/trunk/web/interfaces/gs2/transform/style.xsl	(revision 16861)
+++ /greenstone3/trunk/web/interfaces/gs2/transform/style.xsl	(revision 16861)
@@ -0,0 +1,396 @@
+<?xml version="1.0" encoding="ISO-8859-1"?>
+<xsl:stylesheet version="1.0"
+  xmlns:xsl="http://www.w3.org/1999/XSL/Transform"
+  xmlns:java="http://xml.apache.org/xslt/java"
+  xmlns:util="xalan://org.greenstone.gsdl3.util.XSLTUtil"
+  extension-element-prefixes="java util"
+  exclude-result-prefixes="java util">
+  
+  <!-- some global parameters - these are set by whoever is invoking the transformation -->
+  <xsl:param name="interface_name"/>
+  <xsl:param name="library_name"/>
+
+  <!-- the main page layout template is here -->
+  <xsl:template match="page">
+    <html>
+      <xsl:call-template name="pageHead"/>
+      <body class="bgimage">
+	<xsl:attribute name="dir"><xsl:call-template name="direction"/></xsl:attribute>
+	<div id="page">
+	   <xsl:apply-templates select="pageResponse"/>
+	   <xsl:call-template name="greenstoneFooter"/>                	   
+	</div>
+      </body>
+    </html>
+  </xsl:template>
+  
+  <!-- put a space in the title in case the actual value is missing - mozilla will not display a page with no title-->
+  <xsl:template name="pageHead">
+    <head>
+      <title>
+	<xsl:call-template name="pageTitle"/><xsl:text> </xsl:text>
+      </title>
+      <xsl:call-template name="globalStyle"/>
+      <xsl:call-template name="pageStyle"/>
+    </head>
+  </xsl:template>
+
+  <!-- any global style stuff should go in here -->
+  <xsl:template name="globalStyle">
+    <link rel="stylesheet" href="interfaces/classic/style/classic.css" type="text/css"/>
+     <link rel="stylesheet" href="interfaces/classic/style/classic2.css" type="text/css"/>
+  </xsl:template>
+  
+  <xsl:template name="greenstonePageBanner">
+     <div id="banner">
+        <div class="collectimage">
+            <img src="interfaces/default/images/gsdlhead.gif"><xsl:attribute name="alt"><xsl:value-of select="util:getInterfaceText($interface_name, /page/@lang, 'gsdl')"/></xsl:attribute>
+            </img>
+	  </div>
+      </div>
+      <div class="bannerextra"></div>
+      <div id="content">
+        <xsl:call-template name="dividerBar">
+            <xsl:with-param name="text" select="'select a collection'"/> 
+        </xsl:call-template>
+      </div>			
+   </xsl:template>
+
+  <xsl:template name="genericPageBanner">
+    <xsl:param name='text'/>
+    <xsl:variable name="lang" select="/page/@lang"/>
+    <center>
+      <table width="100%">
+	<tr><td align="left"></td>
+	  <td align="right">
+	    <table>
+	      <tr><td class="gsbutton">
+		  <a class="gsbutton" href="{$library_name}?a=p&amp;sa=home">
+		    <xsl:value-of select="util:getInterfaceText($interface_name, /page/@lang, 'home_b')"/>
+		  </a>
+		</td></tr></table>
+	  </td>
+	</tr>
+      </table>
+    </center>
+    <xsl:call-template name="dividerBar"><xsl:with-param name='text' select="$text"/></xsl:call-template>
+  </xsl:template>
+  
+  <xsl:template name="standardPageBanner">
+    <xsl:param name="collName"/>
+    <xsl:param name="pageType"/>
+    <xsl:param name="clTop"/>
+    <xsl:variable name="this-element" select="/page/pageResponse/collection"/>
+     <div id="bannar">
+      <div class="pageinfo"> 
+          <xsl:call-template name="top-buttons">
+	    <xsl:with-param name="collName" select="$collName"/>
+	    <xsl:with-param name="pageType" select="$pageType"/>
+	  </xsl:call-template>
+          <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>
+        <p class="bannertitle"><xsl:value-of select="$text"/></p>	 
+      </xsl:if>
+     </div>
+
+     <div class="collectimage">
+       <a href="{$library_name}?a=p&amp;sa=about&amp;c={$collName}">
+	    <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>
+       </div>
+      </div>
+    <div class="bannerextra"></div>	
+  </xsl:template>
+  
+  <xsl:template name="top-buttons">
+    <xsl:param name="collName"/>
+    <xsl:param name="pageType"/>
+    <p class="bannerlinks">
+      	  <a class="navlink" href="{$library_name}?a=p&amp;sa=home"><xsl:attribute name="title"><xsl:value-of select="util:getInterfaceText($interface_name, /page/@lang, 'home_tip')"/></xsl:attribute>
+	    <xsl:value-of select="util:getInterfaceText($interface_name, /page/@lang, 'home_b')"/>
+	  </a>
+	<!-- <xsl:choose>
+	<xsl:when test="$pageType='help'">
+             <xsl:value-of select="util:getInterfaceText($interface_name, /page/@lang, 'help_b')"/>
+        </xsl:when>
+	<xsl:otherwise>
+	  <a class="navlink" href="{$library_name}?a=p&amp;sa=help&amp;c={$collName}"><xsl:attribute name="title"><xsl:value-of select="util:getInterfaceText($interface_name, /page/@lang, 'help_tip')"/></xsl:attribute>
+	<xsl:value-of select="util:getInterfaceText($interface_name, /page/@lang, 'help_b')"/>
+          </a>
+       </xsl:otherwise>
+      </xsl:choose> -->
+       <xsl:choose>
+	  <xsl:when test="$pageType='pref'">
+	      <xsl:value-of select="util:getInterfaceText($interface_name, /page/@lang, 'pref_b')"/>
+	   </xsl:when>
+	  <xsl:otherwise>
+	    <a class="navlink" href="{$library_name}?a=p&amp;sa=pref&amp;c={$collName}"><xsl:attribute name="title"><xsl:value-of select="util:getInterfaceText($interface_name, /page/@lang, 'pref_tip')"/></xsl:attribute>
+		<xsl:value-of select="util:getInterfaceText($interface_name, /page/@lang, 'pref_b')"/>
+	    </a>
+	   </xsl:otherwise>
+	</xsl:choose>      
+    </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[1]"/>
+
+    <!-- display order, for Arabic etc. languages, display right to left -->
+    <xsl:variable name="dir"><xsl:call-template name="direction"/></xsl:variable>
+    <xsl:variable name="sort_order"><xsl:choose><xsl:when test="$dir='rtl'">descending</xsl:when><xsl:otherwise>ascending</xsl:otherwise></xsl:choose></xsl:variable>	    
+
+    <div class="navbar">
+       <p class="navbar">
+	 <xsl:choose>
+	 <xsl:when test="not($dir='rtl')">
+	 <xsl:if test="$this-element/serviceList/service[@type='query']">
+	   <xsl:call-template name="navbar-search"><xsl:with-param name="collName" select="$collName"/></xsl:call-template>
+	 </xsl:if>
+	 </xsl:when>
+	 <xsl:otherwise>
+	  <xsl:if test="$this-element/serviceList/service[@name='PhindApplet']">
+	  <xsl:call-template name="navbar-phind"><xsl:with-param name="collName" select="$collName"/></xsl:call-template>
+	  </xsl:if>
+	 </xsl:otherwise>
+	</xsl:choose>
+
+	<xsl:for-each select="$classifiers/classifier">
+	  <xsl:sort order="{$sort_order}" select="position()" />
+	  <xsl:apply-templates select="." mode="navbar">
+	    <xsl:with-param name="collName" select="$collName"/>
+	    <xsl:with-param name="clTop" select="$clTop"/>
+	  </xsl:apply-templates>
+	</xsl:for-each>
+		
+	<xsl:choose>	
+	<xsl:when test="$dir='rtl'">
+	<xsl:if test="$this-element/serviceList/service[@type='query']">
+	   <xsl:call-template name="navbar-search"><xsl:with-param name="collName" select="$collName"/></xsl:call-template>
+	</xsl:if>
+	</xsl:when>
+	<xsl:otherwise>
+	<xsl:if test="$this-element/serviceList/service[@name='PhindApplet']">
+	  <xsl:call-template name="navbar-phind"><xsl:with-param name="collName" select="$collName"/></xsl:call-template>
+	</xsl:if>
+	</xsl:otherwise>
+	</xsl:choose>
+       </p>
+      </div> 
+  </xsl:template>
+
+  <xsl:template name="navbar-search">
+    <xsl:param name="collName"/>
+    <xsl:choose>
+      <xsl:when test="/page/pageRequest/@action='q'">	  
+	   <span class="narspace">search</span>
+      </xsl:when>
+      <xsl:otherwise>
+	<xsl:variable name="service">
+	  <xsl:choose>
+	    <xsl:when  test="not(/page/pageRequest/paramList/param[@name='ct'])">TextQuery</xsl:when>
+	    <xsl:when test="/page/pageRequest/paramList/param[@name='ct']/@value='0'">TextQuery</xsl:when>
+	    <xsl:when test="/page/pageRequest/paramList/param[@name='qt']/@value='1'"><xsl:choose><xsl:when test="/page/pageRequest/paramList/param[@name='qfm']/@value='1'">AdvancedFieldQuery</xsl:when><xsl:otherwise>FieldQuery</xsl:otherwise></xsl:choose></xsl:when>
+	    <xsl:otherwise>TextQuery</xsl:otherwise>
+	  </xsl:choose>
+	</xsl:variable>
+	<a class="navlink" 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>search</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'">
+	    <span class="narspace">phrases</span>
+      </xsl:when>
+      <xsl:otherwise>
+	 <a class="navlink" 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>phrases</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">
+	 <span class="narspace"><xsl:value-of select="displayItem[@name='name']"/></span>
+      </xsl:when>
+      <xsl:otherwise>
+	<a class="navlink" 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><xsl:value-of select="displayItem[@name='name']"/></a>
+      </xsl:otherwise>
+    </xsl:choose>
+  </xsl:template>
+
+  <xsl:template name="dividerBar">   
+    <xsl:param name='text'/>
+      <xsl:choose>
+      <xsl:when test="$text">
+	 <div class="divbar"><p class="navbar"><xsl:value-of select="$text"/></p></div>
+      </xsl:when>
+      <xsl:otherwise>
+	 <div class="divbar"><xsl:text disable-output-escaping="yes">&amp;nbsp;</xsl:text></div>
+      </xsl:otherwise>
+    </xsl:choose> 
+  </xsl:template>
+  
+  <xsl:template name="nzdlPageBanner">
+       <div><img src="interfaces/nzdl/images/nzdl2gr.gif" width="457" height="181" ><xsl:attribute name="alt"><xsl:value-of select="util:getInterfaceText($interface_name, /page/@lang, 'nzdl')"/></xsl:attribute></img></div>
+       <!-- end of page banner -->  
+  </xsl:template>
+
+  <xsl:template name="greenstoneFooter">
+    <div class="divbar"><p class="navbar">powered by greenstone3</p>
+    </div>
+  </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">
+    
+    <!-- Root node: book icon (open or closed) -->
+    <xsl:choose>
+      <xsl:when test="@nodeType='root'">
+	<xsl:choose>
+	  <xsl:when test="documentNode">
+	    <xsl:call-template name="openbookimg">
+	      <xsl:with-param name="title">Close this book</xsl:with-param>
+	    </xsl:call-template>
+	  </xsl:when>
+	  <xsl:otherwise>
+	    <xsl:call-template name="closedbookimg">
+	      <xsl:with-param name="title">Open this document and view contents</xsl:with-param>
+	    </xsl:call-template>
+	  </xsl:otherwise>
+	</xsl:choose>
+      </xsl:when>
+      
+      <!-- Internal node: folder icon (open or closed) -->
+      <xsl:when test="@nodeType='internal'">
+	<xsl:choose>
+	  <xsl:when test="documentNode">
+	    <xsl:call-template name="openfolderimg">
+	      <xsl:with-param name="title">Close this folder</xsl:with-param>
+	    </xsl:call-template>
+	  </xsl:when>
+	  <xsl:otherwise>
+	    <xsl:call-template name="closedfolderimg">
+	      <xsl:with-param name="title">Open this folder and view contents</xsl:with-param>
+	    </xsl:call-template>
+	  </xsl:otherwise>
+	</xsl:choose>
+      </xsl:when>
+      
+      <!-- Leaf node: page icon, and this is the default -->
+      <xsl:otherwise>
+	<xsl:call-template name="textpageimg">
+	  <xsl:with-param name="title">View the document</xsl:with-param>
+	</xsl:call-template>
+      </xsl:otherwise>
+    </xsl:choose>
+  </xsl:template>
+
+
+  <xsl:template name="openbookimg">
+    <xsl:param name="alt"/>
+    <xsl:param name="title"/>
+    <img border="0" width="28" height="23" 
+      src="interfaces/default/images/openbook.gif"
+      alt="{$alt}" title="{$title}"/>
+  </xsl:template>
+
+  <xsl:template name="closedbookimg">
+    <xsl:param name="alt"/>
+    <xsl:param name="title"/>
+    <img border="0" width="18" height="11"  
+      src="interfaces/default/images/book.gif"
+      alt="{$alt}" title="{$title}"/>
+  </xsl:template>
+
+  <xsl:template name="openfolderimg">
+    <xsl:param name="alt"/>
+    <xsl:param name="title"/>
+    <img border="0" width="23" height="15"  
+      src="interfaces/default/images/openfldr.gif"
+      alt="{$alt}" title="{$title}"/>
+  </xsl:template>
+
+  <xsl:template name="closedfolderimg">
+    <xsl:param name="alt"/>
+    <xsl:param name="title"/>
+    <img border="0" width="23" height="15" 
+      src="interfaces/default/images/clsdfldr.gif"
+      alt="{$alt}" title="{$title}"/>
+  </xsl:template>
+
+  <xsl:template name="textpageimg">
+    <xsl:param name="alt"/>
+    <xsl:param name="title"/>
+    <img border="0" width="16" height="21"
+      src="interfaces/default/images/itext.gif"
+      alt="{$alt}" title="{$title}"/>
+  </xsl:template>
+
+  <xsl:template name="bookshelfimg">
+    <xsl:param name="alt"/>
+    <xsl:param name="title"/>
+    <img border="0" width="20" height="16" 
+      src="interfaces/default/images/bshelf.gif"  
+      alt="{$alt}" title="{$title}"/>
+  </xsl:template>
+
+  <xsl:template name="iconpdf">
+    <xsl:param name="alt">PDF</xsl:param>
+    <xsl:param name="title"><xsl:value-of select="util:getInterfaceText($interface_name, /page/@lang, 'texticonpdf')"/></xsl:param>
+    <img border="0" width='26' height='26' 
+      src='interfaces/default/images/ipdf.gif' 
+      alt='{$alt}' title='{$title}'/>
+  </xsl:template>
+    
+  <xsl:template name="icondoc">
+    <xsl:param name="alt">Word</xsl:param>
+    <xsl:param name="title"><xsl:value-of select="util:getInterfaceText($interface_name, /page/@lang, 'texticonmsword')"/></xsl:param>
+    <img border="0" width='26' height='26' 
+      src='interfaces/default/images/imsword.gif' 
+      alt='{$alt}' title='{$title}'/>
+  </xsl:template>
+
+  <xsl:template name="direction">
+    <xsl:if test="/page/@lang='ar' or /page/@lang='fa' or /page/@lang='he' or /page/@lang='ur' or /page/@lang='ps' or /page/@lang='prs'">rtl</xsl:if>
+  </xsl:template>
+
+</xsl:stylesheet>  
