Index: main/trunk/greenstone3/web/interfaces/default/js/javascript-global-functions.js
===================================================================
--- main/trunk/greenstone3/web/interfaces/default/js/javascript-global-functions.js	(revision 33217)
+++ main/trunk/greenstone3/web/interfaces/default/js/javascript-global-functions.js	(revision 33218)
@@ -965,5 +965,5 @@
 
     gs.functions._callMetadataServer(
-	"removeArchiveMetadata", 
+	"removeArchivesMetadata", 
 	gs.functions.getBasicDataForMetadataServer("remove-archives-metadata", collection, site, documentID, metadataName, null /*metamode*/, metadataValue, null /*prevmetavalue*/, metadataPosition), 
 	successResponseFunction,
@@ -1003,2 +1003,57 @@
 }
 
+
+/***********************************************************
+* ERASE METADATA FUNCTIONS 	                               *
+* Erase all meta in docID (sectionID) that match metaname. *
+***********************************************************/
+
+gs.functions.eraseImportMetadata = function(collection, site, documentID, metadataName, successResponseFunction, errorResponseFunction)
+{
+	if( typeof errorResponseFunction === 'undefined' ) { errorResponseFunction = null; } // force error callback to be defined: either null or has value
+	
+    gs.functions._callMetadataServer(
+	"eraseImportMetadata", 
+	gs.functions.getBasicDataForMetadataServer("erase-import-metadata", collection, site, documentID, metadataName, "override" /*metamode*/, null /*metadataValue*/, null /*prevmetavalue*/, null /*metadataPosition*/), 
+	successResponseFunction,
+	errorResponseFunction);
+}
+
+gs.functions.eraseArchivesMetadata = function(collection, site, documentID, metadataName, successResponseFunction, errorResponseFunction)
+{
+	if( typeof errorResponseFunction === 'undefined' ) { errorResponseFunction = null; } // force error callback to be defined: either null or has value
+	
+    gs.functions._callMetadataServer(
+	"eraseArchivesMetadata", 
+	gs.functions.getBasicDataForMetadataServer("erase-archives-metadata", collection, site, documentID, metadataName, "override" /*metamode*/, null /*metadataValue*/, null /*prevmetavalue*/, null /*metadataPosition*/), 
+	successResponseFunction,
+	errorResponseFunction);
+}
+
+gs.functions.eraseIndexMetadata = function(collection, site, documentID, metadataName, successResponseFunction, errorResponseFunction)
+{
+	if( typeof errorResponseFunction === 'undefined' ) { errorResponseFunction = null; } // force error callback to be defined: either null or has value
+	
+    gs.functions._callMetadataServer(
+	"eraseIndexMetadata", 
+	gs.functions.getBasicDataForMetadataServer("erase-metadata", collection, site, documentID, metadataName, "override" /*metamode*/, null /*metadataValue*/, null /*prevmetavalue*/, null /*metadataPosition*/), 
+	successResponseFunction,
+	errorResponseFunction);
+}
+
+gs.functions.eraseMetadata = function(collection, site, documentID, metadataName, successResponseFunction, errorResponseFunction)
+{
+	if( typeof errorResponseFunction === 'undefined' ) { errorResponseFunction = null; } // force error callback to be defined: either null or has value
+	
+	var nameArray = ["eraseImportMetadata", "eraseArchivesMetadata", "eraseIndexMetadata"];
+	var functionArray = ["erase-import-metadata", "erase-archives-metadata", "erase-metadata"];
+	
+	for(var i = 0; i < nameArray.length; i++)
+	{
+	    gs.functions._callMetadataServer(
+		nameArray[i],
+		gs.functions.getBasicDataForMetadataServer(functionArray[i], collection, site, documentID, metadataName, "override" /*metamode*/, null /*metadataValue*/, null /*prevmetavalue*/, null /*metadataPosition*/),
+		successResponseFunction,
+		errorResponseFunction);
+	}
+}
Index: main/trunk/greenstone3/web/interfaces/default/js/map-scripts.js
===================================================================
--- main/trunk/greenstone3/web/interfaces/default/js/map-scripts.js	(revision 33217)
+++ main/trunk/greenstone3/web/interfaces/default/js/map-scripts.js	(revision 33218)
@@ -1,4 +1,5 @@
-var mapEnabled = false; // variable to detect when map-scripts have been included into document_scripts.js and classifier_scripts.js
-						// Will be set to true iff we have gps map data that the map can display
+var mapEnabled = false; // variable to detect when map-scripts have been included into document_scripts.js and classifier_scripts.js,
+						// in which case this variable will be defined.
+						// It will be furthermore be set to true iff we have gps map data that the map can display, false if map-scripts imported but no map data.
 
 //var newLat, newLng = 0;
