(function($) {
	$.fn.easySlideShow = function(config, options) {	  
		// default configuration properties
		var defaults = {
			pause:	5000
		};
		var options = $.extend(defaults, options);
		var length = config.length;
		var pos = 0;
		
		function switchPos(position)
		{
			// change image
			$("#img_slideshow").attr({src: config[pos].img, alt: config[pos].alt});
			// change url of the main image
			$("#url_slideshow").attr({href: config[pos].url});
			// change url of the info box
			$("#more_slideshow").attr({href: config[pos].url});
			// change title
			$("#title_slideshow").html(config[pos].title);
			// change quote
			$("#quote_slideshow").html(config[pos].quote);
		}
		
		function change()
		{
			pos += 1;
			if (pos >= length) {
				pos = 0;
			}
			
			switchPos(pos);
			timeout = setTimeout(function(){
						change();
					}, options.pause);
		};
	
		// for each element of the config
		// load images
		for (i = 0; i < length; i++) {
			var img = new Image();
			img.src = config[i].img;
			if ($("#img_slideshow").attr('src') == config[i].img) {
				pos = i;
			}
		}
		
		timeout = setTimeout(function(){
						change();
					}, options.pause);
		
	};

})(jQuery);