(function($){

	$.randomImage = {
		defaults: {

			//you can change these defaults to your own preferences.
			path: 'img/fotos/bocamp_2010/', //change this to the path of your images
			myImages: ['440_bocamp_Biketouren.jpg', '440_bocamp_Biketouren_(1).jpg', '440_bocamp_Biketouren_(2).jpg', '440_bocamp_Biketouren_(3).jpg', '440_bocamp_Geocachen_(1).jpg', '440_bocamp_Geocachen_(2).jpg', '440_bocamp_Geocachen_(4).jpg', '440_bocamp_Geocachen_(5).jpg', '440_bocamp_Gleitschirm.jpg', '440_bocamp_Gleitschirm_(3).jpg', '440_bocamp_Gleitschirm_(4).jpg', '440_bocamp_Gleitschirm_2.jpg', '440_bocamp_Gleitschirm_2_(1).jpg', '440_bocamp_Gleitschirm_2_(2).jpg', '440_bocamp_Testcenter_Bike.jpg', '440_bocamp_Testcenter_Bike_(1).jpg', '440_bocamp_Testcenter_Bike_(2).jpg', '440_bocamp_Testcenter_Bike_(3).jpg', '440_bocamp_Testcenter_Bike_(4).jpg', '440_bocamp_Wasserspiele.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);
