$(document).ready(function() {
	
	$('#methode_b h1').click(function() {
		if(!$('#methode_b').hasClass('active')) {
			$('#methode_b .methode_body').slideToggle();
			$('#methode_b').addClass('active');
		}
		$('#methode_b.active .methode_body').fadeTo('slow', 1);
		$('#methode_c.active .methode_body').fadeTo('slow', 0.5);
		$('#methode_d.active .methode_body').fadeTo('slow', 0.5);
		$('#methode_background_b').css('z-index', 2);
		$('#methode_background_c').css('z-index', 0);
		$('#methode_background_d').css('z-index', 0);
		$('#methode_background_b').fadeTo('slow', 1, function() {
			$('#methode_background_c').css('opacity', 0);
			$('#methode_background_d').css('opacity', 0);
		});
		
		$('#methode_b .methode_body').addClass('selected');
	});
	
	$('#methode_c h1').click(function() {
		if(!$('#methode_b').hasClass('active')) {
			$('#methode_b .methode_body').css('opacity', 0.5);
			$('#methode_b .methode_body').slideToggle();
			$('#methode_b').addClass('active');
		}
		if(!$('#methode_c').hasClass('active')) {
			$('#methode_c .methode_body').slideToggle();
			$('#methode_c').addClass('active');
		}
		$('#methode_b.active .methode_body').fadeTo('slow', 0.5);
		$('#methode_c.active .methode_body').fadeTo('slow', 1);
		$('#methode_d.active .methode_body').fadeTo('slow', 0.5);
		$('#methode_background_b').css('z-index', 0);
		$('#methode_background_c').css('z-index', 2);
		$('#methode_background_d').css('z-index', 0);
		$('#methode_background_c').fadeTo('slow', 1, function() {
			$('#methode_background_b').css('opacity', 0);
			$('#methode_background_d').css('opacity', 0);
		});
	});
	
	$('#methode_d h1').click(function() {
		if(!$('#methode_b').hasClass('active')) {
			$('#methode_b .methode_body').css('opacity', 0.5);
			$('#methode_b .methode_body').slideToggle();
			$('#methode_b').addClass('active');
		}
		if(!$('#methode_c').hasClass('active')) {
			$('#methode_c .methode_body').css('opacity', 0.5);
			$('#methode_c .methode_body').slideToggle();
			$('#methode_c').addClass('active');
		}
		if(!$('#methode_d').hasClass('active')) {
			$('#methode_d .methode_body').slideToggle();
			$('#methode_d').addClass('active');
		}
		
		$('#methode_b.active .methode_body').fadeTo('slow', 0.5);
		$('#methode_c.active .methode_body').fadeTo('slow', 0.5);
		$('#methode_d.active .methode_body').fadeTo('slow', 1);
		$('#methode_background_b').css('z-index', 0);
		$('#methode_background_c').css('z-index', 0);
		$('#methode_background_d').css('z-index', 2);
		$('#methode_background_d').fadeTo('slow', 1, function() {
			$('#methode_background_b').css('opacity', 0);
			$('#methode_background_c').css('opacity', 0);
		});
	});
	
	$('#fancyvideo').fancybox({
		'padding'	:	0,
		'autoScale'	:	true,
		'width' : 680,
		'height' : 300,
		'type' : 'swf'
	});
	
	
	
});
