Index: img_assist.js
===================================================================
RCS file: /cvs/drupal-contrib/contributions/modules/img_assist/Attic/img_assist.js,v
retrieving revision 1.4.2.2
diff -u -p -r1.4.2.2 img_assist.js
--- img_assist.js	9 Apr 2007 22:57:22 -0000	1.4.2.2
+++ img_assist.js	7 Sep 2007 23:10:46 -0000
@@ -106,24 +106,6 @@ function hideElement(id) {
   }
 }
 
-function launch_popup(nid, mw, mh) {
-	var ox = mw;
-	var oy = mh;
-	if((ox>=screen.width) || (oy>=screen.height)){
-		var ox = screen.width-150;
-		var oy = screen.height-150;
-		var winx = (screen.width / 2)-(ox / 2);
-		var winy = (screen.height / 2)-(oy / 2);
-		var use_scrollbars = 1;
-	}
-	else{
-		var winx = (screen.width / 2)-(ox / 2);
-		var winy = (screen.height / 2)-(oy / 2);
-		var use_scrollbars = 0;
-	}
-	var win = window.open(BASE_URL + 'index.php?q=img_assist/popup/' + nid, 'imagev', 'height='+oy+'-10,width='+ox+',top='+winy+',left='+winx+',scrollbars='+use_scrollbars+',resizable');
-}
-
 function insertImage() {
   if (window.opener) {
     // Get variables from the fields on the properties frame
Index: img_assist.module
===================================================================
RCS file: /cvs/drupal-contrib/contributions/modules/img_assist/Attic/img_assist.module,v
retrieving revision 1.68.2.22
diff -u -p -r1.68.2.22 img_assist.module
--- img_assist.module	6 Sep 2007 00:05:35 -0000	1.68.2.22
+++ img_assist.module	7 Sep 2007 23:11:59 -0000
@@ -80,7 +80,7 @@ function img_assist_menu($may_cache) {
     }
     // the base url here is used for popup windows
     drupal_add_js("var BASE_URL = \"" . base_path() ."\";", 'inline');
-    drupal_add_js($path .'/img_assist.js');
+    drupal_add_js($path .'/img_assist_popup.js');
 
   }
   return $items;
@@ -105,6 +105,9 @@ function img_assist_elements() {
  * Add image link underneath textareas
  */
 function img_assist_textarea($element) {
+  $path = drupal_get_path('module', 'img_assist');
+  drupal_add_js($path .'/img_assist.js');
+  
   $link = variable_get('img_assist_link', 'icon');
   if (($link == 'icon') || ($link == 'text')) {
     if (_img_assist_textarea_match($element['#id']) && _img_assist_page_match() && !strstr($_GET['q'], 'img_assist')) {
Index: img_assist_popup.js
===================================================================
RCS file: img_assist_popup.js
diff -N img_assist_popup.js
--- /dev/null	1 Jan 1970 00:00:00 -0000
+++ img_assist_popup.js	7 Sep 2007 23:12:57 -0000
@@ -0,0 +1,20 @@
+/* $Id: img_assist_popup.js,v 1.4.2.2 2007/04/09 22:57:22 darrenoh Exp $ */
+
+function launch_popup(nid, mw, mh) {
+	var ox = mw;
+	var oy = mh;
+	if((ox>=screen.width) || (oy>=screen.height)){
+		var ox = screen.width-150;
+		var oy = screen.height-150;
+		var winx = (screen.width / 2)-(ox / 2);
+		var winy = (screen.height / 2)-(oy / 2);
+		var use_scrollbars = 1;
+	}
+	else{
+		var winx = (screen.width / 2)-(ox / 2);
+		var winy = (screen.height / 2)-(oy / 2);
+		var use_scrollbars = 0;
+	}
+	var win = window.open(BASE_URL + 'index.php?q=img_assist/popup/' + nid, 'imagev', 'height='+oy+'-10,width='+ox+',top='+winy+',left='+winx+',scrollbars='+use_scrollbars+',resizable');
+}
+
