$(document).ready(function() {
	//Homepage slideshow
	//$('#home_slideshow').carousel('#simplePrevious', '#simpleNext');
    //$('#slider-stage').carousel('#previous', '#next');
	$('#home_slideshow ul li').fadeIn(3000);
	
	setTimeout(function() {
		$('#home_slideshow ul').cycle({
			cleartype: 1,
			fx: 'fade',
			timeout: 12000, // how long image is shown
			speed: 3000, // duration of transition
			before: onBefore,
			after: onAfter,
			delay: -3000
		});
	}, 3000);
	
	function onBefore() {
		$(this).find('div.testimonial').css('display', 'none');
	}
	function onAfter() {
		$(this).find('div.testimonial').fadeIn(2500, function() {
			if($.browser.msie) {
				$(this).css("filter","progid:DXImageTransform.Microsoft.gradient(startColorstr='#ffffff', endColorstr='#cccccc');");
	        }
		});
	}
	
	// Autoscroll homepage slideshow
	// function slide(){
	//   $('#simpleNext').click();
	// }
	// //Launch the scroll every 12 seconds
	// var intervalId = window.setInterval(slide, 12000);
	
	// $('#coda-slider-1').codaSlider({
	// 				dynamicArrows: false,
	// 				dynamicTabs: false,
	// 				autoSlide: true,
	// 				autoSlideInterval: 10000,
	// 				firstPanelToLoad: 1
	// 			});
	
	$('.project_slideshow').cycle({
		next: '.prod_slideshow_next',
		prev: '.prod_slideshow_prev',
		pager: '.portfolio_slideshow_nav',
		fx: 'fade',
		timeout: 0, // how long image is shown
		speed: 1500 // duration of transition
	});
	
	// $('#coda-slider-2').codaSlider({
	// 	dynamicArrows: false,
	// 	dynamicTabs: false,
	// 	autoSlide: false,
	// 	firstPanelToLoad: 1
	// });
});
