function showDetails(id) 
{
	if(id) {
		/*alert(id);*/
		$('table.catalog').hide();
		
		$('table#'+id+'_description').show();		
		$('p.retour').click(function(){
			hideDetails(id);
		});	
	}
}

function hideDetails(id) 
{
	$('table#'+id+'_description').hide();
	$('table#'+id).hide();
	
	$('table.catalog').show();
}


/*
Easing : http://gsgd.co.uk/sandbox/jquery/easing/
*/
$(document).ready(function()
{
	var easingFx = 'easeInBack';
	
	$('table.description').each(function(){
		$(this).hide();
	});
						
	$('table.catalog img').each(function(){
		$(this).click(function(){
			 showDetails( $(this).attr("id") );
		});	
	});

	/*
	$('body').click(function(){
	    $('body').focus(); // Fix select bug
	});
	*/
	
	$('#fragments').css({position: 'relative', height: '600px', overflow: 'hidden'});
	
	$('#fragments .fragment').each(function(i){
		$(this).css({position: 'absolute', overflow: 'hidden', width: $('#fragments').width(), height: $('#fragments').height()});
		$(this).css({left: ($('#fragments').width()*i)});
	});

	$('#fragments .fragment').wrapAll('<div id="slider" style="position: absolute"></div>');
	
	/*
	$('#nav a').each(function(){
		$(this).click(function(){
			var idx = $("#fragments #slider div").index($($(this).attr('href'))[0]);
			var newLeft = 0-($('#fragments').width()*idx);
			$($('#slider')).animate({ left: newLeft }, {duration: 500, easing: easingFx});
			$('#nav a').removeClass('active');
			$(this).addClass('active');
			return false;
		});
	});
	*/
	
});