function diaporama(){
	$('#diaporamaLinks a').click(function(){
		$('.imgContent').hide();
		$('#'+$(this).attr('href').split('#')[1]).show();
		return false;
	});
}

function infobulle(){
	$('.infobulleAnswer').hide();
	$('.infobulleCall').hover(function(){
		$(this).children('small').show();
	},function(){
	  $(this).children('small').hide();
	});
}

function onglets(){
	$('#tabs').children('li').removeClass('on');
	$('#tabs .first').addClass('on');
	$('#tabsContent').children().hide();
	$('#ficheTechnique').show();
	$('#tabs li a, a.linkTab').click(function(){
		var myId = $(this).attr('href').split('#')[1];
		
		// mise à jour de l'onglet
		$('#tabs').children('li').removeClass('on');
		$('#tabs li').each(function(){
			if ($(this).children('a').attr('href').split('#')[1] == myId) $(this).addClass('on');
		});
		$(this).addClass('on');
		$('#tabsContent').children().hide();
		$('#'+myId).show();
		
		/* Correction JS: on retire l'effet */
		// scroll
		if($(this).parent().parent().attr("id") != "tabs") {
			//$("#tabs").ScrollTo(1000);
			var elmtDOM = document.getElementById("tabs");
			window.scrollTo(0,elmtDOM.offsetTop+224);
		}
		/* END Correction JS: on retire l'effet */
		
		$(this).blur();
		
		return false;
	});
}

$(document).ready(function(){
	diaporama();
	infobulle();
	onglets();
});
