Index: /main/trunk/greenstone3/src/java/org/greenstone/gsdl3/LibraryServlet.java
===================================================================
--- /main/trunk/greenstone3/src/java/org/greenstone/gsdl3/LibraryServlet.java	(revision 23967)
+++ /main/trunk/greenstone3/src/java/org/greenstone/gsdl3/LibraryServlet.java	(revision 23968)
@@ -633,6 +633,15 @@
 		    if (href.indexOf("?")!=-1) {
 		      String[] parts = StringUtils.split(href, "\\?", -1);
-		      parts[1] = StringUtils.replace(parts[1], ":", "%3A");
-		      href = parts[0]+"?"+parts[1];
+			  if (parts.length == 1)
+			  {
+				parts[0] = StringUtils.replace(parts[0], ":", "%3A");
+				href = "?"+parts[0];
+			  }
+			  else
+			  {
+				parts[1] = StringUtils.replace(parts[1], ":", "%3A");
+				href = parts[0]+"?"+parts[1];
+			  }
+		      
 		    }
 		    a.setAttribute("href", response.encodeURL(href));
Index: /main/trunk/greenstone3/src/java/org/greenstone/gsdl3/collection/Collection.java
===================================================================
--- /main/trunk/greenstone3/src/java/org/greenstone/gsdl3/collection/Collection.java	(revision 23967)
+++ /main/trunk/greenstone3/src/java/org/greenstone/gsdl3/collection/Collection.java	(revision 23968)
@@ -223,8 +223,8 @@
         addPlugins(plugin_list);
         if (plugin_list != null){
-          Element plugin_elem = (Element)GSXML.getNamedElement(plugin_list, GSXML.PLUGIN_ELEM, GSXML.NAME_ATT, "HTMLPlug");
+          Element plugin_elem = (Element)GSXML.getNamedElement(plugin_list, GSXML.PLUGIN_ELEM, GSXML.NAME_ATT, "HTMLPlugin");
           if (plugin_elem != null) {
             //get the option
-            Element option_elem = (Element)GSXML.getNamedElement(plugin_elem, GSXML.PARAM_OPTION_ELEM, GSXML.NAME_ATT, "-tidy_html");
+            Element option_elem = (Element)GSXML.getNamedElement(plugin_elem, GSXML.PARAM_OPTION_ELEM, GSXML.NAME_ATT, "-use_realistic_book");
             if (option_elem != null) {
               useBook = true;
Index: /main/trunk/greenstone3/src/java/org/greenstone/gsdl3/core/DefaultReceptionist.java
===================================================================
--- /main/trunk/greenstone3/src/java/org/greenstone/gsdl3/core/DefaultReceptionist.java	(revision 23967)
+++ /main/trunk/greenstone3/src/java/org/greenstone/gsdl3/core/DefaultReceptionist.java	(revision 23968)
@@ -52,5 +52,9 @@
 		
 		if (coll_name.equals("")) {
-			coll_name = GSXML.getNamedElement(param_list, GSXML.PARAM_ELEM, GSXML.NAME_ATT, "p.c").getAttribute(GSXML.VALUE_ATT);
+			Element pc_param = GSXML.getNamedElement(param_list, GSXML.PARAM_ELEM, GSXML.NAME_ATT, "p.c");
+			if(pc_param != null)
+			{
+				coll_name = pc_param.getAttribute(GSXML.VALUE_ATT);
+			}
 		}
 		
Index: /main/trunk/greenstone3/src/java/org/greenstone/gsdl3/core/TransformingReceptionist.java
===================================================================
--- /main/trunk/greenstone3/src/java/org/greenstone/gsdl3/core/TransformingReceptionist.java	(revision 23967)
+++ /main/trunk/greenstone3/src/java/org/greenstone/gsdl3/core/TransformingReceptionist.java	(revision 23968)
@@ -205,8 +205,13 @@
 	else if(excerptTag != null)
 	{
+		/*
         // define a list
         
 		Node selectedElement = modifyNodesByTagRecursive(transformed_page, excerptTag);
+		*/
+		
+		Node selectedElement = getNodeByTagRecursive(transformed_page, excerptTag);
 		return selectedElement;
+		
 	}
 	return transformed_page;
@@ -285,24 +290,30 @@
   protected Node transformPage(Element page) {
   	
-	 boolean allowsClientXSLT = (Boolean)config_params.get(GSConstants.ALLOW_CLIENT_SIDE_XSLT);
-	 //System.out.println("Client side transforms allowed? " + allowsClientXSLT);
-	 
-	 // Force it back to traditional
-	 if(!allowsClientXSLT)
-		config_params.put(GSConstants.INTERFACE_NAME, "traditional");
-	
-  	 Element request = (Element)GSXML.getChildByTagName(page, GSXML.PAGE_REQUEST_ELEM);
-	 String output = request.getAttribute(GSXML.OUTPUT_ATT);  	
-	 
-	 String currentInterface = (String)config_params.get(GSConstants.INTERFACE_NAME);
-	 //System.out.println("Current output mode is: " + output + ", current interface name is: " + currentInterface);
-	 
-	 if(allowsClientXSLT) {
-		 if((currentInterface.equals("default") && output.equals("html")) || output.equals("server"))
-		   // Switch the interface
-		   config_params.put(GSConstants.INTERFACE_NAME, "traditional");
-		 else if(currentInterface.equals("traditional") && !output.equals("html"))
-		   // The reverse needs to happen too
-		   config_params.put(GSConstants.INTERFACE_NAME, "default");
+	boolean allowsClientXSLT = (Boolean)config_params.get(GSConstants.ALLOW_CLIENT_SIDE_XSLT);
+	//System.out.println("Client side transforms allowed? " + allowsClientXSLT);
+
+	String currentInterface = (String)config_params.get(GSConstants.INTERFACE_NAME);
+
+	Element request = (Element)GSXML.getChildByTagName(page, GSXML.PAGE_REQUEST_ELEM);
+	String output = request.getAttribute(GSXML.OUTPUT_ATT);
+
+	//System.out.println("Current output mode is: " + output + ", current interface name is: " + currentInterface);
+
+	if(allowsClientXSLT) {
+		if(!currentInterface.endsWith(GSConstants.CLIENT_SIDE_XSLT_INTERFACE_SUFFIX) && output.equals("html"))
+		{
+			System.out.println("output is html and we are not currently using a client side version, switching");
+			// Switch the interface
+			config_params.put(GSConstants.INTERFACE_NAME, currentInterface.concat(GSConstants.CLIENT_SIDE_XSLT_INTERFACE_SUFFIX));
+		}
+		else if((currentInterface.endsWith(GSConstants.CLIENT_SIDE_XSLT_INTERFACE_SUFFIX) && !output.equals("html")) || output.equals("server"))
+		{
+			// The reverse needs to happen too
+			config_params.put(GSConstants.INTERFACE_NAME, currentInterface.substring(0, currentInterface.length() - GSConstants.CLIENT_SIDE_XSLT_INTERFACE_SUFFIX.length()));
+		}
+	}
+	else if (currentInterface.endsWith(GSConstants.CLIENT_SIDE_XSLT_INTERFACE_SUFFIX))
+	{
+		config_params.put(GSConstants.INTERFACE_NAME, currentInterface.substring(0, currentInterface.length() - GSConstants.CLIENT_SIDE_XSLT_INTERFACE_SUFFIX.length()));
 	}
   	
@@ -773,7 +784,7 @@
     String stylesheet = GSFile.stylesheetFile(GlobalProperties.getGSDL3Home(), (String)this.config_params.get(GSConstants.SITE_NAME), collection, (String)this.config_params.get(GSConstants.INTERFACE_NAME), base_interfaces, name);
     if (stylesheet==null) {
-      logger.info(" cant find stylesheet for "+name);
-    }
-    logger.error("stylesheet:"+stylesheet);
+      logger.info(" Can't find stylesheet for "+name);
+    }
+    logger.debug("Stylesheet: "+stylesheet);
     return stylesheet;
   }
Index: /main/trunk/greenstone3/src/java/org/greenstone/gsdl3/util/GSConstants.java
===================================================================
--- /main/trunk/greenstone3/src/java/org/greenstone/gsdl3/util/GSConstants.java	(revision 23967)
+++ /main/trunk/greenstone3/src/java/org/greenstone/gsdl3/util/GSConstants.java	(revision 23968)
@@ -28,4 +28,5 @@
     public static final String DEFAULT_LANG = "default_lang";
 	public static final String ALLOW_CLIENT_SIDE_XSLT = "allow_client_side_xslt";
+	public static final String CLIENT_SIDE_XSLT_INTERFACE_SUFFIX = "-client-xslt";
 
     public static final String META_RELATION_SEP = "_";
Index: /main/trunk/greenstone3/src/java/org/greenstone/gsdl3/util/GSParams.java
===================================================================
--- /main/trunk/greenstone3/src/java/org/greenstone/gsdl3/util/GSParams.java	(revision 23967)
+++ /main/trunk/greenstone3/src/java/org/greenstone/gsdl3/util/GSParams.java	(revision 23968)
@@ -50,4 +50,5 @@
     public static final String EXPAND_DOCUMENT = "ed";
     public static final String EXPAND_CONTENTS = "ec";
+	public static final String REALISTIC_BOOK = "book";
 
   // used for filtering out a piece of the final page
@@ -80,4 +81,6 @@
 	addParameter(EXPAND_DOCUMENT, false);
 	addParameter(EXPAND_CONTENTS, false);
+	addParameter(REALISTIC_BOOK, false);	
+	
  	//addParameter();
 	// ugly hack so we don't save the extlink param
Index: /main/trunk/greenstone3/src/java/org/greenstone/gsdl3/util/GSXML.java
===================================================================
--- /main/trunk/greenstone3/src/java/org/greenstone/gsdl3/util/GSXML.java	(revision 23967)
+++ /main/trunk/greenstone3/src/java/org/greenstone/gsdl3/util/GSXML.java	(revision 23968)
@@ -687,4 +687,9 @@
   public static void addParametersToList(Document owner, Element param_list,
     HashMap params) {
+	if (params == null)
+	{
+		return;
+	}
+	
     Set items = params.entrySet();
     Iterator i = items.iterator();
Index: /main/trunk/greenstone3/src/java/org/greenstone/gsdl3/util/XSLTUtil.java
===================================================================
--- /main/trunk/greenstone3/src/java/org/greenstone/gsdl3/util/XSLTUtil.java	(revision 23967)
+++ /main/trunk/greenstone3/src/java/org/greenstone/gsdl3/util/XSLTUtil.java	(revision 23968)
@@ -277,4 +277,36 @@
 	}
     
+	public static String hashToSectionId(String hashString)
+	{
+		if(hashString == null || hashString.length() == 0 || !hashString.startsWith("HASH")) {return "";}
+		
+		int firstDotIndex = hashString.indexOf(".");
+		if(firstDotIndex == -1)
+		{	
+			return "";
+		}
+		
+		String sectionString = hashString.substring(firstDotIndex + 1);
+		
+		return sectionString;
+	}
+	
+	public static String hashToDepthClass(String hashString)
+	{
+		if(hashString == null || hashString.length() == 0 || !hashString.startsWith("HASH")) {return "";}
+		
+		String sectionString = hashToSectionId(hashString);
+		
+		int count = sectionString.split("\\.").length;
+		
+		if (sectionString.equals(""))
+		{
+			return "sectionHeaderDepthTitle";
+		}
+		else 
+		{
+			return "sectionHeaderDepth" + count;
+		}
+	}
 }
 
