Index: uc_aac.module
===================================================================
RCS file: /cvs/drupal-contrib/contributions/modules/uc_aac/uc_aac.module,v
retrieving revision 1.10.2.3
diff -u -p -r1.10.2.3 uc_aac.module
--- uc_aac.module	11 Nov 2009 00:46:04 -0000	1.10.2.3
+++ uc_aac.module	13 Nov 2009 01:00:13 -0000
@@ -36,10 +36,16 @@ function uc_aac_menu() {
  */
 function uc_aac_form_alter(&$form, $form_state, $form_id) {
   if (strstr($form_id, 'uc_product_add_to_cart_form_')) {
-    drupal_add_js('misc/jquery.form.js');
-    drupal_add_js(drupal_get_path('module', 'uc_aac') .'/uc_aac.js');
-    // Call uc_aac_calculate once for each form on page load
-    drupal_add_js("$('.attributes').find('[@name^=attributes]:first').each(function(i) { uc_aac_calculate(this); });", 'inline', 'footer');
+    static $uc_aac_js = false;
+
+    if (!$uc_aac_js) {
+      $uc_aac_js = true;
+
+      drupal_add_js('misc/jquery.form.js');
+      drupal_add_js(drupal_get_path('module', 'uc_aac') .'/uc_aac.js');
+      // Call uc_aac_calculate once for each form on page load
+      drupal_add_js("$('.attributes').find('[@name^=attributes]:first').each(function(i) { uc_aac_calculate(this); });", 'inline', 'footer');
+    }
 
     // If reprice is enabled and price adjustments are to be displayed
     if (variable_get('uc_aac_reprice', 1) == 1 && variable_get('uc_attribute_option_price_format', 'adjustment') == 'adjustment') {
