diff --git a/colorbox_node.js b/colorbox_node.js
index 3b14519..f2c9660 100644
--- a/colorbox_node.js
+++ b/colorbox_node.js
@@ -32,6 +32,7 @@
 		
 		    $('.colorbox-node', context).once('init-colorbox-node-processed', function() {
 		    	var href = $(this).attr('data-href');
+
 		    	if(typeof href == 'undefined' || href == false) {
 		    		href = $(this).attr('href');
 		    	}
@@ -61,14 +62,18 @@
 				// and displays the colorbox loading screen instead.
 				element_settings.progress = { 'type': 'none' };
 				$(this).click(function() {
-					var params = $.urlParams($(this).attr('href'));
+                   $this = $(this);
+					var params = $.urlParams(href);
 					params.html = '<div id="colorboxNodeLoading"></div>';
+                    params.onComplete = function() {
+                        $this.colorboxNodeGroup();
+                    }
 			        $.colorbox($.extend({}, settings.colorbox, params));
 				});
 	
 			    // For anchor tags, these will go to the target of the anchor rather
 			    // than the usual location.
-			    if ($(this).attr('href')) {
+			    if (href) {
 			    	element_settings.url = link;
 			    	element_settings.event = 'click';
 			    }
@@ -83,4 +88,79 @@
 			});
 		}
 	};
+
+    $.fn.colorboxNode = function() {
+        var href = $(this).attr('data-href');
+        if(typeof href == 'undefined' || href == false) {
+            href = $(this).attr('href');
+        }
+        // Create an element so we can parse our a URL no matter if its internal or external.
+        var parse = document.createElement('a');
+        parse.href = href;
+        // Lets add our colorbox link after the base path if necessary.
+        var base_path = Drupal.settings.basePath;
+        var pathname = parse.pathname;
+
+        // Lets check to see if the pathname has a forward slash.
+        // This problem happens in IE7/IE8
+        if(pathname.charAt(0) != '/') {
+            pathname = '/' + parse.pathname;
+        }
+
+        if(base_path != '/') {
+            var link = pathname.replace(base_path, base_path + 'colorbox/') + parse.search;
+        } else {
+            var link = base_path + 'colorbox' + pathname + parse.search;
+        }
+
+        // Bind Ajax behaviors to all items showing the class.
+        var element_settings = {};
+
+        // This removes any loading/progress bar on the clicked link
+        // and displays the colorbox loading screen instead.
+        element_settings.progress = { 'type': 'none' };
+        var params = $.urlParams(href);
+        params.html = '<div id="colorboxNodeLoading"></div>';
+        $.colorbox($.extend({}, Drupal.settings.colorbox, params));
+
+        // For anchor tags, these will go to the target of the anchor rather
+        // than the usual location.
+        if (href) {
+            element_settings.url = link;
+            element_settings.event = 'click';
+        }
+        var base = $(this).attr('id');
+        myAjax = new Drupal.ajax(base, this, element_settings);
+        myAjax.eventResponse(this, 'click')
+    }
+
+
+    $.fn.colorboxNodeGroup = function() {
+        // Lets do something wonky with galleries.
+        var rel = $(this).attr('rel');
+        if($('a[rel="'+ rel +'"]:not("#colorbox a[rel="'+ rel +'"]")').length > 1) {
+            $related = $('a[rel="'+ rel +'"]:not("#colorbox a[rel="'+ rel +'"]")');
+            var idx = $related.index($(this));
+
+            // Show our gallery buttons
+            $('#cboxPrevious, #cboxNext').show();
+            $.colorbox.next = function() {
+                index = getIndex(1);
+                $related[index].click();
+
+            };
+            $.colorbox.prev = function() {
+                index = getIndex(-1);
+                $related[index].click();
+            };
+        }
+
+        function getIndex(increment) {
+            var max = $related.length;
+            var newIndex = (idx + increment) % max;
+            return (newIndex < 0) ? max + newIndex : newIndex;
+        }
+    }
+
+
 })(jQuery);
