Index: jskitcomments.module
===================================================================
RCS file: /cvs/drupal-contrib/contributions/modules/jskitcomments/jskitcomments.module,v
retrieving revision 1.2
diff -u -r1.2 jskitcomments.module
--- jskitcomments.module	11 May 2009 11:21:34 -0000	1.2
+++ jskitcomments.module	14 Jul 2009 18:03:50 -0000
@@ -88,16 +88,6 @@
 }
 
 /**
- * Implementation of hook_footer().
- */
-function jskitcomments_footer($main = 0) {
-  $node = menu_get_object();
-  if (isset($node) && isset($node->jskitcomments)) {
-    return theme('jskitcomments_footer');
-  }
-}
-
-/**
  * Implementation of hook_theme().
  */
 function jskitcomments_theme() {
@@ -116,9 +106,6 @@
         'attributes' => NULL
       ),
     ),
-    'jskitcomments_footer' => array(
-      'arguments' => array(),
-	 ),
   );
 }
 
@@ -170,15 +157,6 @@
 }
 
 /**
- * Renders the supporting JavaScript for JS-Kit Comments just before the </body> tag.
- * Themes can overide this function to do more complex customizations of JS-Kit Comments
- * Add custom style tags after this script!
- */
-function theme_jskitcomments_footer() {
-  return '<script src="http://js-kit.com/comments.js"></script>';
-}
-
-/**
  * Generate the JS-Kit comments script tag for the node with the specified theme hook.
  * 
  * @param $node
@@ -235,6 +213,10 @@
   if (!empty($flashcolor)) {
     $attributes['flashColor'] = check_plain('#'.$flashcolor);
   }
+
+  // Add the JavaScript to process the JS-Kit API.
+  drupal_add_js(drupal_get_path('module', 'jskitcomments') .'/jskitcomments.js');
+
   return theme($hook, $path, $permalink, $attributes);
 }
 
Index: jskitcomments.js
===================================================================
RCS file: jskitcomments.js
diff -N jskitcomments.js
--- /dev/null	1 Jan 1970 00:00:00 -0000
+++ jskitcomments.js	1 Jan 1970 00:00:00 -0000
@@ -0,0 +1,17 @@
+// $Id$
+
+/**
+ * Drupal JS-Kit behaviors.
+ */
+Drupal.behaviors.jskitcomments = function(context) {
+  // Only process the JS-Kit comments once per page.
+  $('body:not(.jskitcomments-processed)').addClass('jskitcomments-processed').each(function() {
+    // Make the AJAX call for the JS-Kit comments.
+    jQuery.ajax({
+      type: 'GET',
+      url: 'http://js-kit.com/comments.js',
+      dataType: 'script',
+      cache: true
+    });
+  });
+};
