diff --git a/js/imce_set_inline.js b/js/imce_set_inline.js
index 1eaeb45..383e270 100644
--- a/js/imce_set_inline.js
+++ b/js/imce_set_inline.js
@@ -3,8 +3,9 @@
 
 var ii = window.imceInline = {};
 
-ii.initiate = function() {
-  $('div.imce-inline-wrapper').show().find('a').click(function() {
+// Drupal behavior
+Drupal.behaviors.imceInline = function(context) {
+  $('div.imce-inline-wrapper', context).not('.processed').addClass('processed').show().find('a').click(function() {
     var i = this.name.indexOf('-IMCE-');
     ii.activeTextarea = $('#'+ this.name.substr(0, i)).get(0);
     ii.activeType = this.name.substr(i+6);
@@ -55,6 +56,4 @@ ii.insert = function (file, win) {
   ii.insertAtCursor(ii.activeTextarea, html, type);
 };
 
-$(document).ready(ii.initiate);
-
 })(jQuery);
\ No newline at end of file
