--- popups.js.dist	2009-08-04 14:25:03.000000000 -0400
+++ popups.js	2009-08-04 14:23:22.000000000 -0400
@@ -604,7 +604,11 @@ Popups.removePopup = function(popup) {  
   if (popup) {
 //    console.log('removing '+popup.id);
     popup.$popup().remove();
-    Popups.popupStack.splice(Popups.popupStack.indexOf(popup), 1); // Remove popup from stack.  Probably should rework into .pop()
+    for (var i = 0; i < Popups.popupStack.length; i++) {
+      if (Popups.popupStack[i] == popup) {
+        Popups.popupStack.splice(i, 1);  // Remove popup from stack.  Probably should rework into .pop()
+      }
+    }
   }  
 //  else {
 //    console.log("Popups.removePopup - there is no popup to remove.");
