/* 
* Skeleton V1.0
* Created by Dave Gamache
* www.getskeleton.com
* 5/15/2011
*/	
	

$(document).ready(function() {

	/* Tabs Activiation
	================================================== */
	var tabs = $('ul.tabs'),
	tabsContent = $('ul.tabs-content');
	
	tabs.each(function(i) {
		//Get all tabs
		var tab = $(this).find('> li > a');
		tab.click(function(e) {
			
			//Get Location of tab's content
			var contentLocation = $(this).attr('href') + "Tab";
			
			//Let go if not a hashed one
			if(contentLocation.charAt(0)=="#") {
			
				e.preventDefault();
			
				//Make Tab Active
				tab.removeClass('active');
				$(this).addClass('active');
				
				//Show Tab Content
				$(contentLocation).show().siblings().hide();
				
			} 
		});
	});
	
	$('#quoimagueule').click(function() {
		if ($('#bulle').css('display') == 'none'){
			$('#bulle').fadeIn("slow");
		}else {
			$('#bulle').fadeOut("slow");
		}
	});
	
	$('.quoimagueule').click(function() {
		if ($('#'+$(this).attr('rel')).css('display') == 'none'){
			$(this).children('span').html('Sans');
			$(this).css('background-position', 'bottom');
			$('#'+$(this).attr('rel')).fadeIn("slow");
		}else{
			$(this).children('span').html('Avec');
			$(this).css('background-position', 'top');
			$('#'+$(this).attr('rel')).fadeOut("slow");
		}
	});
	
	//$("#bulle").draggable();
	

	
	$("ul#slides").cycle({
		fx: 'scrollHorz',
		pause: 1,
		prev: '#prev',
		next: '#next'
	});
	
	
});
