Index: mollom.js
===================================================================
RCS file: /cvs/drupal-contrib/contributions/modules/mollom/mollom.js,v
retrieving revision 1.2
diff -u -p -r1.2 mollom.js
--- mollom.js	31 Mar 2008 12:49:52 -0000	1.2
+++ mollom.js	15 Jun 2008 21:23:18 -0000
@@ -1,9 +1,9 @@
+// $Id: $
 
-if (Drupal.jsEnabled) {
-  $(function() {
-    $('a#audio-captcha').click(getAudioCaptcha);
-    $('a#image-captcha').click(getImageCaptcha);
-  });
+Drupal.behaviors.mollom = function() {
+  // Add onclick.event handlers for CAPTCHA links:
+  $('a#audio-captcha').click(getAudioCaptcha);
+  $('a#image-captcha').click(getImageCaptcha);
 }
 
 function getAudioCaptcha() {
@@ -11,11 +11,11 @@ function getAudioCaptcha() {
   var mollomSessionId = $("input#edit-session-id").val();
 
   // Retrieve an audio CAPTCHA:
-  var data = $.get(Drupal.settings.basePath +'mollom/captcha/audio/' + mollomSessionId,
+  var data = $.get(Drupal.settings.basePath + 'mollom/captcha/audio/' + mollomSessionId,
     function(data) {
-     // When data is successfully loaded, empty the captcha-div  
-     // and replace its content with an audio CAPTCHA:
-     $('div#captcha').empty().append(data);
+     // When data is successfully loaded, replace
+     // contents of captcha-div with an audio CAPTCHA:
+     $('div#captcha').html(data);
 
      // Add an onclick-event handler for the new link:
      $('a#image-captcha').click(getImageCaptcha);
@@ -26,12 +26,12 @@ function getImageCaptcha() {
   // Extract the Mollom session ID from the form:
   var mollomSessionId = $('input#edit-session-id').val();
 
-  // Retrieve an audio CAPTCHA:
+  // Retrieve an image CAPTCHA:
   var data = $.get(Drupal.settings.basePath + 'mollom/captcha/image/' + mollomSessionId,
     function(data) {
-     // When data is successfully loaded, empty the captcha-div  
-     // and replace its content with an audio CAPTCHA:
-     $('div#captcha').empty().append(data);
+     // When data is successfully loaded, replace
+     // contents of captcha-div with an image CAPTCHA:
+     $('div#captcha').html(data);
      
      // Add an onclick-event handler for the new link:
      $('a#audio-captcha').click(getAudioCaptcha);
