$(document).ready(function() {
	
	if($('#tmbs').size() > 0) {
		
		$('div.detail').hide();
		$('div.detail:first').show();
		$('#tmbs a:first').removeClass('none');
		$('#tmbs a:first').addClass('selected');
	
		$('#tmbs a').click(function(e) {
			
			e.preventDefault();
			
			/*$('div.detail').hide();
			$('#tmbs a.selected').removeClass('selected');*/
			
			var current = $(this).attr('id').split('btn-').pop();
			
			/*if($('div.detail:visible').size() > 0) {
				$('div.detail:visible').fadeOut(100, function() {
					$('#' + current).fadeIn('slow');
				});
			} else {
				$('#' + current).fadeIn('slow');
			}
			
			$(this).addClass('selected');*/
			
			var index = current.split('fiche-').pop();
			
			ContentFlowGlobal.Flows[0].moveTo(index);
		});
	}
		
});

function highlightItem(index) {
		
	$('div.detail').hide();
	$('#tmbs a.selected').removeClass('selected');
		
	var current = 'fiche-' + index;
	
	if($('div.detail:visible').size() > 0) {
		$('div.detail:visible').fadeOut(100, function() {
			$('#' + current).fadeIn('slow');
		});
	} else {
		$('#' + current).fadeIn('slow');
	}
	
	$('#tmbs a#btn-' + current).addClass('selected');
}