Index: modules/jstools/jstools.js
===================================================================
RCS file: /cvs/drupal-contrib/contributions/modules/jstools/jstools.js,v
retrieving revision 1.14
diff -u -r1.14 jstools.js
--- modules/jstools/jstools.js	14 Mar 2007 19:37:30 -0000	1.14
+++ modules/jstools/jstools.js	19 Apr 2007 23:02:14 -0000
@@ -157,6 +157,20 @@
   return properties;
 }
 
+Drupal.parseQueryString = function (query) {
+  query = query ? query : location.search.substring(1);
+  var args = new Object();
+  var pairs = query.split("&");
+  for(var i = 0; i < pairs.length; i++) {
+    var pos = pairs[i].indexOf('=');
+    if (pos == -1) continue;
+    var argname = pairs[i].substring(0, pos);
+    var value = pairs[i].substring(pos + 1);
+    args[argname] = unescape(value.replace(/\+/g, " "));
+  }
+  return args;
+}
+
 jQuery.extend({
   behaviors: [],
   registerBehavior: function(attachFunction, ready) {
Index: modules/jstools/activesearch/activesearch.js
===================================================================
RCS file: /cvs/drupal-contrib/contributions/modules/jstools/activesearch/activesearch.js,v
retrieving revision 1.6
diff -u -r1.6 activesearch.js
--- modules/jstools/activesearch/activesearch.js	19 Apr 2007 20:14:37 -0000	1.6
+++ modules/jstools/activesearch/activesearch.js	20 Apr 2007 01:32:54 -0000
@@ -10,6 +10,11 @@
     .append('<input type="hidden" name="activesearch" value="1" />')
     .each(function () {
       var elt = new Drupal.activesearch(this);
+    })
+    .find('input.form-submit')
+    // Clear any previously-registered paging data.
+    .click(function () {
+      $('#edit-page').attr('value', '');
     });
   // Submit if there is a hash set.
   if (location.hash  && (location.hash != '#') && (location.hash.substring(0, 5) == '#keys') && $('#search-form').length) {
@@ -30,9 +35,14 @@
 }
 
 Drupal.activesearchMonitor = function() {
-  if ((location.hash.substring(0, 5) == '#keys') && (location.hash != '#' + Drupal.settings.activesearchCurrentHash)) {
-    Drupal.settings.activesearchCurrentHash = location.hash.replace('#', '');
-    Drupal.activesearchSubmit();
+  if ($('#search-form').count) {
+    if ((location.hash.substring(0, 5) == '#keys') && (location.hash != '#' + Drupal.settings.activesearchCurrentHash)) {
+      Drupal.settings.activesearchCurrentHash = location.hash.replace('#', '');
+      Drupal.activesearchSubmit();
+    }
+  }
+  else {
+    clearInterval(Drupal.settings.activesearchIntervalId);
   }
 }
 
@@ -84,8 +94,15 @@
     .addClass('primary')
     .end()
     .end()
-    .fadeIn('fast');
-  Drupal.tabsAddClasses();
+    .fadeIn('fast')
+    .find('div.pager a')
+    .click(function () {
+      var args = Drupal.parseQueryString($(this).attr('href'));
+      $('#edit-page').attr('value', args['page'] ? args['page'] : '');
+      location.hash = Drupal.settings.activesearchCurrentHash = 'keys ' + args['keys'];
+      Drupal.activesearchSubmit();
+      return false;
+    });
 }
 
 /**
Index: modules/jstools/activesearch/activesearch.module
===================================================================
RCS file: /cvs/drupal-contrib/contributions/modules/jstools/activesearch/activesearch.module,v
retrieving revision 1.8
diff -u -r1.8 activesearch.module
--- modules/jstools/activesearch/activesearch.module	19 Apr 2007 19:30:38 -0000	1.8
+++ modules/jstools/activesearch/activesearch.module	20 Apr 2007 01:25:18 -0000
@@ -15,9 +15,18 @@
       'callback arguments' => array('activesearch_admin_settings')
     );
   }
+
   elseif (user_access('search via ajax')) {
     if (arg(0) == 'search' && arg(1) == 'node' && arg(2)) {
-      drupal_goto('search/node', NULL, 'keys '. arg(2));
+      $q = $_GET;
+      $querystring = array();
+      unset($q['q']);
+      foreach ($q as $key => $value) {
+        if ($key != 'q') {
+          $querystring[] = $key .'='. $value;
+        }
+      }
+      drupal_goto('search/node', !empty($querystring) ? implode('&', $querystring) : NULL, 'keys '. arg(2));
     }
     activesearch_load();
   }
@@ -37,9 +46,14 @@
 function activesearch_form_alter($form_id, &$form) {
   if (isset($_POST['activesearch']) && in_array($form_id, array('search_form', 'search_theme_form', 'search_block_form'))) {
     $form['#submit']['activesearch_submit'] = array();
+    $form['#validate']['activesearch_validate'] = array();
   }
   if ($form_id == 'search_form') {
     $form['#suffix'] .= '<dl class="search-results"></dl>';
+    $form['page'] = array(
+      '#type' => 'hidden',
+      '#value' => '',
+    );
   }
 }
 
@@ -63,14 +77,22 @@
   return $form;
 }
 
+function activesearch_validate($form_id, $form_values, $form) {
+  form_set_value(array('#parents' => array('page')), isset($_POST['page']) ? $_POST['page'] : '');
+}
+
 function activesearch_submit($form_id, $form_values) {
   $type = $form_values['module'] ? $form_values['module'] : 'node';
   if (in_array($form_id, array('search_theme_form', 'search_block_form'))) {
     $keys = $form_values[$form_id .'_keys'];
-    return 'search/'. $type .'#'. $keys;
+    // We can't return a string that includes the keys. Instead
+    // we set the destination directly.
+    $_REQUEST['destination'] = 'search/'. $type .'#keys '. $keys;
+    return;
   }
   $keys = $form_values['processed_keys'];
   $_GET['q'] = 'search/'. $type .'/'. $keys;
+  $_GET['page'] = $form_values['page'];
   print drupal_to_js(array('status' => TRUE, 'data' => array('keys' => $keys, 'results' => activesearch_results($keys, $type))));
   exit();
 }
