diff -up uc_out_of_stock/uc_out_of_stock.js.performance uc_out_of_stock/uc_out_of_stock.js
--- uc_out_of_stock/uc_out_of_stock.js.performance	2011-06-27 13:24:58.912664948 -0400
+++ uc_out_of_stock/uc_out_of_stock.js	2011-06-27 15:54:53.007661291 -0400
@@ -8,94 +8,102 @@ Drupal.behaviors.ucOutOfStock = {
 
     attrid = 'edit-attributes';
 
-    function checkStock(form) {
-      var product = new Object();
-      var attributes = new Object();
-      var formid_data = new Array();
-
-      product.nid = form.attr('id').match(/(?:uc-product-add-to-cart-form-|catalog-buy-it-now-form-)([0-9]+)/)[1];
-      attributes.found = new Object();
-      attributes.value = new Object();
-
-      $(":input[name*=attributes]:not(:text)", form).each(function(index){
-        id = $(this).attr('name').substring(11,$(this).attr('name').length-1);
-        if ($(this).is(':radio')) {
-          attributes.found['attr'+id] = 1;
-          if ($(this).is(':checked')) {
-            if ($(this).val()) {
-              attributes.value['attr'+id] = 1;
-              product['attr'+id] = $(this).val();
+    function checkStock(forms) {
+      var form_ids = new Array();
+      var node_ids = new Array();
+      var attr_ids = new Array();
+      $.each(forms, function(index, form) {
+        var product = new Object();
+        var attributes = new Object();
+        var formid_data = new Array();
+
+        var nid = form.attr('id').match(/(?:uc-product-add-to-cart-form-|catalog-buy-it-now-form-)([0-9]+)/)[1];
+
+        attributes.found = new Object();
+        attributes.value = new Object();
+
+        $(":input[@name*=attributes]:not(:text)", form).each(function(index){
+          id = $(this).attr('name').substring(11,$(this).attr('name').length-1);
+          if ($(this).is(':radio')) {
+            attributes.found['attr'+id] = 1;
+            if ($(this).is(':checked')) {
+              if ($(this).val()) {
+                attributes.value['attr'+id] = 1;
+                attr_ids.push(nid + ':' + id + ':' + $(this).val());
+              }
             }
           }
-        } else {
-        attributes.found['attr'+id] = 1;
-          if ($(this).val()) {
-            attributes.value['attr'+id] = 1;
-            product['attr'+id] = $(this).val();
-          }
-        }
-      });
+          else {
+            attributes.found['attr'+id] = 1;
+              if ($(this).val()) {
+                attributes.value['attr'+id] = 1;
+                attr_ids.push(nid + ':' + id + ':' + $(this).val());
+              }
+            }
+        });
 
-      // find qty
-      product['qty'] = 1;
-      qty = $(":input[name=qty]", form).val()
-      if (qty) {
-        product['qty'] = qty;
-      }
+        // find qty
+        product['qty'] = 1;
+        qty = $(":input[name=qty]", form).val()
+        if (qty) {
+          product['qty'] = qty;
+        }
 
-      // finding if attributes are found with no value
-      attributes.found.length = attributes.value.length = 0;
-      for (var i in attributes.found) {
-        if (i!='length') {
-          attributes.found.length++;
+        // finding if attributes are found with no value
+        attributes.found.length = attributes.value.length = 0;
+        for (var i in attributes.found) {
+          if (i!='length') {
+            attributes.found.length++;
+          }
         }
-      }
-      for (var i in attributes.value) {
-        if (i!='length') {
-          attributes.value.length++;
+        for (var i in attributes.value) {
+          if (i!='length') {
+            attributes.value.length++;
+          }
         }
-      }
-      if (attributes.found.length != attributes.value.length) {
-        // Put back the normal HTML of the add to cart form
-        $(".uc_out_of_stock_html", form).html('');
-        $("input:submit.node-add-to-cart,input:submit.list-add-to-cart", form).show();
-        return;
-      }
-
-      $(".uc_out_of_stock_throbbing", form).addClass('uc_oos_throbbing');
-      $.post(Drupal.settings.basePath+'uc_out_of_stock/query', product, function (data, textStatus) {
-        // textStatus can be one of:
-        //   "timeout"
-        //   "error"
-        //   "notmodified"
-        //   "success"
-        //   "parsererror"
-        data = data.split('|');
-        stock = data[0];
-        if (stock == parseInt(stock) && stock <= 0 && data.length == 2) {
-          html = data[1];
-          $("input:submit.node-add-to-cart,input:submit.list-add-to-cart", form).hide();
-          $(".uc_out_of_stock_html", form).html(html);
-        } else {
+        if (attributes.found.length != attributes.value.length) {
           // Put back the normal HTML of the add to cart form
           $(".uc_out_of_stock_html", form).html('');
           $("input:submit.node-add-to-cart,input:submit.list-add-to-cart", form).show();
-        }
+          return;
+
+         }
 
-        $(".uc_out_of_stock_throbbing", form).removeClass('uc_oos_throbbing');
+        $(".uc_out_of_stock_throbbing", form).addClass('uc_oos_throbbing');
+        form_ids.push(form.attr('id'));
+        node_ids.push(nid);
       });
-    }
 
-    $("form[id*=uc-product-add-to-cart-form]").each(function(index) {
-      var eachForm;
-      $("input:submit.node-add-to-cart,input:submit.list-add-to-cart", $(this)).before('<div class="uc_out_of_stock_throbbing">&nbsp;&nbsp;&nbsp;&nbsp;</div> ');
-      $("input:submit.node-add-to-cart,input:submit.list-add-to-cart", $(this)).after('<div class="uc_out_of_stock_html"></div');
+      if (form_ids.length == 0) {
+        return;
+      }
+      var post = { 'form_ids[]': form_ids, 'node_ids[]': node_ids, 'attr_ids[]': attr_ids }
+      $.post(Drupal.settings.basePath+'uc_out_of_stock/query', post, function (data, textStatus) {
+        $.each(data, function(form_id, stock_level) {
+          var form = $('#' + form_id);
+          if (stock_level != null && parseInt(stock_level) <= 0) {
+            $("input:submit.node-add-to-cart,input:submit.list-add-to-cart", form).hide();
+            $(".uc_out_of_stock_html", form).html(Drupal.settings.uc_out_of_stock.msg);
+          }
+          else {
+            // Put back the normal HTML of the add to cart form
+            $(".uc_out_of_stock_html", form).html('');
+            $("input:submit.node-add-to-cart,input:submit.list-add-to-cart", form).show();
+          }
+          $(".uc_out_of_stock_throbbing", form).removeClass('uc_oos_throbbing');
+        });
+      }, 'json');
+    }
 
-      eachForm = $(this);
-      checkStock(eachForm);
+    var forms = new Array();
+    $("form[id*=uc-product-add-to-cart-form], form[id*=uc-catalog-buy-it-now-form]").each(function(index) {
+      forms.push($(this));
+      $("input:submit.node-add-to-cart,input:submit.list-add-to-cart", $(this)).before('<div class="uc_out_of_stock_throbbing">&nbsp;&nbsp;&nbsp;&nbsp;</div>');
+      $("input:submit.node-add-to-cart,input:submit.list-add-to-cart", $(this)).after('<div class="uc_out_of_stock_html"></div>');
+      var form = $(this);
 
       $(":input[name*=attributes]:not(:text)", $(this)).change(function(){
-        checkStock(eachForm);
+        checkStock([form]);
       });
       /* TODO: Feature request - support qty field, would make sense if cart
        * contents are checked in the server as well as just stock
@@ -105,15 +113,8 @@ Drupal.behaviors.ucOutOfStock = {
         checkStock(eachForm);
       });
       */
-    });
-
-    $("form[id*=uc-catalog-buy-it-now-form]").each(function(index) {
-      var eachForm;
-      $("input:submit.node-add-to-cart,input:submit.list-add-to-cart", $(this)).before('<div class="uc_out_of_stock_throbbing">&nbsp;&nbsp;&nbsp;&nbsp;</div> ');
-      $("input:submit.node-add-to-cart,input:submit.list-add-to-cart", $(this)).after('<div class="uc_out_of_stock_html"></div');
 
-      eachForm = $(this);
-      checkStock(eachForm);
+      checkStock(forms);
 
       // This form has no possible attributes
     });
diff -up uc_out_of_stock/uc_out_of_stock.module.performance uc_out_of_stock/uc_out_of_stock.module
--- uc_out_of_stock/uc_out_of_stock.module.performance	2011-06-27 14:45:55.992714845 -0400
+++ uc_out_of_stock/uc_out_of_stock.module	2011-06-27 15:41:45.415660936 -0400
@@ -10,11 +10,19 @@ define ('UC_OUT_OF_STOCK_DEFAULT_HTML', 
  * Implementation of hook_form_alter()
  */
 function uc_out_of_stock_form_alter(&$form, $form_state, $form_id) {
+  static $added_setting;
   $forms = array('uc_product_add_to_cart_form', 'uc_catalog_buy_it_now_form');
   foreach ($forms as $id) {
     if ( substr($form_id, 0, strlen($id)) == $id ) {
       drupal_add_js(drupal_get_path('module', 'uc_out_of_stock') . '/uc_out_of_stock.js');
       drupal_add_css(drupal_get_path('module', 'uc_out_of_stock') . '/uc_out_of_stock.css');
+      if (!isset($added_setting)) {
+        drupal_add_js(array(
+          'uc_out_of_stock' => array(
+            'msg' => check_markup(variable_get('uc_out_of_stock_text', UC_OUT_OF_STOCK_DEFAULT_HTML), variable_get('uc_out_of_stock_format', filter_fallback_format()), FALSE),
+        )), 'setting');
+        $added_setting = TRUE;
+      }
       $form['#validate'][] = 'uc_out_of_stock_validate_form_addtocart';
     }
   }
@@ -137,29 +145,50 @@ function uc_out_of_stock_getstockinfo($n
   return $stockinfo;
 }
 
+/**
+ * Called via AJAX to determine stock for one or more products
+ * Expects the following variables:
+ * $_POST['form_ids'] => An array of form ids
+ * $_POST['node_ids'] => A corresponding array of node ids
+ * $_POST['attr_ids'] => An array of nid:attrib_id:value based on the attribute selected
+ *
+ * Returns an array of array(form ids => stock value or NULL)
+ */
 function uc_out_of_stock_query() {
-  $response = array();
-  $attrs = array();
-
-  $nid = $_POST['nid'];
-  foreach ( $_POST as $key => $value ) {
-    if ( substr($key, 0, 4) == 'attr' ) {
-      $attrs[substr($key, 4)] = $value;
-    }
+  if (count($_POST['form_ids']) != count($_POST['node_ids'])) {
+    print 'Invalid data posted.';
   }
 
-  $stockinfo = uc_out_of_stock_getstockinfo($nid, $attrs);
-  if ($stockinfo) {
-    $response['stock'] = $stockinfo['stock'];
-    if ( $response['stock'] <= 0 ) {
-      $response['html'] = check_markup(variable_get('uc_out_of_stock_text', UC_OUT_OF_STOCK_DEFAULT_HTML), variable_get('uc_out_of_stock_format', FILTER_FORMAT_DEFAULT), FALSE);
+  $return = array_combine($_POST['form_ids'], array_fill(0, count($_POST['form_ids']), NULL));
+  // If no attributes given we can do one query to fetch everything
+  if (empty($_POST['attr_ids'])) {
+    $result = db_query('SELECT ups.stock, up.nid
+                        FROM {uc_products} up
+                        LEFT JOIN {uc_product_stock} ups ON ups.sku = up.model
+                        WHERE up.nid IN(:nids)
+				AND ups.active = 1', array(':nids' => $_POST['node_ids']));
+    foreach ($result->fetchAll() as $product) {
+      $key = array_search($product->nid, $_POST['node_ids']);
+      $return[$_POST['form_ids'][$key]] = $product->stock;
+    }
+  }
+  else {
+    $attribs = array();
+    foreach ($_POST['attr_ids'] as $value) {
+      list($nid, $attr_id, $attr_val) = explode(':', $value);
+      $attribs[$nid][$attr_id] = $attr_val;
+    }
+
+    foreach ($_POST['node_ids'] as $key => $nid) {
+      $stockinfo = uc_out_of_stock_getstockinfo($nid, (array) $attribs[$nid]);
+      if ($stockinfo) {
+        $return[$_POST['form_ids'][$key]] = $stockinfo['stock'];
+      }
     }
   }
 
-  // if there is some response, print it
-  if (count($response)){
-    print implode('|', $response);
-  }
+  print drupal_json_encode($return);
+  exit;
 }
 
 function uc_out_of_stock_settings() {
