function selectBloc(bloc_id){
	$(".visuel.sel").hide();
	$(".visuel.sel").removeClass("sel");
	$(".visuel#visuel_"+bloc_id).show();
	$(".visuel#visuel_"+bloc_id).addClass("sel");
	$(".artisteBloc.sel").removeClass("sel");
	$("#lien_"+bloc_id).addClass("sel");
}

function defilerBloc(){
	var prevBloc=$(".artisteBloc.sel").attr("id");
	if (prevBloc){
		var prevId=parseInt(prevBloc.substring(5));
		var nextId;
		if (prevId == 5){
			nextId=1;
		}else{
			nextId=prevId+1;
		}
		selectBloc(nextId);
	}
}
//DD_roundies.addRule('#carousel1 img', '10px');


$(document).ready(function(){
	$("#carousel1").CloudCarousel(		
		{			
			xPos: 165,
			yPos: 0,
			buttonLeft: $("#left-but1"),
			buttonRight: $("#right-but1"),
			altBox: $("#alt-text1"),
			titleBox: $("#title-text1"),
			urlBox: $("#a-link1"),
			bringToFront:true,
			yRadius:1,
			xRadius:148,
			autoRotate:'right',
			autoRotateDelay:4000,
			reflHeight:50
		}
	);
	$("#carousel1 a").live('click',function(){return;});
	
	//var nb_news=$(".fildinfo p").length;

	$(document).everyTime(4000, function() {
		defilerBloc();

	});
		
	$(".artisteBloc").hover(function(){
		$(document).stopTime();
		var bloc_id=$(this).attr("id");
		bloc_id=bloc_id.substring(5);
		selectBloc(bloc_id);
		$(document).oneTime(3000,function(){
			$(document).everyTime(4000, function() {
				defilerBloc();
			});
		});

	});
		
});
