(function($){
	
	$.randomImage = {
		defaults: {
			
			//you can change these defaults to your own preferences.
			path: 'images/logo', //change this to the path of your images
			myImages: ['saph-logo-1.png', 'saph-logo-2.png', 'saph-logo-3.png', 'saph-logo-4.png', 'saph-logo-5.png','saph-logo-6.png', 'saph-logo-7.png', 'saph-logo-8.png', 'saph-logo-9.png', 'saph-logo-10.png','saph-logo-11.png', 'saph-logo-12.png', 'saph-logo-13.png', 'saph-logo-14.png', 'saph-logo-15.png','saph-logo-16.png', 'saph-logo-17.png', 'saph-logo-18.png', 'saph-logo-19.png', 'saph-logo-20.png', 'saph-logo-21.png'] 
			
		}			
	}
	
	$.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);
