// Fill the commercial contact box
function fill_profil()
{
	var profil;
	
	// Get the current selected profil
	profil = $('#contact_choice select').val();
	
	// Foreach pre-filled fields
	$('#contact_' + profil + ' *[class!=""]').each(function()
	{
		// Now we have all pre-filled fields (in $(this))

		// Fill
		$('#' + $(this).attr('class')).append($(this).html());
	});
	
	// Enable the bind
	$('#contact_choice select').change(function()
	{
		$('#contact_choice select').unbind('change');

		// Effects and go !
		$('#contact_container').fadeOut('slow', function ()
		{
			// Clear all presedent fields
			$('#contact_container *').each(function()
			{
				if (!!$(this).attr('id'))
				{
					$(this).text('');
				}
			});
		
			fill_profil();
			
			$('#contact_container').fadeIn('slow');
		});
	});
}

$(document).ready(function ()
{
	// Clean up the textarea
	$('textarea[name="comments"]').click(function()
	{
		$(this).unbind('click');
	
		$(this).val('');
	});
	
	// Default commercial contact
	fill_profil();
});
