$(function() {
	
	// Slideshow


	    $('#slider').cycle({
	      	fx: 'fade',
			speed: 400,
			pause: 1,
			//timeout: 8000,
			timeout: 8000,
			delay: 500,
			//easing: 'easeInBack',
			//easing: 'easeInOutExpo', 
	      prev: '#prev',
	      next: '#next',
		  before: onBefore,
		  after: onAfter
	    });

		function onBefore(curr,next,opts) {

			$('.slidetitle').hide();
			//$('#titleaandpager h2').hide();
			//$('#featurenav').hide();
		}



		function onAfter(curr,next,opts) {


			$('.slider').eq(opts.lastSlide).removeClass('activeslide');
			//alert('complete');
			$('.slider').eq(opts.currSlide).addClass('activeslide');

			var ntitle = $('.activeslide .slidetitle').html();
			var nlink = $('.activeslide .nlink').html();

			$('#titleaandpager h1 span').html(ntitle);
			$('#flearnmore a').attr('href' , nlink); 

			$('.slidetitle').animate({opacity: 1.0}, 100).fadeIn(1000);
		}
		
		Cufon.replace(".cufon");
		Cufon.replace("#feature .cufon", {textShadow: '.5px .5px #29376F'});
		
		
});




