$(function()
{
	/******** Slideshow ********/
	/* Masque les photos du slideshow */
	var parsePhoto = 0;
	$("div.header div.images div").each(function(){
		nbImageSs++;
		if(parsePhoto != 0) $(this).fadeOut(0);
		parsePhoto++;
	});
	
	
	/******** Gestion des champs du formulaire ********/
	var valueInput;
                  var old ;
                  $('div.joindre form input, div.joindre form textarea').click(function(){
                      $(this).removeClass('field-error');
                  }) ;
	$('div.joindre form input, div.joindre form textarea').focus(function(){
		valueInput = $(this)[0].value;
		if(valueInput == 'Prénom' || valueInput == 'Nom' || valueInput == 'Courriel' || valueInput == 'Téléphone' || valueInput == 'Commentaires et/ou suggestions' ||
                                        valueInput == 'First name' || valueInput == 'Last name' || valueInput == 'Email' || valueInput == 'Phone' || valueInput == 'Comments and/or suggestions'){
			$(this)[0].value = "";
                                                       old = valueInput ;
                                                       $(this).removeClass('field-error');
			$(this).css('color','#000');
		}
	});
	$('div.joindre form input.prenom').blur(function(){
		if($(this)[0].value == ""){
			$(this).css('color','#CCC');
			$(this)[0].value = old;
		}
	});
	$('div.joindre form input.nom').blur(function(){
		if($(this)[0].value == ""){
			$(this).css('color','#CCC');
			$(this)[0].value = old;
		}
	});
	$('div.joindre form input.courriel').blur(function(){
		if($(this)[0].value == ""){
			$(this).css('color','#CCC');
			$(this)[0].value = old;
		}
	});
	$('div.joindre form input.tel').blur(function(){
		if($(this)[0].value == ""){
			$(this).css('color','#CCC');
			$(this)[0].value = old;
		}
	});
	$('div.joindre form textarea.com').blur(function(){
		if($(this)[0].value == ""){
			$(this).css('color','#CCC');
			$(this)[0].value = old;
		}
	});
});



var posNavSsInit = 1;
var nbImageSs = 0;

/******** Fait défiler le slideshow du header ********/
function defilerSlideshow() {
	var imageACacher = "img"+posNavSsInit;
	
	if(posNavSsInit != nbImageSs) {
		posNavSsInit++;
	}
	else posNavSsInit = 1;
	
	var imageAAfficher = "img"+posNavSsInit;
	
	$("div.header div.images #"+imageACacher).fadeOut(300);
	$("div.header div.images #"+imageAAfficher).fadeIn(500);
}


