Index: main/trunk/greenstone3/web/interfaces/oran/js/classifier_scripts.js
===================================================================
--- main/trunk/greenstone3/web/interfaces/oran/js/classifier_scripts.js	(revision 24520)
+++ main/trunk/greenstone3/web/interfaces/oran/js/classifier_scripts.js	(revision 24520)
@@ -0,0 +1,171 @@
+var inProgress = new Array();
+var openClassifiers = new Array();
+var busy = false;
+
+function isExpanded(sectionID)
+{
+	var divElem = document.getElementById("div" + sectionID);
+	if(!divElem.style.display || divElem.style.display == "block")
+	{
+		return true;
+	}
+	return false;
+}
+
+function toggleSection(sectionID)
+{
+	var section = document.getElementById("div" + sectionID);
+	var sectionToggle = document.getElementById("toggle" + sectionID);
+	
+	if(sectionToggle == undefined)
+	{
+		return;
+	}
+	
+	if(section)
+	{
+		if(isExpanded(sectionID))
+		{
+			section.style.display = "none";
+			sectionToggle.setAttribute("src", gs.imageURLs.expand);
+			
+			if(openClassifiers[sectionID] != undefined)
+			{
+				delete openClassifiers[sectionID];
+			}
+		}
+		else
+		{
+			section.style.display = "block";
+			sectionToggle.setAttribute("src", gs.imageURLs.collapse);
+			openClassifiers[sectionID] = true;	
+		}
+		updateOpenClassifiers();
+	}
+	else
+	{
+		httpRequest(sectionID);
+	}
+}
+
+function updateOpenClassifiers()
+{
+	var oc = "";
+	var first = true;
+	for(var key in openClassifiers)
+	{
+		if(first)
+		{
+			first = false;
+		}
+		else
+		{
+			oc += ",";
+		}
+		
+		oc += key;
+	}
+	
+	if(oc != undefined)
+	{
+		window.location.hash = oc;
+	}
+}
+
+function openStoredClassifiers()
+{
+	if(window.location.hash != undefined && window.location.hash.length > 1)
+	{
+		var toOpen = window.location.hash.substring(1,window.location.hash.length).split(",");
+		var loopFunction = function(sectionArray, index)
+		{
+			if(!busy && index < sectionArray.length)
+			{
+				busy = true;
+				toggleSection(sectionArray[index]);
+				setTimeout(function()
+				{
+					loopFunction(sectionArray, index + 1);
+				}, 50);
+				
+				return true
+			}
+			
+			setTimeout(function()
+			{
+				loopFunction(sectionArray, index);
+			}, 50);
+			return false;
+		}
+		
+		if(toOpen.length > 0)
+		{
+			loopFunction(toOpen, 0);
+		}
+	}
+}
+
+function httpRequest(sectionID)
+{
+	if(!inProgress[sectionID])
+	{
+		inProgress[sectionID] = true;
+		var httpRequest;
+		if (window.XMLHttpRequest) {
+			httpRequest = new XMLHttpRequest();
+		}
+		else if (window.ActiveXObject) {
+			httpRequest = new ActiveXObject("Microsoft.XMLHTTP");
+		}
+		
+		var sectionToggle = document.getElementById("toggle" + sectionID);
+		sectionToggle.setAttribute("src", gs.imageURLs.loading);
+
+		var url = document.URL;
+		url = url.replace(/(&|\?)cl=[a-z\.0-9]+/gi, "$1cl=" + sectionID + "&excerptid=div" + sectionID);
+
+		if(gs.cgiParams.berryBasket == "on")
+		{
+			url = url + "&berrybasket=on";
+		}
+
+		httpRequest.open('GET', url, true);
+		httpRequest.onreadystatechange = function() 
+		{
+			if (httpRequest.readyState == 4) 
+			{
+				if (httpRequest.status == 200) 
+				{
+					var newDiv = document.createElement("div");										
+					var sibling = document.getElementById("title" + sectionID);
+					var parent = sibling.parentNode;
+					if(sibling.nextSibling)
+					{
+						parent.insertBefore(newDiv, sibling.nextSibling);
+					}
+					else
+					{
+						parent.appendChild(newDiv);
+					}
+					
+					newDiv.innerHTML = httpRequest.responseText;
+					sectionToggle.setAttribute("src", gs.imageURLs.collapse);
+					openClassifiers[sectionID] = true;	
+					
+					if(gs.cgiParams.berryBasket == "on")
+					{
+						checkout();
+					}
+					updateOpenClassifiers();
+				}
+				else
+				{
+					sectionToggle.setAttribute("src", gs.imageURLs.expand);
+				}
+				inProgress[sectionID] = false;
+				busy = false;
+			}
+		}
+		httpRequest.send();
+	}
+}
Index: main/trunk/greenstone3/web/interfaces/oran/transform/classifiertools.xsl
===================================================================
--- main/trunk/greenstone3/web/interfaces/oran/transform/classifiertools.xsl	(revision 24512)
+++ main/trunk/greenstone3/web/interfaces/oran/transform/classifiertools.xsl	(revision 24520)
@@ -81,5 +81,5 @@
       <xsl:choose>
 	<xsl:when test="name()='documentNode'">
-	  <td><table><tr>
+	  <td><table id="div{@nodeID}"><tr>
 		<xsl:call-template name="documentNodeWrapper">
 		  <xsl:with-param name='collName' select='$collName'/>
@@ -90,5 +90,12 @@
 	</xsl:when>
 	<xsl:otherwise>
-	  <td><table><tr>
+	  <td><table id="title{@nodeID}"><tr>
+		<td class="headerTD">
+			<img id="toggle{@nodeID}" onclick="toggleSection('{@nodeID}');" class="icon">			
+				<xsl:attribute name="src">
+					<xsl:value-of select="util:getInterfaceText($interface_name, /page/@lang, 'expand_image')"/>
+				</xsl:attribute>
+			</img>
+		</td>
 		<xsl:apply-templates select='.'>
 		  <xsl:with-param name='collName' select='$collName'/>
@@ -99,5 +106,5 @@
 	  <xsl:if test="child::classifierNode or child::documentNode">
 	    <!--recurse into the children-->
-	    <tr><td><table class="childrenlist">
+	    <tr><td><table class="childrenlist" id="div{@nodeID}">
 		<xsl:apply-templates select='.' mode='process-all-children'>
 		  <xsl:with-param name='collName' select='$collName'/>
Index: main/trunk/greenstone3/web/interfaces/oran/transform/javascript-global-setup.xsl
===================================================================
--- main/trunk/greenstone3/web/interfaces/oran/transform/javascript-global-setup.xsl	(revision 24512)
+++ main/trunk/greenstone3/web/interfaces/oran/transform/javascript-global-setup.xsl	(revision 24520)
@@ -11,4 +11,5 @@
 			gs = new Array();
 			gs.cgiParams = new Array();
+			gs.xsltParams = new Array();
 			gs.siteMetadata = new Array();
 			gs.collectionMetadata = new Array();
@@ -18,4 +19,5 @@
 		</script>
 		<xsl:call-template name="populate-cgi-param-values"/>
+		<xsl:call-template name="populate-xslt-param-values"/>
 		<xsl:call-template name="populate-image-url-values"/>
 		<xsl:call-template name="populate-metadata-values"/>
@@ -32,4 +34,11 @@
 				gs.cgiParams[name] = value;
 			</xsl:for-each>
+		</script>
+	</xsl:template>
+	
+	<xsl:template name="populate-xslt-param-values">
+		<script type="text/javascript">
+			<xsl:text disable-output-escaping="yes">gs.xsltParams.library_name = "</xsl:text><xsl:value-of select="$library_name"/><xsl:text disable-output-escaping="yes">";</xsl:text>
+			<xsl:text disable-output-escaping="yes">gs.xsltParams.interface_name = "</xsl:text><xsl:value-of select="$interface_name"/><xsl:text disable-output-escaping="yes">";</xsl:text>
 		</script>
 	</xsl:template>
Index: main/trunk/greenstone3/web/interfaces/oran/transform/pages/classifier.xsl
===================================================================
--- main/trunk/greenstone3/web/interfaces/oran/transform/pages/classifier.xsl	(revision 24512)
+++ main/trunk/greenstone3/web/interfaces/oran/transform/pages/classifier.xsl	(revision 24520)
@@ -20,20 +20,21 @@
 	<!-- the page content -->
 	<xsl:template match="/page/pageResponse">
-		<xsl:call-template name="classifierLoadScript"/>
-			<!-- this right sidebar -->
-			<xsl:if test="$berryBasketOn or $documentBasketOn">
-				<div id="rightSidebar">
-					<xsl:if test="$berryBasketOn">
-						<!-- show the berry basket if it's turned on -->
-						<gslib:berryBasket/>
-						<xsl:text> </xsl:text>
-					</xsl:if>
+		<script type="text/javascript" src="interfaces/{$interface_name}/js/classifier_scripts.js"><xsl:text> </xsl:text></script>
+		
+		<!-- this right sidebar -->
+		<xsl:if test="$berryBasketOn or $documentBasketOn">
+			<div id="rightSidebar">
+				<xsl:if test="$berryBasketOn">
+					<!-- show the berry basket if it's turned on -->
+					<gslib:berryBasket/>
+					<xsl:text> </xsl:text>
+				</xsl:if>
 
-					<xsl:if test="$documentBasketOn">
-						<gslib:documentBasket/>
-						<xsl:text> </xsl:text>
-					</xsl:if>
-	            </div>
-			</xsl:if>
+				<xsl:if test="$documentBasketOn">
+					<gslib:documentBasket/>
+					<xsl:text> </xsl:text>
+				</xsl:if>
+			</div>
+		</xsl:if>
 	
 		<!--
@@ -51,4 +52,5 @@
 			</xsl:apply-templates>
 		</div>
+		<script type="text/javascript">openStoredClassifiers();</script>
 		<div class="clear"><xsl:text> </xsl:text></div>
 	</xsl:template>
@@ -58,13 +60,4 @@
 	TEMPLATE FOR DOCUMENTS
 	-->
-
-    <!--<xsl:template match="documentNode" priority="3">-->
-        <!-- show the document details -->
-        <!--<li class="document">
-            <a>
-                <xsl:attribute name="href"><xsl:value-of select="$library_name"/>?a=d&amp;c=<xsl:value-of select="/page/pageResponse/collection/@name"/>&amp;d=<xsl:value-of select="@nodeID"/>&amp;dt=<xsl:value-of select="@docType"/>&amp;p.a=b&amp;p.s=<xsl:value-of select="/page/pageResponse/service/@name"/>&amp;ed=1</xsl:attribute><xsl:value-of disable-output-escaping="yes"  select="metadataList/metadata[@name='Title']"/>
-            </a>
-        </li>
-    </xsl:template>-->
 
 	<xsl:template match="documentNode"><!-- priority="3"-->
@@ -132,114 +125,4 @@
 		</xsl:if>
 	</xsl:template>
-	
-	<xsl:template name="classifierLoadScript">
-		<script type="text/javascript">
-			<xsl:text disable-output-escaping="yes">
-				var collapseImageURL = "</xsl:text><xsl:value-of select="util:getInterfaceText($interface_name, /page/@lang, 'collapse_image')"/><xsl:text disable-output-escaping="yes">";
-				var expandImageURL = "</xsl:text><xsl:value-of select="util:getInterfaceText($interface_name, /page/@lang, 'expand_image')"/><xsl:text disable-output-escaping="yes">";
-				var loadingImageURL = "</xsl:text><xsl:value-of select="util:getInterfaceText($interface_name, /page/@lang, 'loading_image')"/><xsl:text disable-output-escaping="yes">";
-				var berryBaskets = "</xsl:text><xsl:value-of select="/page/pageRequest/paramList/param[@name='berrybasket']/@value"/><xsl:text disable-output-escaping="yes">";
-				var inProgress = new Array();
-			
-				function isExpanded(sectionID)
-				{
-					var divElem = document.getElementById("div" + sectionID);
-					if(!divElem.style.display || divElem.style.display == "block")
-					{
-						return true;
-					}
-					return false;
-				}
-			
-				function toggleSection(sectionID)
-				{
-					var section = document.getElementById("div" + sectionID);
-					var sectionToggle = document.getElementById("toggle" + sectionID);
-					
-					if(section)
-					{
-						if(isExpanded(sectionID))
-						{
-							section.style.display = "none";
-							sectionToggle.setAttribute("src", expandImageURL);
-						}
-						else
-						{
-							section.style.display = "block";
-							sectionToggle.setAttribute("src", collapseImageURL);
-						}
-					}
-					else
-					{
-						httpRequest(sectionID);
-					}
-				}
-				
-				function httpRequest(sectionID)
-				{
-					if(!inProgress[sectionID])
-					{
-						inProgress[sectionID] = true;
-						var httpRequest;
-						if (window.XMLHttpRequest) {
-							httpRequest = new XMLHttpRequest();
-						}
-						else if (window.ActiveXObject) {
-							httpRequest = new ActiveXObject("Microsoft.XMLHTTP");
-						}
-						
-						var sectionToggle = document.getElementById("toggle" + sectionID);
-						sectionToggle.setAttribute("src", loadingImageURL);
-
-						var url = document.URL;
-						url = url.replace(/(&amp;|\?)cl=[a-z\.0-9]+/gi, "$1cl=" + sectionID + "&amp;excerptid=div" + sectionID);
-			
-						if(berryBaskets == "on")
-						{
-							url = url + "&amp;berrybasket=on";
-						}
-
-						httpRequest.open('GET', url, true);
-						httpRequest.onreadystatechange = function() 
-						{
-							if (httpRequest.readyState == 4) 
-							{
-								if (httpRequest.status == 200) 
-								{
-									var newDiv = document.createElement("div");			
-									var sibling = document.getElementById("title" + sectionID);
-									var parent = sibling.parentNode;
-									
-									if(sibling.nextSibling)
-									{
-										parent.insertBefore(newDiv, sibling.nextSibling);
-									}
-									else
-									{
-										parent.appendChild(newDiv);
-									}
-									
-									newDiv.innerHTML = httpRequest.responseText;
-									sectionToggle.setAttribute("src", collapseImageURL);
-									
-									if(berryBaskets == "on")
-									{
-										checkout();
-									}
-								}
-								else
-								{
-									sectionToggle.setAttribute("src", expandImageURL);
-								}
-								inProgress[sectionID] = false;
-							}
-						}
-						httpRequest.send();
-					}
-				}
-			</xsl:text>
-		</script>
-	</xsl:template>
-
 </xsl:stylesheet>
 
Index: main/trunk/greenstone3/web/interfaces/oran/transform/pages/pref.xsl
===================================================================
--- main/trunk/greenstone3/web/interfaces/oran/transform/pages/pref.xsl	(revision 24512)
+++ main/trunk/greenstone3/web/interfaces/oran/transform/pages/pref.xsl	(revision 24520)
@@ -182,5 +182,5 @@
 				<div id="documentmakerprefs">
 					<xsl:variable name="documentbasket"><xsl:choose><xsl:when test="/page/pageRequest/paramList/param[@name='documentbasket']"><xsl:value-of select="/page/pageRequest/paramList/param[@name='documentbasket']/@value"/></xsl:when><xsl:otherwise>off</xsl:otherwise></xsl:choose></xsl:variable>
-					<div class="paramLabel">Document Maker</div>
+					<div class="paramLabel">Document basket</div>
 					<div class="paramValue">
 						<select name="documentbasket">
