Index: /greenstone3/trunk/web/interfaces/default/transform/home.xsl
===================================================================
--- /greenstone3/trunk/web/interfaces/default/transform/home.xsl	(revision 18481)
+++ /greenstone3/trunk/web/interfaces/default/transform/home.xsl	(revision 18482)
@@ -1,126 +1,83 @@
 <?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">
+	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:gslib="http://www.greenstone.org/skinning"
+	extension-element-prefixes="java util"
+	exclude-result-prefixes="util java util">
 
-  <!-- style includes global params interface_name, library_name -->
-  <xsl:include href="style.xsl"/>
+ 
+  <xsl:template match="page/pageResponse">
+  
+   <!-- the main page layout template is here -->
+    <html>
+			
+	      <head>
+			<title>
+				<gslib:homePageTitle/>
+			</title>
+			<link rel="stylesheet" href="interfaces/default/style/core.css" type="text/css"/>
+		  </head>
+		  
+	      <body><gslib:textDirectionAttribute/>
+		
+		<div id="page-wrapper">
+		<gslib:displayErrorsIfAny/>
+	 
+		
+	    <div id="banner">
+	      <p>
+			<img src="interfaces/default/images/gsdlhead.gif"><xsl:attribute name="alt"><gslib:greenstoneLogoAlternateText/></xsl:attribute>
+			</img>
+	      </p>
+	    </div>
+		
+	    <div id="content">
+		
+			<div class="divbar"><gslib:selectACollectionTextBar/></div>
+			
+			<div class="QuickSearch">
+				<gslib:crossCollectionQuickSearchForm/>
+			</div>
+				
+			
+			<ul id="collectionlist">
+				<xsl:for-each select="collectionList/collection"> 
+					<li>
+						<gslib:collectionLinkWithImage/>
+					</li>
+			    </xsl:for-each> 
+		    </ul>
+			
+			<gslib:serviceClusterList/>
+			
+			<div class="divbar"><gslib:noTextBar/></div>
+			
+			<ul id="servicelist">
+				<xsl:for-each select="serviceList/service[@type='query']">
+					<li><gslib:serviceLink/></li>
+				</xsl:for-each>
+				
+			 <!--uncomment the line below to display an authentication link inside a <li>-->
+			 <!--<gslib:authenticationLink/>-->
+				
+			 <!--uncomment the line below to display a library interface link inside a <li>-->
+			 <!--<gslib:libraryInterfaceLink/>-->
+			</ul>
+			
+	    </div>
 
-  <xsl:output method="html"/>  
-  
-  <!-- the main page layout template is here -->
-  <xsl:template match="page">
-    <html>
-      <head>
-	<title>
-	  <!-- put a space in the title in case the actual value is missing - mozilla will not display a page with no title-->
-	  <xsl:call-template name="pageTitle"/><xsl:text> </xsl:text>
-	</title>
-	<xsl:call-template name="globalStyle"/>
-	<xsl:call-template name="pageStyle"/>
-      </head>
-      <body>
-	<xsl:attribute name="dir"><xsl:call-template name="direction"/></xsl:attribute>
-	<div id="page-wrapper">
-	  <xsl:call-template name="response" />
-	  <xsl:call-template name="greenstoneFooter"/>
-	</div>
-      </body>
+		
+			<div id="footer">
+				<div class="divbar"><gslib:poweredByGS3TextBar/></div>
+			</div>
+		 
+		</div>
+		
+	   </body>
     </html>
-  </xsl:template>
-
-  <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="pageBanner"/> 
-    <xsl:apply-templates select="serviceList/service[@name='TextQuery']"/>
-    <xsl:apply-templates select="collectionList"/>   
-    <xsl:apply-templates select="serviceClusterList"/>
-    <xsl:apply-templates select="serviceList"/>
-  </xsl:template>
-
-  <xsl:template name="pageBanner">
-    <div id="banner">
-      <p>
-	<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>
-      </p>
-    </div>
-    <div id="content">
-      <xsl:call-template name="dividerBar">
-	<xsl:with-param name="text" select="util:getInterfaceText($interface_name, /page/@lang, 'home.select_a_collection')"/> 
-      </xsl:call-template>	
-    </div>
-  </xsl:template>
-
-  <xsl:template match="collectionList">
-    <ul id="collectionlist">
-      <xsl:for-each select="collection"> 
-	<li>
-	  
-	  <xsl:choose>
-	    <xsl:when test="displayItem[@name='icon']">
-              <a href="{$library_name}?a=p&amp;sa=about&amp;c={@name}">
-                <img>
-		  <xsl:attribute name="src">
-		    <xsl:value-of select="metadataList/metadata[@name='httpPath']"/>/images/<xsl:value-of select="displayItem[@name='icon']"/>
-		  </xsl:attribute>
-		  <xsl:attribute name="alt">
-		    <xsl:value-of select="displayItem[@name='name']"/>
-		  </xsl:attribute>
-		</img> 
-	      </a>  
-	    </xsl:when>
-	    <xsl:otherwise>
-	      <a class="noimage" href="{$library_name}?a=p&amp;sa=about&amp;c={@name}">  
-		<xsl:value-of select="displayItem[@name='name']"/>
-	      </a>
-	    </xsl:otherwise>
-	  </xsl:choose>         
-	  
-	</li>
-      </xsl:for-each> 
-    </ul>
-  </xsl:template> 
-  
-  <xsl:template match="serviceClusterList">
-    <xsl:for-each select="serviceCluster"> 
-      <a href="{$library_name}?a=p&amp;sa=about&amp;c={@name}"><xsl:value-of select='@name'/><xsl:value-of select="displayItem[@name='name']"/></a>
-    </xsl:for-each>
-  </xsl:template>
-
-  <xsl:template match="service[@name='TextQuery']">
-    <div class="QuickSearch">
-      <form name="QuickSearch" method="get" action="{$library_name}">
-	<input type="hidden" name="a" value="q"/>
-	<input type="hidden" name="rt" value="rd"/>
-	<input type="hidden" name="s" value="{@name}"/>
-	<input type="hidden" name="s1.collection" value="all"/>
-	<input type="text" name="s1.query" size="20"/>
-	<input type="submit"><xsl:attribute name="value"><xsl:value-of select="util:getInterfaceText($interface_name, /page/@lang, 'home.quick_search')"/></xsl:attribute></input>
-      </form>
-    </div>
-  </xsl:template>
-
-  <xsl:template match="serviceList">
-    <xsl:call-template name="dividerBar"/>
-    <ul id="servicelist">
-      <xsl:for-each select="service[@type='query']">
-	<li><a href="{$library_name}?a=q&amp;rt=d&amp;s={@name}"><xsl:value-of select="displayItem[@name='name']"/></a><xsl:value-of select="displayItem[@name='description']"/></li>
-      </xsl:for-each>
-      <!--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>      </xsl:for-each>-->
-      <!--uncomment to display a library interface link-->
-      <!--<li><a href="{$library_name}?a=p&amp;sa=gli4gs3"><xsl:value-of select="util:getInterfaceText($interface_name, /page/@lang, 'home.librarian_interface')"/></a></li>-->
-    </ul>
+	
+	
   </xsl:template>
 </xsl:stylesheet>  
Index: /greenstone3/trunk/web/interfaces/default/transform/library.xsl
===================================================================
--- /greenstone3/trunk/web/interfaces/default/transform/library.xsl	(revision 18481)
+++ /greenstone3/trunk/web/interfaces/default/transform/library.xsl	(revision 18482)
@@ -2,112 +2,20 @@
 
 <xsl:stylesheet version="1.0" 
-xmlns:xsl="http://www.w3.org/1999/XSL/Transform" 
-xmlns:gslib="http://www.greenstone.org/XSL/Library"
-exclude-result-prefixes="xalan gslib gsf xslt">
+	xmlns:xsl="http://www.w3.org/1999/XSL/Transform" 
+	xmlns:gslib="http://www.greenstone.org/XSL/Library"
+	exclude-result-prefixes="util xalan gslib gsf xslt">
 
 
-<xsl:output method="html" 
-doctype-public="-//W3C//DTD HTML 4.01 Transitional//EN" 
-doctype-system="http://www.w3.org/TR/html4/loose.dtd"
-/>
+<xsl:output
+	method="html" 
+	doctype-public="-//W3C//DTD HTML 4.01 Transitional//EN" 
+	doctype-system="http://www.w3.org/TR/html4/loose.dtd"/>
+
+	
+<!--Load the Greenstone Utility file that contains all the code needed to expand all GSLib elements-->
+<xsl:include href="util.xsl"/>
 
 
 
-	<!-- some global parameters - these are set by whoever is invoking the transformation -->
-  <xsl:param name="interface_name"/>
-  <xsl:param name="library_name"/>
-  
-  <!-- every pages ....................................................................... -->
-  
-  	<xsl:variable name="a"><xsl:value-of select="/page/pageRequest/paramList/param[@name='a']/@value"/></xsl:variable>
-	<xsl:variable name="collections" select="/page/pageResponse/collectionList/collection"/>
-  
-    <xsl:template name="GS2LibDividerBar">
-   <xsl:param name='text'/>
-      <xsl:choose>
-      <xsl:when test="$text">
-	 <div class="divbar"><xsl:value-of select="$text"/></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 match="error">
-    Error: <xsl:value-of select="."/>
-  </xsl:template>
-  
-	<!-- site home ....................................................................... -->
-
-
-<xsl:template name="pageTitleLanguageDependant">
- <!-- put a space in the title in case the actual value is missing - mozilla will not display a page with no title-->
-<xsl:value-of select="util:getInterfaceText($interface_name, /page/@lang, 'gsdl')"/><xsl:text> </xsl:text>
-</xsl:template>
-
-
-<xsl:template name="greenstoneLogoAlternateText">
-<xsl:value-of select="util:getInterfaceText($interface_name, /page/@lang, 'gsdl')"/>
-</xsl:template>
-
-
-<xsl:template name="collectionLinkWithImage">
-               <xsl:choose>
-              <xsl:when test="displayItem[@name='icon']">
-			  <a href="{$library_name}?a=p&amp;amp;sa=about&amp;amp;c={@name}">
-                <img>
-	           <xsl:attribute name="src">
-	             <xsl:value-of select="metadataList/metadata[@name='httpPath']"/>/images/<xsl:value-of select="displayItem[@name='icon']"/>
-	           </xsl:attribute>
-	           <xsl:attribute name="alt">
-	                <xsl:value-of select="displayItem[@name='name']"/>
-	           </xsl:attribute>
-	         </img> 
-               </a>  
-	      </xsl:when>
-              <xsl:otherwise>
-               <a class="noimage" href="{$library_name}?a=p&amp;amp;sa=about&amp;amp;c={@name}">  
-                 <xsl:value-of select="displayItem[@name='name']"/>
-               </a>
-              </xsl:otherwise>
-           </xsl:choose> 
-</xsl:template>
-
-
-  	<xsl:template name="quickSearchForm">
-    <form name="QuickSearch" method="get" action="{$library_name}">
-	<input type="hidden" name="a" value="q"/>
-	<input type="hidden" name="rt" value="rd"/>
-	<input type="hidden" name="s" value="{/page/pageResponse/serviceList/service[@name='TextQuery']/@name}"/>
-	<input type="hidden" name="s1.collection" value="all"/>
-	<input type="text" name="s1.query" size="20"/>
-	<input type="submit" value="Quick Search"/>
-    </form>
-	</xsl:template>
-	
-	
-	  <xsl:template match="serviceClusterList">
-    <xsl:for-each select="serviceCluster"> 
-      <a href="{$library_name}?a=p&amp;amp;sa=about&amp;amp;c={@name}"><xsl:value-of select='@name'/><xsl:value-of select="displayItem[@name='name']"/></a>
-    </xsl:for-each>
-  </xsl:template>
-  
-    <xsl:template name="test" match="pageResponse/serviceList">
-      <xsl:for-each select="service[@type='query']">
-      <li><a href="{$library_name}?a=q&amp;amp;rt=d&amp;amp;s={@name}"><xsl:value-of select="displayItem[@name='name']"/></a><xsl:value-of select="displayItem[@name='description']"/>
-	  </li>
-      </xsl:for-each>
-      <!--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>      </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>-->
-       </xsl:template>
-  
-  
-	<xsl:template name="poweredByGS3LanguageDependant">
-            <xsl:value-of select="util:getInterfaceText($interface_name, /page/@lang, 'gs3power')"/> 
-  </xsl:template>
 
 
Index: /greenstone3/trunk/web/interfaces/default/transform/util.xsl
===================================================================
--- /greenstone3/trunk/web/interfaces/default/transform/util.xsl	(revision 18482)
+++ /greenstone3/trunk/web/interfaces/default/transform/util.xsl	(revision 18482)
@@ -0,0 +1,172 @@
+<?xml version="1.0" encoding="UTF-8"?>
+<xsl:stylesheet version="1.0" 
+	xmlns:xsl="http://www.w3.org/1999/XSL/Transform" 
+	xmlns:gslib="http://www.greenstone.org/XSL/Library"
+	xmlns:util="http://org.greenstone.gsdl3.util.XSLTUtil"
+	exclude-result-prefixes="util gslib gsf xslt">
+
+	<!-- some global parameters - these are set by whoever is invoking the transformation -->
+  <xsl:param name="interface_name"/>
+  <xsl:param name="library_name"/>
+  
+  <!-- every pages ....................................................................... -->
+  
+  	<xsl:variable name="a"><xsl:value-of select="/page/pageRequest/paramList/param[@name='a']/@value"/>		</xsl:variable>
+	<xsl:variable name="collections" select="/page/pageResponse/collectionList/collection"/>
+	
+	
+	<xsl:template name="textDirectionAttribute">
+	<xsl:attribute name="dir"><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:attribute>
+	</xsl:template>
+  
+  
+    <xsl:template name="defaultDividerBar">
+   <xsl:param name='text'/>
+      <xsl:choose>
+      <xsl:when test="$text">
+	 <div class="divbar"><xsl:value-of select="$text"/></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 match="error">
+    Error: <xsl:value-of select="."/>
+  </xsl:template>
+  
+  
+<xsl:template name="displayErrorsIfAny">
+      <xsl:if test="descendant::error">
+      <script language="Javascript">
+	<xsl:text disable-output-escaping="yes">
+	  function removeAllChildren(node) {
+	    while (node.hasChildNodes()) {
+	      node.removeChild(node.firstChild);
+	    }
+	  }
+
+	  function toggleHideError(obj) {
+	    if (obj.style.display == "none") {
+	      obj.style.display = "";
+	      hide_link = document.getElementById("hide");
+	      removeAllChildren(hide_link);
+	      hide_link.appendChild(document.createTextNode("</xsl:text><xsl:value-of select="util:getInterfaceText($interface_name, /page/@lang, 'hide_error')"/><xsl:text disable-output-escaping="yes">"));
+	    } else {
+	      obj.style.display = "none";
+	      hide_link = document.getElementById("hide");
+	      removeAllChildren(hide_link);
+	      hide_link.appendChild(document.createTextNode("</xsl:text><xsl:value-of select="util:getInterfaceText($interface_name, /page/@lang, 'show_error')"/><xsl:text disable-output-escaping="yes">"));
+	    } 
+	  }
+	</xsl:text>
+      </script>
+      <p align='right'><a id="hide" href="javascript:toggleHideError(error);"><xsl:value-of select="util:getInterfaceText($interface_name, /page/@lang, 'show_error')"/></a></p>
+      <div id="error" style="display: none;">
+	<xsl:apply-templates select="descendant::error"/>
+      </div>
+    </xsl:if>
+</xsl:template>
+
+
+	<xsl:template name="noTextBar">
+		<xsl:text disable-output-escaping="yes">&amp;nbsp;</xsl:text>
+	</xsl:template>
+	
+	
+	<xsl:template name="poweredByGS3TextBar">
+            <xsl:value-of select="util:getInterfaceText($interface_name, /page/@lang, 'gs3power')"/> 
+  </xsl:template>
+  
+  
+	<!-- site home ....................................................................... -->
+
+<xsl:template name="homePageTitle">
+ <!-- put a space in the title in case the actual value is missing - mozilla will not display a page with no title-->
+<xsl:value-of select="util:getInterfaceText($interface_name, /page/@lang, 'gsdl')"/><xsl:text> </xsl:text>
+</xsl:template>
+
+
+    <xsl:template name="selectACollectionTextBar">
+  	 <xsl:value-of select="util:getInterfaceText($interface_name, /page/@lang, 'home.select_a_collection')"/>
+  </xsl:template>
+  
+  
+	<xsl:template name="crossCollectionQuickSearchForm">
+		<xsl:apply-templates select="serviceList/service[@name='TextQuery']"/>
+	</xsl:template> 
+	
+  <xsl:template match="service[@name='TextQuery']">
+      <form name="QuickSearch" method="get" action="{$library_name}">
+		<input type="hidden" name="a" value="q"/>
+		<input type="hidden" name="rt" value="rd"/>
+		<input type="hidden" name="s" value="{@name}"/>
+		<input type="hidden" name="s1.collection" value="all"/>
+		<input type="text" name="s1.query" size="20"/>
+		<input type="submit"><xsl:attribute name="value"><xsl:value-of select="util:getInterfaceText($interface_name, /page/@lang, 'home.quick_search')"/></xsl:attribute></input>
+      </form>
+  </xsl:template>
+  
+  
+<xsl:template name="collectionLinkWithImage">
+	  <xsl:choose>
+	    <xsl:when test="displayItem[@name='icon']">
+              <a href="{$library_name}?a=p&amp;sa=about&amp;c={@name}">
+                <img>
+		  <xsl:attribute name="src">
+		    <xsl:value-of select="metadataList/metadata[@name='httpPath']"/>/images/<xsl:value-of select="displayItem[@name='icon']"/>
+		  </xsl:attribute>
+		  <xsl:attribute name="alt">
+		    <xsl:value-of select="displayItem[@name='name']"/>
+		  </xsl:attribute>
+		</img> 
+	      </a>  
+	    </xsl:when>
+	    <xsl:otherwise>
+	      <a class="noimage" href="{$library_name}?a=p&amp;sa=about&amp;c={@name}">  
+		<xsl:value-of select="displayItem[@name='name']"/>
+	      </a>
+	    </xsl:otherwise>
+	  </xsl:choose> 
+</xsl:template>
+  
+  
+	<xsl:template name="serviceClusterList">
+		<xsl:apply-templates select="serviceClusterList"/>
+	</xsl:template> 
+	
+	  <xsl:template match="serviceClusterList">
+	    <xsl:for-each select="serviceCluster"> 
+	      <a href="{$library_name}?a=p&amp;sa=about&amp;c={@name}"><xsl:value-of select='@name'/><xsl:value-of select="displayItem[@name='name']"/></a>
+	    </xsl:for-each>
+	  </xsl:template>
+
+	  
+	  <xsl:template name="serviceLink">
+	  <a href="{$library_name}?a=q&amp;rt=d&amp;s={@name}"><xsl:value-of select="displayItem[@name='name']"/></a><xsl:value-of select="displayItem[@name='description']"/>
+	  </xsl:template>
+
+	  
+   <xsl:template name="authenticationLink">
+   <xsl:for-each select="serviceList/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></xsl:for-each>
+  </xsl:template> 
+  
+  
+   <xsl:template name="libraryInterfaceLink">
+   <li><a href="{$library_name}?a=p&amp;sa=gli4gs3"><xsl:value-of select="util:getInterfaceText($interface_name, /page/@lang, 'home.librarian_interface')"/></a></li>
+  </xsl:template> 
+  
+  
+<xsl:template name="greenstoneLogoAlternateText">
+<xsl:value-of select="util:getInterfaceText($interface_name, /page/@lang, 'gsdl')"/>
+</xsl:template>
+
+<!-- about page - collection home ....................................................................... -->
+
+
+
+
+</xsl:stylesheet>
