Index: main/trunk/greenstone3/web/interfaces/default/transform/gslib.xsl
===================================================================
--- main/trunk/greenstone3/web/interfaces/default/transform/gslib.xsl	(revision 33260)
+++ main/trunk/greenstone3/web/interfaces/default/transform/gslib.xsl	(revision 33261)
@@ -28,4 +28,7 @@
 
   <xsl:variable name="berry_icon">berry.png</xsl:variable>
+  <xsl:variable name="unselected_favourite_icon">favourite-star-transparent-unselected32.png</xsl:variable>
+  <xsl:variable name="selected_favourite_icon">favourite-star-transparent-selected32.png</xsl:variable>
+
   <!-- every pages ....................................................................... -->
 
@@ -54,6 +57,10 @@
     <xsl:value-of select="/page/pageRequest/paramList/param[@name='berrybasket']/@value"/>
   </xsl:variable>
+  <xsl:variable name="favouritesbasketswitch">
+    <xsl:value-of select="/page/pageRequest/paramList/param[@name='favouritesbasket']/@value"/>
+  </xsl:variable>
   
   <xsl:variable name="berryBasketOn" select="/page/pageRequest/paramList/param[@name='berrybasket' and @value='on']"/>
+  <xsl:variable name="favouritesBasketOn" select="/page/pageRequest/paramList/param[@name='favouritesbasket' and @value='on']"/>
   <xsl:variable name="documentBasketOn" select="/page/pageRequest/paramList/param[@name='documentbasket' and @value='on']"/>
   
@@ -750,4 +757,45 @@
   </xsl:template>
   
+  <!--
+      Goto Favourites Template
+      This gets used on many different pages to add the
+      goto favourites check-out functionality to the site
+  -->
+  <xsl:template name="gotoFavourites">
+    <xsl:if test="$favouritesBasketOn">
+      <div id="berrybasket" class="hide">
+      <img src="interfaces/{$interface_name}/images/{$selected_favourite_icon}" title="click to add to favourites" width="16" height="16" border="0" />
+        <span><xsl:value-of select="util:getInterfaceText($interface_name, /page/@lang, 'favourites.title')"/><xsl:text> </xsl:text></span>
+	<span id="favouritesCountDisplay">...</span>
+
+	<div><a id="favouritesFullViewLink" style="display: block;"><xsl:value-of select="util:getInterfaceText($interface_name, /page/@lang, 'berry.full')"/></a></div>
+      </div>
+      <gsf:script>
+	//set url and show full view link
+        var fullView = YAHOO.util.Dom.get('favouritesFullViewLink');
+	//Find the collection in the cgi parameters
+	var url = window.location.href;
+	var colstart = url.indexOf("&amp;c=");
+	var collectionName = "";
+	if (colstart != -1)
+	{
+		var colend = url.indexOf("&amp;", (colstart + 1));
+		if (colend == -1)
+		{
+			colend = url.length - 1;
+		}
+		collectionName = url.substring(colstart + 3, colend);
+	}
+	
+	fullView.setAttribute("href",gs.xsltParams.library_name + "?a=g&amp;sa=berry&amp;c=&amp;s=DisplayList&amp;rt=r&amp;p.c=" + collectionName);
+        fullView.style.display='block';
+
+      </gsf:script>
+    </xsl:if>
+  </xsl:template>
+  
+
+
+
 	<!-- put the drag&drop document basket on the page -->
 	<xsl:template name="documentBasket">
@@ -777,5 +825,5 @@
   
   <!-- include the required javascript and css for berry baskets -->
-  <xsl:template name="berryBasketHeadTags">
+  <xsl:template name="basketHeadTags">
     <script type="text/javascript" src="interfaces/{$interface_name}/js/yui/yahoo-min.js"><xsl:text> </xsl:text></script>
     <script type="text/javascript" src="interfaces/{$interface_name}/js/yui/event-min.js"><xsl:text> </xsl:text></script>
@@ -815,4 +863,16 @@
     <xsl:if test="$berryBasketOn">
       <img class="pick" src="interfaces/{$interface_name}/images/{$berry_icon}" alt="in basket" width="15" height="15" border="0">
+        <xsl:attribute name="id"><xsl:value-of select="/page/pageResponse/collection/@name"/>:<xsl:value-of select="@nodeID"/></xsl:attribute>
+      </img>
+    </xsl:if>
+  </xsl:template>
+
+  <xsl:template name="documentFavouriteForClassifierOrSearchPage">
+
+    <gsf:variable name="selected_favourite_icon_url">interfaces/<xsl:value-of select="$interface_name"/>/images/<xsl:value-of select="$selected_favourite_icon"/></gsf:variable>
+    <gsf:variable name="unselected_favourite_icon_url">interfaces/<xsl:value-of select="$interface_name"/>/images/<xsl:value-of select="$unselected_favourite_icon"/></gsf:variable>
+
+    <xsl:if test="$favouritesBasketOn">
+      <img src="interfaces/{$interface_name}/images/{$unselected_favourite_icon}" title="click to add to favourites" width="20" height="20" border="0" onclick="toggleFavourite(this)" data-is-favourite="false">
         <xsl:attribute name="id"><xsl:value-of select="/page/pageResponse/collection/@name"/>:<xsl:value-of select="@nodeID"/></xsl:attribute>
       </img>
@@ -842,4 +902,23 @@
     </xsl:if>
   </xsl:template>
+
+  <xsl:template name="documentFavouriteForDocumentPage">
+    <xsl:variable name="selectedNode">
+      <xsl:value-of select="/page/pageResponse/document/@selectedNode"/>
+    </xsl:variable>
+    <xsl:variable name="rootNode">
+      <xsl:value-of select="/page/pageResponse/document/documentNode[@nodeType='root']/@nodeID"/>
+    </xsl:variable>
+    <xsl:if test="$favouritesBasketOn">
+      <div id="documentberries">
+        <img id="{/page/pageResponse/collection/@name}:{$rootNode}" src="interfaces/{$interface_name}/images/{$unselected_favourite_icon}" alt="in basket" width="15" height="15" border="0"/>
+        <span id="{/page/pageResponse/collection/@name}:{$rootNode}:root" class="documentberry">the whole document</span>
+        <!--<xsl:if test="$selectedNode != $rootNode">
+          <img id="{/page/pageResponse/collection/@name}:{$selectedNode}" src="interfaces/{$interface_name}/images/{$berry_icon}" alt="in basket" width="15" height="15" border="0"/>
+          <span id="{/page/pageResponse/collection/@name}:{$selectedNode}:section" class="documentberry">the current section</span>
+        </xsl:if>-->
+      </div>
+    </xsl:if>
+  </xsl:template>
   
   <!-- document page -->
Index: main/trunk/greenstone3/web/interfaces/default/transform/layouts/main.xsl
===================================================================
--- main/trunk/greenstone3/web/interfaces/default/transform/layouts/main.xsl	(revision 33260)
+++ main/trunk/greenstone3/web/interfaces/default/transform/layouts/main.xsl	(revision 33261)
@@ -40,5 +40,5 @@
 				<!-- ***** in header.xsl ***** -->
 				<xsl:call-template name="create-html-header"/>
-				<xsl:call-template name="berryBasketHeadTags"/>	
+				<xsl:call-template name="basketHeadTags"/>	
 			</head>
 			
Index: main/trunk/greenstone3/web/interfaces/default/transform/layouts/toc.xsl
===================================================================
--- main/trunk/greenstone3/web/interfaces/default/transform/layouts/toc.xsl	(revision 33260)
+++ main/trunk/greenstone3/web/interfaces/default/transform/layouts/toc.xsl	(revision 33261)
@@ -76,6 +76,16 @@
 				<tr><td id="tdContentsArea">
 					<div id="contentsArea">	
-						<!-- show the berry basket if it's turned on -->
-						<xsl:call-template name="berryBasket"/>
+					        <!-- showing gotoFavourites display-area takes priority over berryBaskets -->
+					        <xsl:choose>
+						  <xsl:when test="/page/pageResponse/interfaceOptions/option[@name = 'favouritesBaskets']/@value = 'true'">
+						    <!-- show the goto favourites if it's turned on -->
+						    <xsl:call-template name="gotoFavourites"/>
+						  </xsl:when>
+						  <xsl:otherwise>
+						    <!-- show the berry basket if it's turned on -->
+						    <xsl:call-template name="berryBasket"/>
+						  </xsl:otherwise>
+						</xsl:choose>
+
 						<!-- add in expand and contract document links -->
 						<xsl:call-template name="expandContractDocumentLinks"/>
Index: main/trunk/greenstone3/web/interfaces/default/transform/pages/berry.xsl
===================================================================
--- main/trunk/greenstone3/web/interfaces/default/transform/pages/berry.xsl	(revision 33260)
+++ main/trunk/greenstone3/web/interfaces/default/transform/pages/berry.xsl	(revision 33261)
@@ -5,4 +5,5 @@
 	xmlns:util="xalan://org.greenstone.gsdl3.util.XSLTUtil"
 	xmlns:gslib="http://www.greenstone.org/skinning"
+	xmlns:gsf="http://www.greenstone.org/greenstone3/schema/ConfigFormat" 
 	extension-element-prefixes="java util"
 	exclude-result-prefixes="java util">
@@ -19,4 +20,7 @@
 	<!-- the page content -->
 	<xsl:template match="/page">
+	  <gsf:variable name="selected_favourite_icon_url">interfaces/<xsl:value-of select="$interface_name"/>/images/<xsl:value-of select="$selected_favourite_icon"/></gsf:variable>
+	  <gsf:variable name="unselected_favourite_icon_url">interfaces/<xsl:value-of select="$interface_name"/>/images/<xsl:value-of select="$unselected_favourite_icon"/></gsf:variable>
+
 	  <gslib:langfrag name="berry"/>
 		<xsl:variable name="clusterName"><xsl:value-of select="/page/pageRequest/paramList/param[@name='c']/@value"/></xsl:variable>
@@ -52,10 +56,26 @@
 			<div class="clear"><xsl:text> </xsl:text></div>
 		</table>
-		<div id="delOptions">
-		<input type="checkbox" name="selall-checkbox" id="select-all-checkbox" value="select-all" onclick="toggleSelectAll(this)"><xsl:value-of select="util:getInterfaceText($interface_name, /page/@lang, 'berry.select_all')"/></input>
-		<input type="checkbox" name="delsel-checkbox" id="delete-selected-checkbox" value="delete-all" onclick="deleteSelected()"><xsl:value-of select="util:getInterfaceText($interface_name, /page/@lang, 'berry.delete_selected')"/></input>
-		<input type="checkbox" name="delall-checkbox" id="delete-all-checkbox" value="delete-all" onclick="deleteAll()"><xsl:value-of select="util:getInterfaceText($interface_name, /page/@lang, 'berry.delete_all')"/></input>
+
+		<div id="berryBasketContent"><span><xsl:text> </xsl:text></span></div>
+		
+		<div id="delOptions"> 
+
+		  <!-- showing favourites help text takes priority over berryBasket help text -->
+		  <xsl:choose>
+		    <xsl:when test="/page/pageResponse/interfaceOptions/option[@name = 'favouritesBaskets']/@value = 'true'">
+		      <xsl:value-of select="util:getInterfaceText($interface_name, /page/@lang, 'favourites.delete_help')"/> <xsl:value-of select="util:getInterfaceText($interface_name, /page/@lang, 'favourites.delete_else')"/><xsl:text>  </xsl:text>
+		    </xsl:when>
+		    <xsl:otherwise>
+		      <xsl:value-of select="util:getInterfaceText($interface_name, /page/@lang, 'berry.delete_help')"/> <xsl:value-of select="util:getInterfaceText($interface_name, /page/@lang, 'berry.delete_else')"/><xsl:text>  </xsl:text>
+		    </xsl:otherwise>
+		  </xsl:choose>
+
+		  
+		  <style> #bbdeleteallbutton:hover { background-color: #773030;}</style>
+		  <div id="bbdeleteallbutton" class="ui-button ui-widget ui-state-default ui-corner-all" 
+		       style="color: white; padding: 5px;" onclick="deleteAll()">
+		    <xsl:value-of select="util:getInterfaceText($interface_name, /page/@lang, 'berry.delete_all')"/>
+		  </div>
 		</div>
-		<div id="berryBasketContent"><span><xsl:text> </xsl:text></span></div>
 
 	</xsl:template>
Index: main/trunk/greenstone3/web/interfaces/default/transform/pages/classifier.xsl
===================================================================
--- main/trunk/greenstone3/web/interfaces/default/transform/pages/classifier.xsl	(revision 33260)
+++ main/trunk/greenstone3/web/interfaces/default/transform/pages/classifier.xsl	(revision 33261)
@@ -29,11 +29,16 @@
     <script type="text/javascript" src="interfaces/{$interface_name}/js/classifier_scripts.js"><xsl:text> </xsl:text></script>
     <script type="text/javascript">$(window).load(openStoredClassifiers);</script>
-    
     <!-- this right sidebar -->
-    <xsl:if test="$berryBasketOn or ($documentBasketOn and (util:contains(/page/pageRequest/userInformation/@groups, 'administrator') or util:contains(/page/pageRequest/userInformation/@groups, 'all-collections-editor') or util:contains(/page/pageRequest/userInformation/@groups, $thisCollectionEditor)))">
+    <xsl:if test="$berryBasketOn or $favouritesBasketOn or ($documentBasketOn and (util:contains(/page/pageRequest/userInformation/@groups, 'administrator') or util:contains(/page/pageRequest/userInformation/@groups, 'all-collections-editor') or util:contains(/page/pageRequest/userInformation/@groups, $thisCollectionEditor)))">
       <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="$favouritesBasketOn">
+	  <!-- show the favourites 'basket' if it's turned on -->
+	  <gslib:gotoFavourites/>
 	  <xsl:text> </xsl:text>
 	</xsl:if>
@@ -261,7 +266,13 @@
       <xsl:with-param name="serviceName" select="$serviceName"/>
     </xsl:apply-templates>
-    <!-- The berry (optional) -->
-    <td>
-      <xsl:call-template name="documentBerryForClassifierOrSearchPage"/>
+    <!-- The berry/favourite (optional) -->
+    <td valign="top">
+      <xsl:if test="/page/pageResponse/interfaceOptions/option[@name = 'berryBaskets']/@value = 'true'">
+	<xsl:call-template name="documentBerryForClassifierOrSearchPage"/>
+      </xsl:if>
+      <xsl:if test="/page/pageResponse/interfaceOptions/option[@name = 'favouritesBaskets']/@value = 'true'">
+	<xsl:call-template name="documentFavouriteForClassifierOrSearchPage"/>
+      </xsl:if>
+
     </td>
     <xsl:call-template name="documentNodePost"/>
Index: main/trunk/greenstone3/web/interfaces/default/transform/pages/pref.xsl
===================================================================
--- main/trunk/greenstone3/web/interfaces/default/transform/pages/pref.xsl	(revision 33260)
+++ main/trunk/greenstone3/web/interfaces/default/transform/pages/pref.xsl	(revision 33261)
@@ -50,5 +50,10 @@
      <!-- <xsl:call-template name="encoding-param"/>-->
       <xsl:call-template name="format-edit-param"/>
-    <xsl:call-template name="berry-basket-param"/>
+      <xsl:if test="/page/pageResponse/interfaceOptions/option[@name = 'berryBaskets']/@value = 'true'">
+	<xsl:call-template name="berry-basket-param"/>
+      </xsl:if>
+      <xsl:if test="/page/pageResponse/interfaceOptions/option[@name = 'favouritesBaskets']/@value = 'true'">
+	<xsl:call-template name="favourites-basket-param"/>
+      </xsl:if>
     <!--<xsl:call-template name="document-maker-param"/> not working at moment-->
     <xsl:call-template name="book-param"/>
@@ -166,4 +171,22 @@
 				</div>
 </xsl:template>
+
+
+<xsl:template name="favourites-basket-param">
+				<div id="favouritesbasketprefs">
+					<xsl:variable name="favouritesbasket"><xsl:choose><xsl:when test="/page/pageRequest/paramList/param[@name='favouritesbasket']"><xsl:value-of select="/page/pageRequest/paramList/param[@name='favouritesbasket']/@value"/></xsl:when><xsl:otherwise>off</xsl:otherwise></xsl:choose></xsl:variable>
+					<div class="paramLabel">
+						<xsl:value-of select="util:getInterfaceText($interface_name, /page/@lang, 'pref.favouritesbasket')"/>
+					</div>
+					<div class="paramValue">
+						<select name="favouritesbasket">
+							<option value="on"><xsl:if test="$favouritesbasket='on'"><xsl:attribute name="selected"></xsl:attribute></xsl:if><xsl:value-of select="util:getInterfaceText($interface_name, /page/@lang, 'pref.on')"/></option> 
+							<option value="off"><xsl:if test="$favouritesbasket='off'"><xsl:attribute name="selected"></xsl:attribute></xsl:if><xsl:value-of select="util:getInterfaceText($interface_name, /page/@lang, 'pref.off')"/></option>
+						</select>
+					</div>
+					<br class="clear"/>
+				</div>
+</xsl:template>
+
 				<xsl:template name="document-maker-param">
 				<xsl:if test="/page/pageRequest/userInformation and (util:contains(/page/pageRequest/userInformation/@groups, 'administrator') or util:contains(/page/pageRequest/userInformation/@groups, 'all-collections-editor') or util:contains(/page/pageRequest/userInformation/@groups, $thisCollectionEditor))">
Index: main/trunk/greenstone3/web/interfaces/default/transform/pages/query.xsl
===================================================================
--- main/trunk/greenstone3/web/interfaces/default/transform/pages/query.xsl	(revision 33260)
+++ main/trunk/greenstone3/web/interfaces/default/transform/pages/query.xsl	(revision 33261)
@@ -59,5 +59,5 @@
 
 	<xsl:template name="displayBaskets">
-	  <xsl:if test="$berryBasketOn or ($documentBasketOn and (util:contains(/page/pageRequest/userInformation/@groups, 'administrator') or util:contains(/page/pageRequest/userInformation/@groups, 'all-collections-editor') or util:contains(/page/pageRequest/userInformation/@groups, $thisCollectionEditor)))">
+	  <xsl:if test="$berryBasketOn or $favouritesBasketOn or ($documentBasketOn and (util:contains(/page/pageRequest/userInformation/@groups, 'administrator') or util:contains(/page/pageRequest/userInformation/@groups, 'all-collections-editor') or util:contains(/page/pageRequest/userInformation/@groups, $thisCollectionEditor)))">
 	    <div id="rightSidebar">
 	      <xsl:if test="$berryBasketOn">
@@ -66,4 +66,11 @@
 		<xsl:text> </xsl:text>
 	      </xsl:if>
+
+	      <xsl:if test="$favouritesBasketOn">
+		<!-- show the favourites 'basket' if it's turned on -->
+		<gslib:gotoFavourites/>
+		<xsl:text> </xsl:text>
+	      </xsl:if>
+
 	      <xsl:if test="$documentBasketOn and (util:contains(/page/pageRequest/userInformation/@groups, 'administrator') or util:contains(/page/pageRequest/userInformation/@groups, 'all-collections-editor') or util:contains(/page/pageRequest/userInformation/@groups, $thisCollectionEditor))">
 		<gslib:documentBasket/>
@@ -86,7 +93,12 @@
 					<tr id="div{@nodeID}" class="document">
 						<xsl:apply-templates select="."/>
-						<!-- The berry (optional) -->
-						<td>
-						  <xsl:call-template name="documentBerryForClassifierOrSearchPage"/>
+						<!-- The berry/favourite (optional) -->
+						<td valign="top">
+						  <xsl:if test="/page/pageResponse/interfaceOptions/option[@name = 'berryBaskets']/@value = 'true'">
+						    <xsl:call-template name="documentBerryForClassifierOrSearchPage"/>
+						  </xsl:if>
+						  <xsl:if test="/page/pageResponse/interfaceOptions/option[@name = 'favouritesBaskets']/@value = 'true'">
+						    <xsl:call-template name="documentFavouriteForClassifierOrSearchPage"/>
+						  </xsl:if>
 						</td>
 						<xsl:call-template name="highlightSnippet">
