diff --git a/sites/all/modules/autosave/autosave.info b/sites/all/modules/autosave/autosave.info
index f1cfce6..8788526 100644
--- a/sites/all/modules/autosave/autosave.info
+++ b/sites/all/modules/autosave/autosave.info
@@ -5,6 +5,8 @@ description = Saves node edits in the background in case browser dies while edit
 package = Other
 project = autosave
 
+dependencies[] = "jquery_ui"
+
 core = 6.x
 ; Information added by drupal.org packaging script on 2009-11-02
 version = "6.x-2.2"
diff --git a/sites/all/modules/autosave/autosave.js b/sites/all/modules/autosave/autosave.js
index 216a743..f1e51d6 100644
--- a/sites/all/modules/autosave/autosave.js
+++ b/sites/all/modules/autosave/autosave.js
@@ -1,94 +1,147 @@
 var autosaved_form;
 
-if (Drupal.jsEnabled) {
-  $(document).ready(function() {
-    $('body').append('<div id="autosave-status"><span id="status"></span><span id="operations"> \
-    <span id="view"><a href="#">View</a></span> \
-    <span id="ignore"><a href="#" title="Ignore/Delete Saved Form">Ignore</a></span> \
-    <span id="keep"><a href="#" title="Keep Saved Form - Revert to Saved">Keep</a></span></span></div>');
-    autosaved = Drupal.settings.autosave;   
-    autosaved_form_id = 'node-form';
+/**
+ * Autosave init.
+ * If there's no previously saved form, then start saving.
+ * If there is a previously saved form, ask the user what to do with it.
+ */
+Drupal.behaviors.autosave = function (context) {
+  $(context).find('body:not(.autosave-processed)').append('<div id="autosave-status" style="display: none;"><span id="autosave-status-message"></span></div>');
+  $(context).find('#autosave-status').css('display', 'none');
+
+  autosaved = Drupal.settings.autosave;   
+  autosaved_form_id = 'node-form';
+
+  if (autosaved.serialized) {
+    Drupal.autosave_view_ignore_dialog(context);
+  }
+  // There are no autosaved forms, continue with autosave.
+  else {
+    Drupal.attachAutosave(context);
+  }
+
+  $(context).find('body').addClass('autosave-processed');
+}
+
+/**
+ * Ask the user if they want to review the saved contents of the form, or
+ * simply ignore them.
+ */
+Drupal.autosave_view_ignore_dialog = function (context) {
+  var autosaved = Drupal.settings.autosave;   
+  var autosaved_form_id = 'node-form';
+
+  $(context).find('body:not(.autosave-processed)').append('<div id="autosave-operations"> \
+  <span id="autosave-operations-status-message">'+Drupal.t('This form was autosaved on !date', {'!date': autosaved.saved_date})+'</span> \
+  </div>');
+
+  var view_ignore_buttons = {};
+  view_ignore_buttons[Drupal.t('View')] = function () {
+    $(context).find('#' + autosaved_form_id).formHash(autosaved.serialized);
+    if (Drupal.settings.autosave.wysiwyg && Drupal.wysiwyg) {
+      // need to loop through any WYSIWYG editor fields and update the visible iframe fields with hidden field content
+      for (var instance in Drupal.wysiwyg.instances) {
+        Drupal.wysiwyg.instances[instance].setContent($(context).find('#' + instance).val());
+      }
+    }
     
-    if (autosaved.serialized) {
-      $('#autosave-status #keep').css('display', 'none').css('visibility', 'hidden');
-      $('#autosave-status #view a').click(function() {
-        if ($(this).html() == 'View') {
-          $('#' + autosaved_form_id).formHash(autosaved.serialized);
-          if (Drupal.settings.autosave.wysiwyg && Drupal.wysiwyg) {
-            // need to loop through any WYSIWYG editor fields and update the visible iframe fields with hidden field content
-            for (var instance in Drupal.wysiwyg.instances) {
-              Drupal.wysiwyg.instances[instance].setContent($('#' + instance).val());
-            }
-          }
-          
-          //CKEditor support
-          if (typeof(CKEDITOR) != 'undefined' ) {
-            for (var instance in CKEDITOR.instances) {
-              CKEDITOR.instances[instance].setData($('#' + instance).val());
-            }
-          }
-          
-          $('#' + autosaved_form_id).focus();
-          $(this).html('Reset');
-          $('#autosave-status #keep').css('display', 'inline').css('visibility', 'visible');
-          $('#autosave-status #keep a').html('Keep'); 
-        }
-        else if ($(this).html() == 'Reset') {
-          form = document.getElementById(autosaved_form_id);
-          form.reset();
-
-          //CKEditor support
-          if (typeof(CKEDITOR) != 'undefined' ) {
-            for (var instance in CKEDITOR.instances) {
-              CKEDITOR.instances[instance].setData($('#' + instance).val());
-            }
-          }
-          
-          $('#autosave-status #keep').css('display', 'none').css('visibility', 'hidden');
-          $(this).html('View');
-        }    
-        return false;
-      });
-      $('#autosave-status #ignore a').click(function() {
-        $('#autosave-status').fadeOut('slow');
-        form = document.getElementById(autosaved_form_id);
-        form.reset();
-
-        //CKEditor support
-        if (typeof(CKEDITOR) != 'undefined' ) {
-          for (var instance in CKEDITOR.instances) {
-            CKEDITOR.instances[instance].setData($('#' + instance).val());
-          }
-        }
-        
-        $('#autosave-status #operations').css('display', 'none').css('visibility', 'hidden');
-        Drupal.attachAutosave();
-        return false;
-      });
-      $('#autosave-status #keep a').click(function() {
-        $('#autosave-status').fadeOut('slow');
-        form = document.getElementById(autosaved_form_id);
-        $('#autosave-status #operations').css('display', 'none').css('visibility', 'hidden');
-        Drupal.attachAutosave();
-        return false;
-      });
-      $('#autosave-status #status').html('This form was autosaved on ' + autosaved.saved_date);
-      $('#autosave-status').slideDown();
+    //CKEditor support
+    if (typeof(CKEDITOR) != 'undefined' ) {
+      for (var instance in CKEDITOR.instances) {
+        CKEDITOR.instances[instance].setData($(context).find('#' + instance).val());
+      }
+    }
+
+    $(this).dialog('destroy');
+    $(this).remove();
+
+    Drupal.autosave_keep_reset_dialog(context);
+    
+    $(context).find('#' + autosaved_form_id).focus();
+  };
+      
+  view_ignore_buttons[Drupal.t('Ignore')] = function () {
+    $(context).find('#autosave-operations').fadeOut('slow');
+    form = document.getElementById(autosaved_form_id);
+    form.reset();
+
+    //CKEditor support
+    if (typeof(CKEDITOR) != 'undefined' ) {
+      for (var instance in CKEDITOR.instances) {
+        CKEDITOR.instances[instance].setData($(context).find('#' + instance).val());
+      }
     }
-    // There are no autosaved forms, continue with autosave.
-    else {
-      Drupal.attachAutosave();
+    
+    $(this).dialog('destroy');
+    $(this).remove();
+
+    // Start autosaving.
+    Drupal.attachAutosave(context);
+  };
+
+  $(context).find('#autosave-operations').dialog({
+    modal: true,
+    buttons: view_ignore_buttons,
+    show: 'fold',
+    hide: 'fold'
+  });
+}
+
+/**
+ * Ask the user if they want to keep the saved contents of the form or start over.
+ */
+Drupal.autosave_keep_reset_dialog = function (context) {
+  var autosaved = Drupal.settings.autosave;   
+  var autosaved_form_id = 'node-form';
+
+  $(context).find('body').append('<div id="autosave-operations"> \
+  <span id="autosave-operations-status-message">'+Drupal.t('Please examine these values, autosaved on !date.  If you would like to continue from where you left off, click "Keep".  If you would like to start over with this form, click "Reset".', {'!date': autosaved.saved_date})+'</span> \
+  </div>');
+
+  $(context).find('#' + autosaved_form_id).focus();
+
+  var keep_reset_buttons = {};
+  keep_reset_buttons[Drupal.t('Keep')] = function () {
+    $(context).find('#autosave-operations').fadeOut('slow');
+    form = document.getElementById(autosaved_form_id);
+
+    $(this).dialog('disable');
+    $(this).remove();
+
+    Drupal.attachAutosave(context);
+  };
+
+  keep_reset_buttons[Drupal.t('Reset')] = function () {
+    form = document.getElementById(autosaved_form_id);
+    form.reset();
+
+    //CKEditor support
+    if (typeof(CKEDITOR) != 'undefined' ) {
+      for (var instance in CKEDITOR.instances) {
+        CKEDITOR.instances[instance].setData($(context).find('#' + instance).val());
+      }
     }
+    
+    $(this).dialog('destroy');
+    $(this).remove();
+
+    Drupal.attachAutosave(context);
+  };
+
+  $(context).find('#autosave-operations').dialog({
+    buttons: keep_reset_buttons,
+    show: 'fold',
+    hide: 'fold'
   });
-} 
+}
 
-Drupal.saveForm = function() {
+Drupal.saveForm = function(context) {
   if (Drupal.settings.autosave.wysiwyg && Drupal.wysiwyg) {
     // need to loop through any WYSIWYG editor fields and update the real (hidden) text fields before saving
     for (var instance in Drupal.wysiwyg.instances) {
       if (Drupal.wysiwyg.instances[instance].editor != 'none') {
         var content = Drupal.wysiwyg.instances[instance].getContent();
-        $('#' + instance).val(content);
+        $(context).find('#' + instance).val(content);
       }
     }
   }
@@ -100,28 +153,28 @@ Drupal.saveForm = function() {
     }
   }
   
-  var serialized = $('#node-form').formHash();
-  serialized['q'] =  Drupal.settings.autosave.q;
+  var serialized = $(context).find('#node-form').formHash();
+  serialized['autosave_path'] =  Drupal.settings.autosave.autosave_path;
   $.ajax({
     url: Drupal.settings.basePath + "autosave/handler",
     type: "POST",
     dataType: "xml/html/script/json",
     data: serialized,
     complete: function(XMLHttpRequest, textStatus) {
-      if (!Drupal.settings.autosave.hidden) Drupal.displaySaved();
-      Drupal.attachAutosave();
+      if (!Drupal.settings.autosave.hidden) Drupal.displaySaved(context);
+      Drupal.attachAutosave(context);
     }
   });
 }   
 
-Drupal.attachAutosave = function() {
-  setTimeout('Drupal.saveForm()', Drupal.settings.autosave.period * 1000);
+Drupal.attachAutosave = function(context) {
+  setTimeout(function () { Drupal.saveForm(context); }, Drupal.settings.autosave.period * 1000);
 }
 
-Drupal.displaySaved = function() {
-  $('#autosave-status #status').html('Form autosaved.');
-  $('#autosave-status #operations').css('display', 'none').css('visibility', 'hidden');
-  $('#autosave-status').slideDown();
-  setTimeout("$('#autosave-status').fadeOut('slow')", 3000);  
+Drupal.displaySaved = function(context) {
+  $(context).find('#autosave-status #autosave-status-message').html(Drupal.t('Form autosaved.'));
+  $(context).find('#autosave-status #autosave-operations').css('display', 'none').css('visibility', 'hidden');
+  $(context).find('#autosave-status').slideDown();
+  setTimeout(function () { $(context).find('#autosave-status').fadeOut('slow'); }, 3000);
 }
 
diff --git a/sites/all/modules/autosave/autosave.module b/sites/all/modules/autosave/autosave.module
index 4c22a3f..d3961c1 100644
--- a/sites/all/modules/autosave/autosave.module
+++ b/sites/all/modules/autosave/autosave.module
@@ -87,6 +87,10 @@ function autosave_form_node_type_form_alter(&$form, $form_state) {
 function autosave_form_alter(&$form, &$form_state, $form_id) {
   global $user;
   $path = $_GET['q'];
+
+  jquery_ui_add(array('ui.draggable', 'ui.resizable'));
+  drupal_add_css(jquery_ui_get_path()."/themes/base/jquery-ui.css");
+  drupal_add_css(jquery_ui_get_path()."/themes/base/ui.all.css");
   
   if (stristr($form_id, '_node_form') && arg(0) != 'admin') {
 
@@ -102,7 +106,7 @@ function autosave_form_alter(&$form, &$form_state, $form_id) {
       
       $settings['autosave']['url'] = url('autosave/handler');
       $settings['autosave']['period'] = variable_get('autosave_period', 10);
-      $settings['autosave']['q'] = $path;
+      $settings['autosave']['autosave_path'] = $path;
       $settings['autosave']['hidden'] = variable_get('autosave_hidden', 0);
       
       // If an autosaved version of the form exists, make it available via javascript.
@@ -124,12 +128,12 @@ function autosave_form_alter(&$form, &$form_state, $form_id) {
  */
 function autosave_save() {
   global $user;
-  
-  $path = $_POST['q'];
+
+  $path = $_POST['autosave_path'];
   $form_id = $_POST['form_id'];
   // Not all variables need to be serialized.
-  //    - for Drupal 6 version need to remove op and form_build_id
-  unset($_POST['q'], $_POST['op'], $_POST['form_build_id']);
+  //    - for Drupal 6 version need to remove op
+  unset($_POST['autosave_path'], $_POST['op']);
   $serialized = serialize($_POST);
 
   // check if node has just been saved - if it has then it's because AS ajax fired off as user was submitting
