//shuffle plugin
// (function($){
	// $.shuffle = function(arr) {//for shuffling native arrays, does not modify original array
		// var newArr = [], indices = [], i, index;
		// if (arr.length) {
			// for (i = 0; i < arr.length; i++)
				// indices.push(i);
			// while (indices.length) {
				// i = Math.round(101 * Math.random()) % indices.length;
				// index = indices[i];
				// indices.splice(i, 1);
				// newArr.push(arr[index]);
			// }
		// }
		// return newArr;
	// }
	
	// jQuery.fn.shuffle = function(reorder) {
		// return this.pushStack($.shuffle(this.get()));
	// };
// })(jQuery);


$(function() {
var timer;
var fader_count = 0;
//var $slides = $(".slides li").shuffle();
var $slides = $(".slides li");//uncomment the line above, and comment this one to make it shuffle (and obviously uncomment shuffle block above)
function fader_exec()
{
     clearTimeout(timer);
     
	 $slides.css("visibility","hidden");
     $slides.eq(fader_count).css("opacity","0").css("visibility","visible").animate({"opacity":1}, 600, "linear", null);
     
     fader_count = ++fader_count % $slides.length;
     
     timer = setTimeout(fader_exec,"4000");
}

fader_exec();
});

