jQuery().ready(function(){

var showing=false;
	$("#txtFin").hide();
	$("#txtSuite").hide();
	$(".back").hide();
//	$(".play").fadeIn();
	$("#patch").hide();
   init();
  

	
$(".play").click(function(){
	$(".back").fadeIn();
if($("#txtSuite").is(":visible")){
	$("#txtSuite").fadeOut("fast");
	$("#txtFin").fadeIn("fast");
	}
if($("#txtIntro").is(":visible")){
	$("#txtIntro").fadeOut("fast");
	$("#txtSuite").fadeIn("fast");
	}	
if($("#txtFin").is(":visible")){
	$(".play").fadeOut();
	}
});

$(".back").click(function(){
	$(".play").fadeIn();
if($("#txtSuite").is(":visible")){
	$("#txtIntro").fadeIn("fast");
	$("#txtSuite").fadeOut("fast");
	}
if($("#txtFin").is(":visible")){
	$("#txtSuite").fadeIn("fast");
	$("#txtFin").fadeOut("fast");
	}
if($("#txtIntro").is(":visible")){
	$(".back").fadeOut();
	}
});


$("#formOn").click(function(){
if($("#holder").is(":visible")){
	$("#holder").hide();
	$("#inForm").fadeIn();
	$("#form").animate({width: "400px"}, 500 );
	$("#tabs").animate({width: "170px",opacity: 0.0}, 400 );
	$("#heureux").fadeIn();
	$("#patch").fadeIn();
	}else{
	$("#inForm").hide();
	$("#form").animate({width: "170px"}, 400 );
	$("#tabs").animate({width: "400px",opacity: 1.0}, 500 );
	$("#inForm").fadeOut("fast");
	$("#holder").show();	
	$("#heureux").fadeOut();
	$("#patch").fadeOut();
	}
});
$("input[type=checkbox]").click(function() { 
 showing = !showing;
 $(this).removeAttr("checked");
 $(this).attr("checked",showing);
if(showing){$("#nextOne").fadeIn();}
else{$("#nextOne").fadeOut();}
}); 

$(".f-suite").click(function(){
if($("#field2").is(":visible")){
	$("#field2").fadeOut();
	$("#field3").fadeIn();
	}
if($("#field1").is(":visible")){
	$("#field1").fadeOut();
	$("#field2").fadeIn();
	$("#patch").fadeOut();
	}
	});
});

  function montrer(){
	$("#logo").fadeOut();
	setTimeout(function() {$("#all").fadeIn();}, 500); 
	 }

function init(){
	$(".pict").css("position","absolute");
	$(".pict").css("top","5px");
	$("#img1").css("top","15px");
	$("#img2").css("top","15px");
	$("#img4").css("top","20px");
	$(".pict").css("left","700px");
	$(".pict").animate({opacity: 0.0}, 10 );
	moveIm1();
	}
	
function moveIm1(){
	$("#img1").animate({opacity: 1, left: 350}, 1500 );
	$("#img1").animate({opacity: 1}, 3000 );
	$("#img1").animate({opacity: 0.0, left: 0}, 1500 );
	$("#img1").animate({opacity: 0.0, left: 700}, 1 );
	setTimeout(function() {moveIm2();}, 4500); 
}
function moveIm2(){
	$("#img2").animate({opacity: 1, left: 350}, 1500 );
	$("#img2").animate({opacity: 1}, 3000 );
	$("#img2").animate({opacity: 0.0, left: 0}, 1500 );
	$("#img2").animate({opacity: 0.0, left: 700}, 1 );
	setTimeout(function() {moveIm3();}, 4500); 
}
function moveIm3(){
	$("#img3").animate({opacity: 1, left: 330}, 1500 );
	$("#img3").animate({opacity: 1}, 3000 );
	$("#img3").animate({opacity: 0.0, left: 0}, 1500 );
	$("#img3").animate({opacity: 0.0, left: 700}, 1 );
	setTimeout(function() {moveIm4();}, 4500); 
}
function moveIm4(){
	$("#img4").css("left","300px");
	$("#img4").animate({opacity: 1}, 3000 );
	$("#img4").animate({opacity: 1}, 4500 );
	$("#img4").animate({opacity: 0.0}, 3000 );
	setTimeout(function() {moveIm1();}, 9000); 
}



