Index: /main/trunk/greenstone3/web/interfaces/default/js/favouritebasket/favouritebasket.js
===================================================================
--- /main/trunk/greenstone3/web/interfaces/default/js/favouritebasket/favouritebasket.js	(revision 36070)
+++ /main/trunk/greenstone3/web/interfaces/default/js/favouritebasket/favouritebasket.js	(revision 36071)
@@ -1,20 +1,14 @@
-//used to stored the current items in berrybasket, including collection name, document id and dodument title
+//used to stored the current items in basket, including collection name, document id and dodument title
 //in the format of collection:id:[title], it is updated when the page is loaded (reloaded) or the user adds
-// new items in the berry basket (see ygDDplayer.js). It is used to show the contents of the berry basket.
-
+// new items in the basket (see ygDDplayer.js). It is used to show the contents of the basket.
+
+// note we only support favourites now, not the old drag and drop berry baskets
+// berry is still used here for legacy reasons
 var berryList =  new Array();
 var show = false;
 
-// the default width and height of the berry basket
-var oldHeight=90;
-var oldWidth=140;
-var oldBg;
-
-var dd = new ygDDOnTop('berrybasket');
-dd.setHandleElId('baskethandle');
-
-var countBerries = function(callback) {
-
-    var request_type = "GET";
+
+var countFavourites = function(callback) {
+        var request_type = "GET";
     var url = gs.xsltParams.library_name + "?a=pr&rt=r&ro=1&s=ItemNum&o=XML&hhf="+makeURLComponentSafe("[{\"name\":\"Cache-Control\", \"value\":\"no-cache\"}]")+"&c=";
 
@@ -30,15 +24,10 @@
 
     YAHOO.util.Connect.asyncRequest(request_type , url , {success: responseSuccess });
-}
-
-
-var countFavourites = function(callback) { 
-    // identical AJAX call to countBerries()
-    return countBerries(callback);
-}
-
-
-// adds berries onto page
-var berryCheckout = function(){
+ 
+}
+
+
+// display selected favourites (filled-in star icon) on page
+var favouritesCheckout = function(){
 
 	if ( document.getElementById('berrybasket') == null ) return;
@@ -57,34 +46,18 @@
 		for (var i=0;i < items.length ; i++ ){
 
-			// remove berries images from if the berry basket has already contains this item
 			var itemID = items[i].getAttribute('collection')+":"+items[i].getAttribute('name');
 			var item = YAHOO.util.Dom.get(itemID);
+
 			if (item != null){
-				var parent = item.parentNode;
-				parent.removeChild(item);
-				if (parent !=null && parent.id == "documentberries"){
-					var root = YAHOO.util.Dom.get(itemID+":root");
-					var section = YAHOO.util.Dom.get(itemID+":section");
-
-					if(root!=null && root.id.indexOf(itemID) !=-1){
-						parent.removeChild(root);
-					}
-
-					if(section!=null && section.id.indexOf(itemID) !=-1){
-						parent.removeChild(section);
-					}
-				}
+			        item.src = gs.variables.selected_favourite_icon_url;
+			        item.setAttribute("data-is-favourite","true");
 			}
 			berryList[berryList.length] = items[i];
 		}
 
-		//add berryimage into the berry basket
-		updateBerryImages();
-
-		// set berries images visible
+		// set favourite images visible
 		// they are set to be invisible to prevent flickering when first loaded (see berry.css)
 
 		var berries = document.getElementsByTagName('img');
-		var berrybasket = new YAHOO.util.DDTarget('berrybasket','basket');
 
 		for (var j=0; j < berries.length; j++){
@@ -105,75 +78,4 @@
 			if (berry.className && berry.className == 'pick'){
 				berry.style.visibility = "visible";
-				new ygDDPlayer(berry.id,'basket',berryList); 
-			}
-		}
-		//updateBerryCount();
-		correctBerryExpandCollapseButtons();
-	}
-
-	var responseFailure = function(o){
-		console.error("Berry Basket GetItems AJAX call failed:" + url);
-	}
-
-	var callback = {
-		success: responseSuccess,
-		failure: responseFailure
-	}
-
-	//var date = new Date();
-	//url += "&rand=" + date.getTime();
-	YAHOO.util.Connect.asyncRequest(request_type , url , callback);
-}
-
-// display selected favourites (filled-in star icon) on page
-var favouritesCheckout = function(){
-
-	if ( document.getElementById('berrybasket') == null ) return;
-	
-	var request_type = "GET";
-    var url = gs.xsltParams.library_name + "?a=pr&rt=r&ro=1&s=ItemNum&o=XML&hhf="+makeURLComponentSafe("[{\"name\":\"Cache-Control\", \"value\":\"no-cache\"}]")+"&c=";
-
-	var responseSuccess = function(o){
-		
-		var response = o.responseXML;
-		var size = response.getElementsByTagName('size').item(0).getAttribute('value');
-
-		var items = response.getElementsByTagName('item');
-
-		berryList = new Array();
-		for (var i=0;i < items.length ; i++ ){
-
-			var itemID = items[i].getAttribute('collection')+":"+items[i].getAttribute('name');
-			var item = YAHOO.util.Dom.get(itemID);
-
-			if (item != null){
-			        item.src = gs.variables.selected_favourite_icon_url;
-			        item.setAttribute("data-is-favourite","true");
-			}
-			berryList[berryList.length] = items[i];
-		}
-
-		// set favourite images visible
-		// they are set to be invisible to prevent flickering when first loaded (see berry.css)
-
-		var berries = document.getElementsByTagName('img');
-
-		for (var j=0; j < berries.length; j++){
-			var berry = berries[j]; 
-			var parent = berry.parentNode;
-			if (parent !=null && parent.id == "documentberries"){
-				var root = YAHOO.util.Dom.get(berry.id+":root");
-				var section = YAHOO.util.Dom.get(berry.id+":section");
-				if(root!=null && root.id.indexOf(berry.id) !=-1){
-					root.style.visibility ="visible" ;
-				}
-
-				if(section!=null && section.id.indexOf(berry.id) !=-1){
-					section.style.visibility ="visible" ;
-				}
-			}
-
-			if (berry.className && berry.className == 'pick'){
-				berry.style.visibility = "visible";
 				// new ygDDPlayer(berry.id,'basket',berryList); // **** can go 
 			}
@@ -197,54 +99,4 @@
 
 
-function updateBerryImages(){
-
-	var berries = YAHOO.util.Dom.get('berries');
-	if ( berries == null ) return;
-	
-	while(berries.hasChildNodes())
-	{
-		berries.removeChild(berries.firstChild);
-	}
-	
-	for (var i =0;i < berryList.length && i<12 ; i++ ){
-		var img = document.createElement('img');
-		img.src = berry_icon;
-		berries.appendChild(img);
-	}
-
-	//show/hide the help message depending if there are berries or not
-        var help_elem = YAHOO.util.Dom.get('berryHelpMsg');
-    
-	if ( berryList.length == 0 ) {
-	    help_elem.style.display='block';
-	} else {
-	    help_elem.style.display='none';
-	}
-
-	//show the expand buttons
-	correctBerryExpandCollapseButtons();
-
-}
-
-function correctBerryExpandCollapseButtons() {
-	var bbecl = YAHOO.util.Dom.get('berryBasketExpandCollapseLinks');
-	if ( bbecl == null ) return;
-	if ( berryList.length > 0 ) {
-		YAHOO.util.Dom.get('berryBasketExpandCollapseLinks').style.display='';
-	} else {
-		YAHOO.util.Dom.get('berryBasketExpandCollapseLinks').style.display='none';
-	}
-}
-
-function updateBerryCount() {
-	var berries = YAHOO.util.Dom.get('berries');
-	var berryCountElement = YAHOO.util.Dom.get('berryBasketCount');
-	if ( berries == null || berryCountElement == null ) return;
-	if ( berryList.length == 0 ) {
-		berryCountElement.innerHTML = "empty";
-	} else {
-		berryCountElement.innerHTML = berryList.length;
-	}
-}
 
 function updateFavouritesCount() {
@@ -258,246 +110,4 @@
 }
 
-function basketUpdate(e) {
-
-	var target = e.target;
-	if ((target.id.toLowerCase() == 'berrybasket' || target.id.toLowerCase() == 'berries') && !show){
-		showBasket();
-		show = true;
-	}else{
-		if (target.id.toLowerCase() == 'hideview' && show){
-			hideBasket();
-			show = false;
-		}
-	}
-
-	if (target.className == 'pick'){
-		addBerry(target);
-	}
-}
-
-function showBasket() {
-
-	var berryBasket = YAHOO.util.Dom.get('berrybasket');
-	var basketHandle = YAHOO.util.Dom.get('baskethandle');
-	var berries = YAHOO.util.Dom.get('berries');
-	var width = 500;
-	var height = 40;
-	var i=0;
-
-	//remove berryImages in the berry basket
-	while (berries.hasChildNodes()) {
-		berries.removeChild(berries.firstChild);
-	}
-	while (basketHandle.hasChildNodes()) {
-		basketHandle.removeChild(basketHandle.firstChild);
-	}
-	
-	var div = document.createElement('div');
-	berries.appendChild(div);
-	var list = document.createElement('ol');
-	div.appendChild(list);
-	
-	list.id = 'doclist';
-
-	//put the berries in
-	for (i; i < berryList.length; i++){
-		var berryItem = berryList[i];
-		var berryElement = document.createElement('li');
-		list.appendChild(berryElement);
-	   
-                var title = berryTitle(berryItem);   
-		berryElement.setAttribute("class","berryitem");
-		berryElement.setAttribute("title",title);
-		berryElement.innerHTML = title; 
-		height +=40;
-	}
-
-	oldHeight = berryBasket.style.height;
-	oldWidth = berryBasket.style.width;
-	oldBg = berryBasket.style.background;
-
-	berryBasket.style.background ='url("interfaces/default/images/kete2.png") 0 0 repeat';
-	berryBasket.style.cursor = "default";
-	berryBasket.className = "show";
-
-	//set url and show full view link
-        var fullView = YAHOO.util.Dom.get('berryFullViewLink');
-	//Find the collection in the cgi parameters
-	var url = window.location.href;
-	var colstart = url.indexOf("&c=");
-	var collectionName = "";
-	if (colstart != -1)
-	{
-		var colend = url.indexOf("&", (colstart + 1));
-		if (colend == -1)
-		{
-			colend = url.length - 1;
-		}
-		collectionName = url.substring(colstart + 3, colend);
-	}
-	
-	fullView.setAttribute("href",gs.xsltParams.library_name + "?a=g&sa=berry&c=&s=DisplayList&rt=r&p.c=" + collectionName);
-        fullView.style.display='block';
-
-	//toggle expand/collapse links
-	var expandLink = YAHOO.util.Dom.get('berryBasketExpandLink');
-	var collapseLink = YAHOO.util.Dom.get('berryBasketCollapseLink');
-	if ( expandLink != null && collapseLink != null ) {
-		expandLink.style.display = 'none';
-		collapseLink.style.display = '';
-	}
-
-}
-
-function berryTitle(berryItem) {
-
-    var title = berryItem.getAttribute('Title');                    
-    var root_title = berryItem.getAttribute('root_Title');          
-    //var id = berryItem.getAttribute('collection')+":"+berryItem.getAttribute('name');                                                            
-    
-    if (root_title != null){                                        
-        title = root_title+":"+title;                               
-    }                                                               
-    title += " ("+berryItem.getAttribute('collection')+")";         
-    if (title.length > 76){                                         
-        title = title.substring(0,30)+" ... "+title.substr(title.length-45,45);                                                                
-    }                                                               
-
-    return title;
-}
-
-function hideBasket() {
-	var i = 0;
-	var berryBasket = YAHOO.util.Dom.get('berrybasket');
-	var basketHandle = YAHOO.util.Dom.get('baskethandle');
-	var berries = YAHOO.util.Dom.get('berries');
-	berryBasket.style.height = oldHeight;
-	berryBasket.style.width = oldWidth;
-	berryBasket.style.background = oldBg;
-	berryBasket.style.cursor = "pointer";
-	berryBasket.className = "hide";
-
-	while (berries.hasChildNodes()) {
-		berries.removeChild(berries.firstChild);
-	}
-
-	while (basketHandle.hasChildNodes()) {
-		basketHandle.removeChild(basketHandle.firstChild);
-	}
-
-	updateBerryImages();
-	//updateBerryCount();
-
-	//toggle expand/collapse links
-	var expandLink = YAHOO.util.Dom.get('berryBasketExpandLink');
-	var collapseLink = YAHOO.util.Dom.get('berryBasketCollapseLink');
-	if ( expandLink != null && collapseLink != null ) {
-		expandLink.style.display = '';
-		collapseLink.style.display = 'none';
-	}
-    // hide full view link
-	var fullView = YAHOO.util.Dom.get('berryFullViewLink');
-    fullView.style.display='none';
-}
-
-
-function addBerry(el){
-    var addurl = gs.xsltParams.library_name + "?a=pr&rt=r&ro=1&s=AddItem&c=&s1.id=2&o=XML&hhf="+makeURLComponentSafe("[{\"name\":\"Cache-Control\", \"value\":\"no-cache\"}]")+"&s1.item=" + el.id;
-
-	var addSuccess = function(o){
-		var result = o.responseXML;
-		var items = result.getElementsByTagName('item');
-
-		if (items.length < 0){
-
-			var item = items[0];
-			var berrybasket = YAHOO.util.Dom.get('berrybasket');
-			var berries = YAHOO.util.Dom.get('berries');
-			berryList[berryList.length]= item;
-			var parent =el.parentNode;
-			if (parent == null) return;
-			parent.removeChild(el);
-			var itemID = item.getAttribute('collection')+":"+item.getAttribute('name');
-			if (parent !=null && parent.id == "documentberries"){
-
-				var root = YAHOO.util.Dom.get(itemID+":root");
-				var section = YAHOO.util.Dom.get(itemID+":section");
-
-				if(root!=null && root.id.indexOf(itemID) !=-1){
-					parent.removeChild(root);
-				}
-
-				if(section!=null && section.id.indexOf(itemID) !=-1){
-					parent.removeChild(section);
-				}
-
-			}
-
-			if (!YAHOO.util.Dom.get('hideview') && berryList.length < 13){
-
-				while (berries.hasChildNodes()) {
-					berries.removeChild(berries.firstChild);
-				}
-
-				for (var i =0; i < berryList.length; i++ ){
-					var img = document.createElement('img');
-					img.src = berry_icon;
-					berries.appendChild(img);
-				}
-
-			} else {
-
-				if (YAHOO.util.Dom.get('hideview')){
-					var berryBasket = YAHOO.util.Dom.get('berrybasket');
-					var berries = YAHOO.util.Dom.get('berries');
-					var doclist = YAHOO.util.Dom.get('doclist');
-					var tid = el.id;
-					var berryItem;
-					var berryElement = document.createElement('li');
-
-					for (var i in berryList){
-						berryItem = berryList[i];
-						var id = berryItem.getAttribute('collection')+":"+berryItem.getAttribute('name');
-
-						if (id == tid){
-							var title = berryItem.getAttribute('Title');
-							var root_title = berryItem.getAttribute('root_Title');
-							if (root_title != null){
-							
-							    title = root_title+":"+title;
-							}
-							if (title.length > 50){
-								title = title.substring(0,20)+" ... "+title.substr(title.length-35,35);
-							}
-
-							berryElement.appendChild(document.createTextNode(title));
-							berryElement.setAttribute("class","berryitem");
-							doclist.appendChild(berryElement);
-							var heightStr = berryBasket.style.height+"";
-							var height =parseInt(heightStr.substring(0,heightStr.length-2)) +18;
-							berryBasket.style.height = height;
-							berries.style.height = height;
-							break;
-						}
-
-					}
-
-				}
-
-			}
-		}
-	}
-
-	var addFailure = function(o){
-	}
-
-	var addcallback = {
-		success:addSuccess,
-		failure:addFailure
-	}
-	
-	YAHOO.util.Connect.asyncRequest(request_type , addurl , addcallback);
-}
-
 
 
@@ -505,4 +115,5 @@
     var addurl = gs.xsltParams.library_name + "?a=pr&rt=r&ro=1&s=AddItem&c=&s1.id=2&o=XML&hhf="+makeURLComponentSafe("[{\"name\":\"Cache-Control\", \"value\":\"no-cache\"}]")+"&s1.item=" + el.id;
 
+    var request_type = "GET";
 	var addSuccess = function(o){
 		var result = o.responseXML;
Index: /main/trunk/greenstone3/web/interfaces/default/js/favouritebasket/favouritecheckout.js
===================================================================
--- /main/trunk/greenstone3/web/interfaces/default/js/favouritebasket/favouritecheckout.js	(revision 36070)
+++ /main/trunk/greenstone3/web/interfaces/default/js/favouritebasket/favouritecheckout.js	(revision 36071)
@@ -4,5 +4,5 @@
 var source_link_collections = new Array(); // or add list of collections like ["pdfberry", "mgppdemo"];
 var document_link_collections = new Array(); // or add list of collections as above.
-//these are the default metadata items used by  berry baskets.
+//these are the default metadata items used by favourite baskets.
 var default_metas = ["Title", "root_Title", "root_assocfilepath", "root_srclinkFile", "name", "collection", "Date"];
 
@@ -10,66 +10,15 @@
 var urlonly = false;
 var mailinfo = new Array();
-mailinfo['address'] = gs.text.berry.to; 
-mailinfo['cc'] = gs.text.berry.cc; 
-mailinfo['bcc'] = gs.text.berry.bcc; 
-mailinfo['subject'] = gs.text.berry.subject; 
+mailinfo['address'] = gs.text.favourites.to; 
+mailinfo['cc'] = gs.text.favourites.cc; 
+mailinfo['bcc'] = gs.text.favourites.bcc; 
+mailinfo['subject'] = gs.text.favourites.subject; 
 var textwin;
 var mailwin;
 
 var options = ['fullview', 'textview', 'email'];
-
-function toggleSelectAll(selAllCheckbox) {
-    // https://stackoverflow.com/questions/386281/how-to-implement-select-all-check-box-in-html
-    var allBerriesCheckboxList = document.getElementsByName('select-berry-checkbox');
-    for (var i = 0; i < allBerriesCheckboxList.length; i++) {
-	// if the selectAllCheckbox is checked, then all the berries' checkboxes will get checked
-	// And vice-versa.
-	allBerriesCheckboxList[i].checked = selAllCheckbox.checked;
-    }
-}
-
-function deleteSelected() {
-    
-    if(docList.length == 0) return; // no berries on page, nothing to delete
-
-    // https://stackoverflow.com/questions/590018/getting-all-selected-checkboxes-in-an-array
-    // https://www.w3schools.com/jsref/met_document_queryselectorall.asp
-    // https://www.w3schools.com/cssref/css_selectors.asp
-    var selectedList = document.querySelectorAll('input[name=select-berry-checkbox]:checked');
-    if(selectedList.length == 0) return; // nothing selected, so nothing to delete
-
-    // if all berries selected for deletion, can optimise
-    if(selectedList.length === docList.length) {
-	deleteAll();
-	return; // done!
-    }
-    
-    // otherwise selected list of berries is a proper subset of total berries (berries in docList)    
-    var idsToDelete = [];
-
-    // construct the deletion url by concatenating the ids with | which is %7C in URL-encoded form
-    var  delurl = delurlPath; // var delurlPath is declared in ygDDPlayer.js.
-    
-    for(var i = 0; i < selectedList.length; i++) {
-	selected_id = selectedList[i].id;
-	// Format of checkbox id: "<docid>-checkbox"
-	var end = selected_id.indexOf("-checkbox");
-	var doc_id = selected_id.substring(0, end);
-
-	idsToDelete[i] = doc_id;
-
-	// Now just need to append each doc_id to the deletion URL separated by |,
-	// but this character needs to be URL encoded, else the delete doesn't work.
-	if((i+1) == selectedList.length) { // if it's the last id to process, don't append separator
-	    delurl += doc_id;
-	} else { // there's more ids to process, so append separator
-	    delurl += doc_id + "%7C"; // url-encoded version of |
-	}
-	
-    }
-
-    var delAll = false;
-    doDelete(delAll, delurl, selectedList, idsToDelete);
-}
+var delurlPath = gs.xsltParams.library_name + "?a=pr&rt=r&ro=1&s=DeleteItems&c=&o=XML&hhf="+makeURLComponentSafe("[{\"name\":\"Cache-Control\", \"value\":\"no-cache\"}]")+"&s1.items=";
+var request_type = "GET"; // the default
+
 
 function deleteAll() {
@@ -77,5 +26,5 @@
     if(docList.length == 0) return; // nothing to delete
     
-    var  delurl = delurlPath; // var delurlPath is declared in ygDDPlayer.js.
+    var  delurl = delurlPath; 
     // Just need to append each doc id separated by |, but this character needs to be URL encoded,
     // else the delete doesn't work.
@@ -96,4 +45,16 @@
 }
 
+function deleteFavouriteFromCheckout(el)
+{
+    var  delurl = delurlPath; 
+
+    var doc_id = el.getAttribute('id');
+    delurl += doc_id;
+
+    var deleteAll = false;
+    var selectedList = [ el ];
+    var idsToDelete = [ doc_id ];
+    doDelete(deleteAll, delurl, selectedList, idsToDelete);
+}
 
 function doDelete(deleteAll, delurl, selectedList, idsToDelete) { // given list of selected checkboxes
@@ -180,18 +141,6 @@
 }
 
-function deleteFavouriteFromCheckout(el)
-{
-    var  delurl = delurlPath; // var delurlPath is declared in ygDDPlayer.js.
-
-    var doc_id = el.getAttribute('id');
-    delurl += doc_id;
-
-    var deleteAll = false;
-    var selectedList = [ el ];
-    var idsToDelete = [ doc_id ];
-    doDelete(deleteAll, delurl, selectedList, idsToDelete);
-}
-
-
+
+// switch between Full, Text and Email views
 function navigate(e){
 	
@@ -227,5 +176,5 @@
 		urlonly = false;
 		
-	    this.value=gs.text.berry.url_only; 
+	    this.value=gs.text.favourites.url_only; 
 		
 		populateUrlsAndMetadata(parea);
@@ -240,5 +189,5 @@
 		urlonly = true;
 		
-	    this.value=gs.text.berry.url_and_metadata; 
+	    this.value=gs.text.favourites.url_and_metadata; 
 		
 		return;
@@ -288,74 +237,11 @@
 
 function showFullView() {
-    if (gs.cgiParams.berrybasket == "on") {
-	showFullViewBerries();
-    }
-    else {
-	// assumption is that favouritebasket is on 
 	showFullViewFavourites();
-    }    
 }
 
 function emptyBasketText() {
-    if (gs.cgiParams.berrybasket == "on") {
-	return document.createTextNode(gs.text.berry.empty_basket);
-    } else {
-	// assume favourites
 	return document.createTextNode(gs.text.favourites.empty_basket);
-    }
-}
-
-function showFullViewBerries(){
-
-	var content =  YAHOO.util.Dom.get('berryBasketContent');
-	var fullview =  YAHOO.util.Dom.get('fullview');
-	berryCheckoutPageClear();
-
-	if (docList.length == 0){
-	    content.appendChild(emptyBasketText());
-		return;
-	}
-
-	var trashbin = document.createElement('div');
-	trashbin.id ='trashbin';
-
-	var binhandle = document.createElement('div');
-	binhandle.id = 'binhandle';
-	binhandle.appendChild(document.createElement('span'));
-	trashbin.appendChild(binhandle);
-	content.appendChild(trashbin);
-
-	var dd = new ygDDOnTop('trashbin');
-	dd.setHandleElId('binhandle');
-	new YAHOO.util.DDTarget('trashbin','trash');
-
-	var dlist = document.createElement('div');
-	content.appendChild(dlist);
-	var ol = document.createElement('ol');
-	dlist.appendChild(ol);
-
-	ol.setAttribute("id", "berryDocsList");
-    
-	for (var i in docList){
-		var doc = docList[i];
-		var li = document.createElement('li');
-		var img = document.createElement('img');
-		var text ="";
-
-		var doc_id = doc['collection']+":"+ doc['name'];	    
-	    
-		img.setAttribute("src", berry_icon);
-		img.setAttribute("id", doc_id);
-		img.setAttribute("height", "15px");
-		img.setAttribute("width", "15px");
-		li.appendChild(img);
-
-		generateDocDisplay(li, doc, doc_id)
-		li.className = 'berrydoc';
-		ol.appendChild(li);
-		new ygDDPlayer(img.id,'trash',docList);
-	}
-
-}
+}
+
 
 function showFullViewFavourites(){
@@ -492,5 +378,5 @@
 	input.setAttribute("class", "sendbutton");
 	input.setAttribute("type", "button");
-	input.setAttribute("value", gs.text.berry.send);
+	input.setAttribute("value", gs.text.favourites.send);
 	content.appendChild(input);
 }
@@ -554,5 +440,5 @@
 	input.setAttribute("class", "sendbutton");
 	input.setAttribute("type", "button");
-	input.setAttribute("value", gs.text.berry.send);
+	input.setAttribute("value", gs.text.favourites.send);
 	content.appendChild(input);
 	
@@ -569,9 +455,9 @@
 	if (urlonly)
 	{
-	    cb.value=gs.text.berry.url_and_metadata; 
+	    cb.value=gs.text.favourites.url_and_metadata; 
 	}
 	else
 	{
-	    cb.value=gs.text.berry.url_only;
+	    cb.value=gs.text.favourites.url_only;
 	}
 
@@ -668,18 +554,18 @@
 	    var metadata = "";
 	    if (doc['Title']) {
-		metadata += gs.text.berry.doc_title+": "+doc['Title']+"\n";
+		metadata += gs.text.favourites.doc_title+": "+doc['Title']+"\n";
 	    }
 	    if (doc['root_Title']) {
-		metadata += gs.text.berry.doc_root_title+": "+doc['root_Title']+"\n";
+		metadata += gs.text.favourites.doc_root_title+": "+doc['root_Title']+"\n";
 
 	    }
 	    if (doc['name']) {
-		metadata += gs.text.berry.doc_name+": "+doc['name']+"\n";
+		metadata += gs.text.favourites.doc_name+": "+doc['name']+"\n";
 	    }
 	    if (doc['collection']) {
-		metadata += gs.text.berry.doc_collection+": "+doc['collection']+"\n";
+		metadata += gs.text.favourites.doc_collection+": "+doc['collection']+"\n";
 	    }
 	    if (doc['Date']) {
-		metadata += gs.text.berry.doc_date+": "+doc['Date']+"\n";
+		metadata += gs.text.favourites.doc_date+": "+doc['Date']+"\n";
 	    }
 	    // allow for inclusion of custom metadata
@@ -711,11 +597,11 @@
 
     if(to_address.trim() === "") {
-	alert(gs.text.berry.invalid_to_address_empty);
+	alert(gs.text.favourites.invalid_to_address_empty);
 	return;
     } else if(to_address.indexOf('@') === -1) {
-	alert(gs.text.berry.invalid_to_address);
+	alert(gs.text.favourites.invalid_to_address);
 	return;
     } else if(content.trim() === "") {
-	alert(gs.text.berry.invalid_msg_body_empty);
+	alert(gs.text.favourites.invalid_msg_body_empty);
 	return;
     }
@@ -735,8 +621,8 @@
 		success: function(o) {
 			var result = o.responseText;
-		    alert(gs.text.berry.send_success); 
+		    alert(gs.text.favourites.send_success); 
 		} ,
 		failure: function(o) {
-		    alert(gs.text.berry.send_fail); 
+		    alert(gs.text.favourites.send_fail); 
 		}
 	}
