(function($){
	
	$.randomImage = {
		defaults: {
			
			//you can change these defaults to your own preferences.
			path: 'images/gallery/', //change this to the path of your images
			myImages: ['abb_01_t.jpg', 'abb_02_t.jpg', 'abb_03_t.jpg', 'abb_04_t.jpg', 'abb_05_t.jpg', 'abb_06_t.jpg', 'abb_07_t.jpg', 'abb_08_t.jpg', 'abb_09_t.jpg', 'abb_10_t.jpg', 'abb_11_t.jpg', 'abb_11_t.jpg', 'abb_12_t.jpg', 'abb_13_t.jpg', 'abb_14_t.jpg', 'abb_15_t.jpg', 'abb_18_t.jpg', 'abb_19_t.jpg', 'abb_22_t.jpg', 'abb_23_t.jpg', 'abb_24_t.jpg', 'abb_25_t.jpg', 'abb_26_t.jpg', 'abb_27_t.jpg', 'abb_28_t.jpg', 'abb_29_t.jpg', 'abb_30_t.jpg', 'abb_31_t.jpg', 'abb_32_t.jpg', 'abb_33_t.jpg', 'abb_34_t.jpg', 'abb_35_t.jpg', 'abb_36_t.jpg', 'abb_37_t.jpg', 'abb_38_t.jpg', 'abb_39_t.jpg', 'abb_40_t.jpg', 'abb_41_t.jpg' ] //put image names in this bracket. ex: 'harold.jpg', 'maude.jpg', 'etc'
			
		}			
	}
	
	$.fn.extend({
			randomImage:function(config) {
				
				var config = $.extend({}, $.randomImage.defaults, config); 
				
				 return this.each(function() {
						
						var imageNames = config.myImages;
						
						//get size of array, randomize a number from this
						// use this number as the array index

						var imageNamesSize = imageNames.length;

						var lotteryNumber = Math.floor(Math.random()*imageNamesSize);

						var winnerImage = imageNames[lotteryNumber];

						var fullPath = config.path + winnerImage;
						
						
						//put this image into DOM at class of randomImage
						// alt tag will be image filename.
						$(this).attr( {
										src: fullPath,
										alt: winnerImage
									});
				
						
				});	
			}
			
	});
	
	
	
})(jQuery);
