		(function( $ ){
			$.fn.contentRotator = function(options){
				// set default config options
				var defaults = {
					wrapper_class: 'bttn_scroller_img',
					group_size: 3,
					random: true,
					duration_in: 300,
					duration_out: 300,
					delay: 2000,
					pause_on_rollover: true
				};
				
				// set methods
				var methods = {
					// this method will switch to the next option
					next: function(ob){					
						// if the size of the content array is 0, reset
						if(content.length < 1){
							content = showed;
							showed = [];
						}
						// if the sizeof the overall content array is less then the group size, but still greater than 0
						if(content.length < opts.group_size){
							// if the showed size is > 0
							var tosize = (opts.group_size > showed.length) ? showed.length : opts.group_size;
							for(i=content.length; i < tosize; i++){
								if(opts.random == true){
									add_entry = Math.floor(Math.random() * showed.length);
								}
								else{
									add_entry = 0;
								}
								content.push(showed[add_entry]);
								showed.splice(add_entry,1);
							}				
						}
					
						// grab the group to show
						var current = [];
						for(i=0; i<opts.group_size;i++){
							// determine the index of the image
							if(opts.random == true){
								current_entry = Math.floor(Math.random() * content.length);
							}
							else{
								current_entry = 0;
							}
							
							// update arrays to reflect the pulled image
							current[i] = content[current_entry];
							showed.push(content[current_entry]);
							content.splice(current_entry,1);
						}
						
						// transition to the new group
						ob.fadeOut(opts.duration_out, function(){
							ob.find('.' + opts.wrapper_class).remove();
							for(i=0; i < current.length; i++)
							{
								ob.append(current[i]);
							}
							ob.fadeIn(opts.duration_in);
						});
					}
				};
				
				// placeholder for interval
				var interval;
				
				// update options to include arguments
				var opts = $.extend(defaults, options);

				// array of initialized content groups
				var content = [];
				var showed = [];
				
				// handle the stuff
				return this.each(function(){
					// make reference to THIS
					$this = $(this);
					
					// hide all images
					//$this.find('.' + opts.wrapper_class).hide();
					
					// throw them all in the groups array
					$.extend(content,$this.find('.' + opts.wrapper_class));
					
					$this.find('.' + opts.wrapper_class).remove();
					
					// start rotating (if we have anything to show
					if(content.length > 0){
						methods.next($this)
						interval = setInterval(function(){	methods.next($this)}, opts.delay);
						if(opts.pause_on_rollover == true){
							$this.mouseover(function(){
								clearInterval(interval);
							});
							$this.mouseout(function(){	
								interval = setInterval(function(){	methods.next($this)}, opts.delay);
							});
						}
					}
				});		
			};
		})(jQuery);

		// example
		$(document).ready(function(){
			// preload images
			var cache = [];
			var imgCount = $('#button_scroller img').length -1;
			$('#button_scroller').hide();
			$('#button_scroller img').each(function(i){
				var cacheImage = document.createElement('img');
				cacheImage.src = $(this).attr('src');
				cache.push(cacheImage);
				if(i == imgCount){
					$('#button_scroller').contentRotator({
						wrapper_class: 'bttn_scroller_img',
						group_size: 3,
						random: true,
						duration_in: 300,
						duration_out: 300,
						delay: 8000,
						pause_on_rollover: true
					});
				}
			});
		});
