Index: subModal.js
===================================================================
--- subModal.js	(revision 9)
+++ subModal.js	(working copy)
@@ -33,7 +33,7 @@
 }
 
 /**
- * Initializes popup code on load.	
+ * Initializes popup code.	
  */
 function initPopUp() {
 	// Add the HTML to the body
@@ -87,8 +87,18 @@
 		}
 	}
 }
-addEvent(window, "load", initPopUp);
 
+/**
+ * Initializes popup code if not already initialized.
+ * Initialization check is based on presence of "popupContainer" element.
+ */
+function initCheck() {
+	var elem = document.getElementById("popupContainer");
+	if (typeof elem == 'undefined' || elem == null) {
+        initPopUp();
+	}
+}
+
  /**
 	* @argument width - int in pixels
 	* @argument height - int in pixels
@@ -97,6 +107,9 @@
 	* @argument showCloseBox - show the close box - default true
 	*/
 function showPopWin(url, width, height, returnFunc, showCloseBox) {
+	// perform initialization check
+	initCheck();
+	
 	// show or hide the window close widget
 	if (showCloseBox == null || showCloseBox == true) {
 		document.getElementById("popCloseBox").style.display = "block";

