diff --git a/sites/default/modules/support/support.module b/sites/default/modules/support/support.module
index 40d3cd6..53bf30f 100644
--- a/sites/default/modules/support/support.module
+++ b/sites/default/modules/support/support.module
@@ -139,6 +139,12 @@ function support_menu() {
     'access callback' => TRUE,
     'type' => MENU_CALLBACK,
   );
+  $items['support/update_ticket'] = array(
+    'page callback' => 'support_update_ticket_js',
+    // TODO: implement real access control
+    'access callback' => TRUE,
+    'type' => MENU_CALLBACK,
+  );
   $items['admin/support'] = array(
     'title' => 'Support ticketing system',
     'description' => 'Manage the support ticket system.',
@@ -208,17 +214,20 @@ function support_cron() {
  */
 function support_autocomplete_assigned($clid, $string = '') {
   $matches = array();
-  if ($string) {
+  if (!empty($string)) {
     $roles = array();
-    $client = db_result(db_query('SELECT name FROM {support_client} WHERE clid = %d', $clid));
-    // retrieve all roles giving permission to access current tickets
-    $result = db_query("SELECT rid FROM {permission} WHERE perm LIKE '%%%s%%' OR perm LIKE '%%%s%%'", "access $client tickets", 'administer support');
-    while ($role = db_fetch_object($result)) {
-      $roles[$role->rid] = $role->rid;
-    }
-    $result = db_query_range("SELECT u.name FROM {users} u LEFT JOIN {users_roles} r ON u.uid = r.uid WHERE r.rid IN (%s) AND u.status = 1 AND LOWER(name) LIKE LOWER('%s%%')", implode(', ', $roles), $string, 0, 10);
-    while ($user = db_fetch_object($result)) {
-      $matches[$user->name] = check_plain($user->name);
+    if ($client = db_result(db_query('SELECT name FROM {support_client} WHERE clid = %d', $clid))) {
+      // retrieve all roles giving permission to access current tickets
+      $result = db_query("SELECT rid FROM {permission} WHERE perm LIKE '%%%s%%' OR perm LIKE '%%%s%%'", "access $client tickets", 'administer support');
+      while ($role = db_fetch_object($result)) {
+        $roles[$role->rid] = $role->rid;
+      }
+      if (!empty($roles)) {
+        $result = db_query_range("SELECT u.name FROM {users} u LEFT JOIN {users_roles} r ON u.uid = r.uid WHERE r.rid IN (%s) AND u.status = 1 AND LOWER(name) LIKE LOWER('%s%%')", implode(', ', $roles), $string, 0, 10);
+        while ($user = db_fetch_object($result)) {
+          $matches[$user->name] = check_plain($user->name);
+        }
+      }
     }
   }
 
@@ -1649,7 +1658,7 @@ function support_status_form(&$form_state, $edit, $title) {
       user_access('administer support') || user_access('can administer state')) {
     $form['support'] = array(
       '#type' => 'fieldset',
-      '#prefix' => '<div class="container-inline">',
+      '#prefix' => '<div class="container-inline" id="control-panel">',
       '#suffix' => '</div>',
     );
   }
@@ -1729,6 +1738,11 @@ function support_status_form(&$form_state, $edit, $title) {
       '#title' => t('Client'),
       '#options' => $clients,
       '#default_value' => is_numeric($node->client) ? $node->client : 0,
+      '#ahah' => array(
+        'path' => 'support/update_ticket',
+        'wrapper' => 'control-panel',
+        'event' => 'change',
+      ),
     );
   }
   if (!user_access('can assign tickets to self') &&
@@ -2441,3 +2455,56 @@ function _support_access_tickets() {
   }
   return $count;
 }
+
+/**
+ * JS callback method when new client is selected, updating fields as is
+ * appropriate.
+ */
+function support_update_ticket_js() {
+  $form_state = array(
+    'storage' => NULL,
+    'submitted' => FALSE,
+    'rebuild' => TRUE,
+  );
+  $form_build_id = $_POST['form_build_id'];
+  $form = form_get_cache($form_build_id, $form_state);
+  $args = $form['#parameters'];
+  $form_id = array_shift($args);
+  $form_state['post'] = $form['#post'] = $_POST;
+  $form['#programmed'] = $form['#redirect'] = FALSE;
+
+  drupal_process_form($form_id, $form, $form_state);
+
+  // Get current $support form.
+  $support = $form['support'];
+  // Load node from database.
+  $nid = $form['nid']['#value'];
+  $node = node_load($nid);
+
+  $node->client = $support['client']['#value'];
+  $options = _support_assigned(0, $node, variable_get('support_autocomplete_limit', 15));
+  $assigned = $support['assigned']['#value'];
+  if ($options === FALSE) {
+    $support['assigned']['#autocomplete_path'] = 'support/autocomplete/assigned/'. $node->client;
+  }
+  else {
+    $support['assigned']['#options'] = $options;
+    // Be sure the currently assigned user is valid, otherwise assign to nobody.
+    // FIXME: This isn't working, so we get "An illegal choice has been..."
+    if (!isset($options[$assigned])) {
+      $support['assigned']['#value'] = 0;
+      $support['assigned']['#default_value'] = 0;
+    }
+  }
+
+  // Rebuild the form and cache it again.
+  $form = drupal_rebuild_form($form_id, $form_state, $args, $form_build_id);
+
+  // Build the HTML for the control panel.
+  drupal_json(
+    array(
+      'status' => TRUE,
+      'data' => theme('status_messages') . drupal_render($support),
+    ));
+  exit;
+}
