Index: active_tags.js
===================================================================
RCS file: /cvs/drupal-contrib/contributions/modules/active_tags/active_tags.js,v
retrieving revision 1.1.2.17
diff -u -p -r1.1.2.17 active_tags.js
--- active_tags.js	17 Oct 2009 17:42:38 -0000	1.1.2.17
+++ active_tags.js	27 Nov 2009 13:07:03 -0000
@@ -20,10 +20,10 @@ function activeTagsParseCsv(sep, string)
   return result;
 }
 
-function activeTagsActivate(context) {
+function activeTagsActivate(index, context) {
   var wrapper = $(context);
   if (wrapper.length == 1) {
-    var tagarea = activeTagsWidget(context);
+    var tagarea = activeTagsWidget(index, context);
     wrapper.before(tagarea);
     Drupal.behaviors.autocomplete(document);
   }
@@ -95,9 +95,9 @@ function activeTagsUpdate(context) {
   });
 }
 
-function activeTagsWidget(context) {
-  var vid = context.substring(20, context.lastIndexOf('-'));
-  return Drupal.theme('activeTagsWidget', context, vid);
+function activeTagsWidget(index, context) {
+  var matches = context.match(/(\d+)-wrapper$/);
+  return Drupal.theme('activeTagsWidget', index, context, matches[1]);
 }
 
 function activeTagsAddTagOnSubmit() {
@@ -114,7 +114,7 @@ Drupal.theme.prototype.activeTagsTerm = 
 /**
  * Theme Active Tags widget.
  */
-Drupal.theme.prototype.activeTagsWidget = function(context, vid) {
+Drupal.theme.prototype.activeTagsWidget = function(index, context, vid) {
   var wrapper = $(context);
   var cleanId = context.replace('#', '');
   // Change default taxonomy description to reflect AT style workflow.
@@ -125,9 +125,9 @@ Drupal.theme.prototype.activeTagsWidget 
   return '<div id="' + cleanId + '-activetags" class="form-item">' +
     '<label for="' + context + '-edit-tags">' + wrapper.find('label').text() + '</label>' +
     '<div class="tag-holder"></div>' +
-    '<input type="text" class="tag-entry form-autocomplete" size="30" id="active-tag-edit0' + vid + '" />' +
+    '<input type="text" class="tag-entry form-autocomplete" size="30" id="active-tag-edit0' + vid + '-' + index + '" />' +
     '<input type="button" value="' + Drupal.t('Add') + '" class="add-tag" />' +
-    '<input class="autocomplete" type="hidden" id="active-tag-edit0' + vid + '-autocomplete" ' +
+    '<input class="autocomplete" type="hidden" id="active-tag-edit0' + vid + '-' + index + '-autocomplete" ' +
     'value="' + $(context.replace('-wrapper', '-autocomplete')).val() + '" disabled="disabled" />' +
     '<div class="description">' + desc + '</div>' +
   '</div>';
@@ -137,7 +137,7 @@ Drupal.behaviors.tagger = function(conte
   jQuery.each(Drupal.settings['active_tags'], function(i, v) {
     var wrapper = $(v);
     if (wrapper.length == 1 && !wrapper.hasClass('active-tags-processed')) {
-      activeTagsActivate(v);
+      activeTagsActivate(i, v);
       wrapper.addClass('active-tags-processed');
     }
   });
