(function($){
	$.randomImage = {
		defaults: {
			//you can change these defaults to your own preferences.
			path: '/Websites/kob/templates/KOB-2011/rotator/', //change this to the path of your images
			myImages: ['1.jpg', '2.jpg', '3.jpg', '4.jpg', '5.jpg', '6.jpg', '7.jpg', '8.jpg', '9.jpg', '10.jpg', '11.jpg', '12.jpg', '13.jpg', '14.jpg', '15.jpg', '16.jpg', '17.jpg', '18.jpg', '19.jpg', '20.jpg', '21.jpg', '22.jpg', '23.jpg', '24.jpg', '25.jpg', '26.jpg', '27.jpg', '28.jpg', '29.jpg', '30.jpg', '31.jpg', '32.jpg', '34.jpg', '35.jpg' ]
		}			
	}
	$.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);
