var n = 1;
var t;
var elemCount;
//var elemId;

$(document).ready(function() {
	elemCount = $('.banner').size();
}); 

function timedCount() {
	if ( n <= elemCount ){
		$(".banner").fadeOut("slow");
		$(".banner"+n).fadeIn("slow");
	} else {
		n = 1;
		$(".banner").fadeOut("slow");
		$(".banner"+n).fadeIn("slow");
	}
	n++;
	t=setTimeout("timedCount()",5000);
}

$(document).ready(function() {
	timedCount();
	
	$(".it").each(function(){
		$(this).focus(function(){
			$(this).addClass('focused');
		});
		$(this).blur(function(){
			$(this).removeClass('focused');
		});
	});
	
	$(".ta").each(function(){
		$(this).focus(function(){
			$(this).addClass('focused');
		});
		$(this).blur(function(){
			$(this).removeClass('focused');
		});
	});
	
	$(".quest > a").each(function(){
		$(this).click(function(){
			if($(this).attr("class") == "showAnsw") {
				$(this).next('.answ').hide('fast');
				$(this).removeClass('showAnsw');
			} else {
				$(this).next('.answ').fadeIn('fast');
				$(this).addClass('showAnsw');
			}
		});
	});
	
	$("div.produitScroller").scrollable({
		size: 3,
		speed: 800
	}).mousewheel();
	
	$(".produitListLi").each(function(){
		$(this).click(function(){
			elemId = $(this).attr("id");
			$(".produitListLi").removeClass('produitListLiSelected');
			$(this).addClass('produitListLiSelected');
			$('.albThumbOpen').hide();
			$(this).children().children().children().children('.albThumbClosed').fadeOut('fast');
			$(this).children().children().children().children('.albThumbOpen').fadeIn('slow');
			$('.scrollProd').fadeOut('fast');
			$('#'+elemId+'Params').fadeIn('slow');
		});
	});
	
});
