	$(function(){
		$('#slides').slides({
			preload: true,
			fadeSpeed: 650,
			preloadImage: 'img/loading.gif',
			effect: 'fade',
			crossfade: false,
			play: 5100,//5100,
			pause: 5180,//5200,
			hoverPause: true,
			animationStart: function(current){
				$('.caption').animate({
					bottom:-35
				},100);
				if (window.console && console.log) {
					// example return of current slide number
					console.log('animationStart on slide: ', current);
				};
			},
			animationComplete: function(current){
				$('.caption').animate({
					bottom:0
				},200);
				if (window.console && console.log) {
					// example return of current slide number
					console.log('animationComplete on slide: ', current);
				};
			},
			slidesLoaded: function() {
				$('.caption').animate({
					bottom:0
				},200);
			}
		});
	});
	
	$(function(){
		var counter = 0,
		divs = $('#box1, #box2, #box3, #box4, #box5');
		
		divs.hide(); //hide all divs
		
		function showDiv () {
			//divs.hide() //hide all divs
			divs.filter(function (index) { return index == counter % 5; }) // figure out correct div to show
				.fadeIn(); // and show it
			
			counter++;
			if(counter==6) {
				counter = 0;
				divs.hide(); //hide it again
			}
			
		}; // function to loop through divs and show correct div
		
		
		showDiv(); // show first div    
		
		setInterval(function () {
			showDiv(); // show next div
		}, 1 * 950); // do this every 10 seconds
				
	});
