$(function(){
	//
	$('#slides').slides({
		preload: true,
		preloadImage: 'assets/images/slides/loading.gif',				
		pause: 500,
		play: 5000,
		hoverPause: true,
		animationStart: function(current) {					 		
			$('.caption, .fade-contents').animate({opacity:0},100);				
		},				
		animationComplete: function(current) {				
			// slide listener to invoke animation functions
			var currentSlideName = $('.slides_container .slide:nth-child('+current+')').attr('id');
			if (currentSlideName == 'aluminiumMount') {
				aluminiumMountAnimation();				
			} 
			/*else if (currentSlideName == 'drumScanning') {
				drumScanningAnimation();
			}*/
			
			$('.caption').animate({opacity:1},500);				
		},
		slidesLoaded: function() {
		//alert($('.slides_container .slide:nth-child(1)').attr('id'));	
			$('.caption').animate({opacity:1},500);
		}								
	});
	//Unique animations 
	/* Content marked with '.fade-contents' is hidden from view and re animated by using the following functions.		
	The animations have unique timelines. Otherwise we could use $('.caption').animate({opacity:1},500);*/
	/*function drumScanningAnimation() {
		$('#drumScanner').animate({opacity:1},1000);						
	}*/
	function aluminiumMountAnimation() {	
		$('#aluminiumMount #aluminumMountPicture').delay(1500).animate({opacity: 1}, 1000, function() { setTimeout(function() {}, 100)});			
	}
	//Next and Previous arrows
	$('#content #slides .next img, #content #slides .prev img').css({opacity: 0.5}).hover(function() {
		$(this).stop(true, true).fadeTo(200, 1);			
	},
	function() {
		$(this).stop(true, true).fadeTo(400, 0.5);
	});
	
	
  

	
	
});
