Index: src/webapp/fluid-components/html/Lightbox.html
===================================================================
--- src/webapp/fluid-components/html/Lightbox.html	(revision 4730)
+++ src/webapp/fluid-components/html/Lightbox.html	(working copy)
@@ -369,7 +369,7 @@
         
         <!--  Attach the javascript functionality to the markup by using initLightbox() -->
         <script type="text/javascript"  rsf:id="init-script">
-          fluid.initLightbox ("gallery:::gallery-thumbs:::", "message-bundle:");
+          fluid.lightbox.initLightbox ("gallery:::gallery-thumbs:::", "message-bundle:");
         </script>
       </div>
       
Index: src/webapp/fluid-components/js/fluid/Lightbox.js
===================================================================
--- src/webapp/fluid-components/js/fluid/Lightbox.js	(revision 4730)
+++ src/webapp/fluid-components/js/fluid/Lightbox.js	(working copy)
@@ -1,15 +1,78 @@
 var fluid = fluid || {};
 
-fluid.Lightbox = {
-	addThumbnailActivateHandler: function (lightboxContainer) {
-		
-		var enterKeyHandler = function (evt) {
-			if (evt.which == fluid.keys.ENTER) {
-				var thumbnailAnchors = jQuery ("a", evt.target);
-				document.location = thumbnailAnchors.attr ('href');
-			}
-		};
-		
-		jQuery (lightboxContainer).keypress (enterKeyHandler);
-	}
-};
\ No newline at end of file
+(function (jQuery, document) {
+    var deriveLightboxCellBase = function (namebase, index) {
+        return namebase + "lightbox-cell:" + index + ":";
+    };
+    
+    // An <input> tag nested within our root namebase tag, which has an id which 
+    // begins with the  namebase:lightbox-cell:: prefix, and ends with "reorder-index" trail.
+    // Very hard to imagine any perversity which may lead to this picking any stray stuff :P
+    // An approach based on the "sourceIndex" DOM property would be much more efficient,
+    // but this is only supported in IE. 
+    var createOrderChangedCallback = function (parentNode) {
+        var reorderform = fluid.utils.findForm (parentNode);
+        
+        return function () {
+            var inputs = fluid.utils.seekNodesById(
+                reorderform, 
+                "input", 
+                "^" + fluid.deriveLightboxCellBase (parentNode.id, "[^:]*") + "reorder-index$");
+            
+            for (var i = 0; i < inputs.length; i = i+1) {
+                inputs[i].value = i;
+            }
+        
+            if (reorderform && reorderform.action) {
+                jQuery.post(reorderform.action, 
+                jQuery(reorderform).serialize(),
+                function (type, data, evt) { /* No-op response */ });
+            }
+        };
+    };
+    
+    // Public Lightbox API
+    fluid.lightbox = {
+    	addThumbnailActivateHandler: function (lightboxContainer) {
+    		
+    		var enterKeyHandler = function (evt) {
+    			if (evt.which === fluid.keys.ENTER) {
+    				var thumbnailAnchors = jQuery ("a", evt.target);
+    				document.location = thumbnailAnchors.attr ('href');
+    			}
+    		};
+    		
+    		jQuery (lightboxContainer).keypress (enterKeyHandler);
+    	},
+    	
+    	// Creates a new Lightbox given the necessary parameters.
+        setupLightbox: function (container, itemFinderFn, orderChangedFn, instructionMessageId) {
+            // Remove the anchors from the taborder.
+            jQuery ("a", container).tabIndex (-1);
+            fluid.lightbox.addThumbnailActivateHandler (container);
+            
+            var layoutHandler = new fluid.GridLayoutHandler (itemFinderFn, {
+                orderChangedCallback: orderChangedFn
+            });
+            
+            return new fluid.Reorderer (container, itemFinderFn, layoutHandler, {
+                messageNamebase : instructionMessageId
+            });
+        },
+        
+        // Client-level initialisation for the lightbox, allowing parameterisation for
+        // different templates.
+        initLightbox: function (namebase, messageNamebase) {
+            var parentNode = document.getElementById (namebase);
+            var orderChangedCallback = createOrderChangedCallback (parentNode);
+            
+            // This orderable finder knows that the lightbox thumbnails are 'div' elements
+            var lightboxCellNamePattern = "^" + fluid.deriveLightboxCellBase (namebase, "[0-9]+") +"$";
+            var itemFinder = function () {
+                return fluid.utils.seekNodesById (parentNode, "div", lightboxCellNamePattern);
+            };
+            
+            fluid.lightbox.setupLightbox (parentNode, itemFinder, orderChangedCallback, messageNamebase);
+        }
+    };
+}) (jQuery, document);
Index: src/webapp/fluid-components/js/fluid/Fluid.js
===================================================================
--- src/webapp/fluid-components/js/fluid/Fluid.js	(revision 4730)
+++ src/webapp/fluid-components/js/fluid/Fluid.js	(working copy)
@@ -57,60 +57,7 @@
 fluid.deriveLightboxCellBase = function (namebase, index) {
     return namebase + "lightbox-cell:" + index + ":";
 };
-    
-// Client-level initialisation for the lightbox, allowing parameterisation for
-// different templates.
-fluid.initLightbox = function (namebase, messageNamebase) {
-    var parentNode = document.getElementById (namebase);
-    var reorderform = fluid.utils.findForm (parentNode);
-        
-    // Remove the anchors from the taborder - camel case 'tabIndex' needed for IE7 support
-    jQuery ("a", reorderform).attr ("tabIndex", "-1");
-    
-    // An <input> tag nested within our root namebase tag, which has an id which 
-    // begins with the  namebase:lightbox-cell:: prefix, and ends with "reorder-index" trail.
-    // Very hard to imagine any perversity which may lead to this picking any stray stuff :P
-    
-    // An approach based on the "sourceIndex" DOM property would be much more efficient,
-    // but this is only supported in IE. 
-    var orderChangedCallback = function() {
-        var inputs = fluid.utils.seekNodesById(
-            reorderform, 
-            "input", 
-            "^" + fluid.deriveLightboxCellBase (namebase, "[^:]*") + "reorder-index$");
-        
-        for (var i = 0; i < inputs.length; ++ i) {
-            inputs[i].value = i;
-        }
 
-        if (reorderform && reorderform.action) {
-            jQuery.post(reorderform.action, 
-            jQuery(reorderform).serialize(),
-            function (type, data, evt) { /* No-op response */ });
-        }
-    };
-    
-    // This orderable finder knows that the lightbox thumbnails are 'div' elements
-    var lightboxCellNamePattern = "^" + fluid.deriveLightboxCellBase (namebase, "[0-9]+") +"$";
-    var itemFinder = function () {
-        return fluid.utils.seekNodesById (parentNode, "div", lightboxCellNamePattern);
-    };
-        
-    var layoutHandler = new fluid.GridLayoutHandler (itemFinder, {
-        orderChangedCallback: orderChangedCallback
-    });
-
-    var lightbox = new fluid.Reorderer (parentNode, itemFinder, layoutHandler, {
-            messageNamebase : messageNamebase
-        }
-    );
-    
-    fluid.Lightbox.addThumbnailActivateHandler (parentNode);
-    
-};
-  
-
-
 /*
  * Utilities object for providing various general convenience functions
  */
