var fcDelay = 12000;
function gotoImage1(){
	jQuery.timer(fcDelay, function (timer) {
		loadFC1();
		timer.stop();
		gotoImage2();
	});
}
function gotoImage2(){
	jQuery.timer(fcDelay, function (timer) {
		loadFC2();
		timer.stop();
		gotoImage3();
	});
}
function gotoImage3(){
	jQuery.timer(fcDelay, function (timer) {
		loadFC3();
		timer.stop();
		gotoImage1();
	});
}
gotoImage2();


var fcTransitionLength = 400;	
var cssObj1 = {
	'background-color' : '#7a7a7a',
	'color' : '#fff'
	}
var cssObj2 = ("background-color","#f3f3f4")

	

function loadFC1(){
		jQuery(".button1").css(cssObj1);
		jQuery(".button2").css("background-color","#f3f3f4");
		jQuery(".button2").css("color","#333");
		jQuery(".button3").css("background-color","#f3f3f4");
		jQuery(".button3").css("color","#333");
		jQuery(".image2").fadeOut(fcTransitionLength);
		jQuery(".fcText2").fadeOut(fcTransitionLength);
		jQuery(".image3").fadeOut(fcTransitionLength);;
		jQuery(".fcText3").fadeOut(fcTransitionLength,function(){
			jQuery(".image1").fadeIn(fcTransitionLength);
			jQuery(".fcText1").fadeIn(fcTransitionLength);});
	}
	function loadFC2(){
		jQuery(".button1").css("background-color","#f3f3f4");
		jQuery(".button1").css("color","#333");
		jQuery(".button2").css(cssObj1);
		jQuery(".button3").css("background-color","#f3f3f4");
		jQuery(".button3").css("color","#333");
		jQuery(".image1").fadeOut(fcTransitionLength);
		jQuery(".fcText1").fadeOut(fcTransitionLength);
		jQuery(".image3").fadeOut(fcTransitionLength);
		jQuery(".fcText3").fadeOut(fcTransitionLength,function(){
			jQuery(".image2").fadeIn(fcTransitionLength);
			jQuery(".fcText2").fadeIn(fcTransitionLength);});
	}
	function loadFC3(){
		jQuery(".button1").css("background-color","#f3f3f4");
		jQuery(".button1").css("color","#333");
		jQuery(".button2").css("background-color","#f3f3f4");
		jQuery(".button2").css("color","#333");
		jQuery(".button3").css(cssObj1);
		jQuery(".image1").fadeOut(fcTransitionLength);
		jQuery(".fcText1").fadeOut(fcTransitionLength);
		jQuery(".image2").fadeOut(fcTransitionLength);
		jQuery(".fcText2").fadeOut(fcTransitionLength,function(){
			jQuery(".image3").fadeIn(fcTransitionLength);
			jQuery(".fcText3").fadeIn(fcTransitionLength);});
	}


jQuery(document).ready(function(){
	jQuery(".button1").click(function(){	
		loadFC1();
	});
	
	jQuery(".button2").click(function(){
		loadFC2();
	});
	
	jQuery(".button3").click(function(){
		loadFC3();
	});

});
