Index: src/wp-admin/js/media-upload.js
===================================================================
--- src/wp-admin/js/media-upload.js	(revision 26169)
+++ src/wp-admin/js/media-upload.js	(working copy)
@@ -1,3 +1,4 @@
+/* global tinymce:true, QTags:true, tb_remove:true:true */
 // send html to the post editor
 
 var wpActiveEditor;
@@ -2,3 +3,3 @@
 
-function send_to_editor(h) {
+window.send_to_editor = function(h) {
 	var ed, mce = typeof(tinymce) != 'undefined', qt = typeof(QTags) != 'undefined';
@@ -42,8 +43,8 @@
 		document.getElementById(wpActiveEditor).value += h;
 	}
 
-	try{tb_remove();}catch(e){};
-}
+	try{tb_remove();}catch(e){}
+};
 
 // thickbox settings
 var tb_position;
@@ -60,7 +61,7 @@
 			tbWindow.css({'margin-left': '-' + parseInt((( W - 50 ) / 2),10) + 'px'});
 			if ( typeof document.body.style.maxWidth != 'undefined' )
 				tbWindow.css({'top': 20 + adminbar_height + 'px','margin-top':'0'});
-		};
+		}
 
 		return $('a.thickbox').each( function() {
 			var href = $(this).attr('href');
