diff --git a/js/jcarousel.js b/js/jcarousel.js
index a8c2375..f0c24ec 100644
--- a/js/jcarousel.js
+++ b/js/jcarousel.js
@@ -51,24 +51,23 @@ Drupal.behaviors.jcarousel.attach = function(context, settings) {
           var i;
           var numPages;
 
-          for (i = 1, numPages = Math.ceil($('li', carousel.list).length / pageSize); i <= numPages; i++) {
-            navigation.append('<li><a href="javascript:void()">' + i + '</a></li>');
+          for (i = 0, numPages = Math.ceil($('li', carousel.list).length / pageSize); i < numPages; i++) {
+            var pagerItem = $(Drupal.theme('jCarouselButton', 'navigation', i)).attr('jCarousel-index', i);
+            navigation.append('<li></li>').append(pagerItem);
+            pagerItem.bind('click', function() {
+              // Need to scroll to the first item in that page, which means we
+              // need to add one more to the value to get the item to scroll to
+              // in order to get to that particular page.  Weird but true.
+$(this).addClass('active').parent().siblings().children('.active').removeClass('active');
+              carousel.scroll($(this).attr('jCarousel-index') * pageSize + 1);
+              return false;
+            });
+
+            // Make the first page active by default.
+            if (i === 1) {
+              pagerItem.addClass('active');
+            }
           }
-          navigation.find('a').bind('click', function() {
-            // The number in the field is going to be one higher than the page
-            // number we want to scroll to, since that will be 0-based. But we
-            // need to scroll to the first item in that page, which means we
-            // need to add one more to the value to get the item to scroll to
-            // in order to get to that particular page.  Weird but true.
-            var target = $(this);
-            var scrollTo = ($.jcarousel.intval(target.text()) - 1) * pageSize + 1;
-            target.addClass('active').parents('ul').find('a').not(target).removeClass('active');
-            carousel.scroll(scrollTo);
-            return false;
-          });
-
-          // Make the first page active by default.
-          navigation.find('a:first').addClass('active');
 
           return navigation;
         });
@@ -85,10 +84,9 @@ Drupal.behaviors.jcarousel.attach = function(context, settings) {
       };
     }
 
-    // Change next and previous buttons to links for accessibility.
     if (!options.hasOwnProperty('buttonNextHTML') && !options.hasOwnProperty('buttonPrevHTML')) {
-      options.buttonNextHTML = '<a href="javascript:void(0)"></a>';
-      options.buttonPrevHTML = '<a href="javascript:void(0)"></a>';
+      options.buttonNextHTML = Drupal.theme('jCarouselButton', 'next');
+      options.buttonPrevHTML = Drupal.theme('jCarouselButton', 'previous');
     }
 
     // Initialize the jcarousel.
@@ -209,4 +207,9 @@ Drupal.jcarousel.ajaxErrorCallback = function (xhr, path) {
   alert(Drupal.t("An error occurred at @path.\n\nError Description: @error", {'@path': path, '@error': error_text}));
 };
 
+Drupal.theme.prototype.jCarouselButton = function(type, page) {
+  // Use links for buttons for accessibility.
+  return '<a href="javascript:void()"></a>';
+};
+
 })(jQuery);
