if ( window.jQuery ) {
$('document').ready(function(){
	$('#present').show();
	
	setTimeout(function(){
		$('#present').fadeOut('slow',showcube);
	},1500);
	
	$('#mosaique a').mouseover(function(){
		$(this).find('img').animate({ width: "130px" },"normal");
		$('#resume').html($(this).attr('title'));
	});
	$('#mosaique a').mouseout(function(){
		$(this).find('img').animate({ width: "100px" },"fast");
	});
});
}

function showcube() {
	$('#mosaique li li').hide();
	$('#resume').fadeIn();
	$('#mosaique').show();
	elts = $('#mosaique li li');
	
	arr = [];
	for ( i = 0 ; i < elts.length ; i++ )
		arr.push(i);
	arr.splice(4,1);
	
	showelt(elts,arr);
}
function showelt(elts,arr) {
	// commence tjs par le premier et fini par le milieu
	
	if ( arr.length >= 8 ) i = arr.shift();
	else if ( arr.length <= 0 ) i = 4;
	else i = arr.splice(Math.round(Math.random()*(arr.length-1)),1)[0];
	
	elts.eq(i).fadeIn('normal',function(){
		if ( i != 4 || arr.length > 0 ) showelt(elts,arr);
	});
}
