/**
 * Script permettant d'afficher ou de cacher les descriptions 
 * des différents champs.
 *
 * @author Petit Panda Rouge
 */

$(document).ready(function() 
{
	// Couleur du texte dans les champs.
	$("input[type=text], textarea").each( function()
	{
		$(this).css('color', '#464646');
	});
	
	// Affichage ou non des champs
	$("input[name=firstname]").focus( function()
	{
		if
			($(this).attr("value") == 'Nom*')
		{
			$(this).attr("value", "");
			$(this).css('color', 'black');
		}
	});	
	$("input[name=firstname]").blur( function()
	{
		if
			($(this).attr("value") == '')
		{
			$(this).attr("value", "Nom*");
			$(this).css('color', '#464646');
		}
	});
	
	$("input[name=lastname]").focus( function()
	{
		if
			($(this).attr("value") == 'Prénom')
		{
			$(this).attr("value", "");
			$(this).css('color', 'black');
		}
	});	 
	$("input[name=lastname]").blur( function()
	{
		if
			($(this).attr("value") == '')
		{
			$(this).attr("value", "Prénom");
			$(this).css('color', '#464646');
		}
	});
	
	$("input[name=email]").focus( function()
	{
		if
			($(this).attr("value") == 'Email*')
		{
			$(this).attr("value", "");
			$(this).css('color', 'black');
		}
	});	
	$("input[name=email]").blur( function()
	{
		if
			($(this).attr("value") == '')
		{
			$(this).attr("value", "Email*");
			$(this).css('color', '#464646');	
		}
	});
	
	$("input[name=phone]").focus( function()
	{
		if
			($(this).attr("value") == 'Téléphone')
		{
			$(this).attr("value", "");
			$(this).css('color', 'black');
		}
	});	 
	$("input[name=phone]").blur( function()
	{
		if
			($(this).attr("value") == '')
		{
			$(this).attr("value", "Téléphone");
			$(this).css('color', '#464646');
		}
	});
	
	$("textarea[name=message]").focus( function()
	{
		if
			($(this).val() == 'Message*')
		{
			$(this).val('');
			$(this).css('color', 'black');
		}
	});
	$("textarea[name=message]").blur( function()
	{
		if
			($(this).val() == '')
		{
			$(this).val('Message*');
			$(this).css('color', '#464646');
		}
	});
});