function affiche_inscription(ins, id)
{
		$('inscription').update("<img src=\"/images/load.gif\" alt=\"\" />");
		new Ajax.Request('ajax.php',
		{method: 'post', parameters: 'ins='+ins+'&insert_id='+id, onSuccess: function(ajax)
			{
				$('inscription').update(ajax.responseText);
			}
		});
}

function change_theme(id_form, id)
{
		$('tableau').update("<img src=\"/images/load.gif\" alt=\"\" />");
		new Ajax.Request('ajax.php',
		{method: 'post', parameters: 'id_form='+id_form+'&insert_id='+id, onSuccess: function(ajax)
			{
				$('tableau').update(ajax.responseText);
			}
		});
}

function change_site(id_form, id)
{
		$('tableau').update("<img src=\"/images/load.gif\" alt=\"\" />");
		new Ajax.Request('ajax.php',
		{method: 'post', parameters: 'id_site='+id_form+'&insert_id='+id, onSuccess: function(ajax)
			{
				$('tableau').update(ajax.responseText);
			}
		});
}

function add_participant(id_td, id_check, id_f, id)
{
	if ( document.getElementById(id_check).checked == true )
	{
		$(id_td).update("<img src=\"/images/load.gif\" alt=\"\" />");
		new Ajax.Request('ajax.php',
		{method: 'post', parameters: 'id_td='+id_td+'&id_check='+id_check+'&id_f='+id_f+'&insert_id='+id, onSuccess: function(ajax)
			{
				$(id_td).update(ajax.responseText);
			}
		});
	}
	else
	{
		coche = 'false';
	$(id_td).update("<img src=\"/images/load.gif\" alt=\"\" />");
		new Ajax.Request('ajax.php',
		{method: 'post', parameters: 'coche='+coche+'&id_id='+id+'&id_f='+id_f, onSuccess: function(ajax)
			{
				$(id_td).update(ajax.responseText);
			}
		});
	}
}

function new_participant(id_td, id, id_f)
{
	name = 'name_'+id_td;
	test = document.getElementById(name).value;
	bloc = 'bloc_'+id_td;
	document.getElementById(bloc).innerHTML += test;
	document.getElementById(name).value = "";
	
	$(bloc).update("<img src=\"/images/load.gif\" alt=\"\" />");
		new Ajax.Request('ajax.php',
		{method: 'post', parameters: 'text='+test+'&insert_id='+id+'&id_f='+id_f+'&bloc='+bloc, onSuccess: function(ajax)
			{
				$(bloc).update(ajax.responseText);
			}
		});
}

function add_suggestion(id_contact)
{
	
	test = document.getElementById('suggest').value;
	$('contact_end').update("<img src=\"/images/load.gif\" alt=\"\" />");
		new Ajax.Request('ajax.php',
		{method: 'post', parameters: 'text_sug='+test+'&id_conta='+id_contact, onSuccess: function(ajax)
			{
				$('contact_end').update(ajax.responseText);
			}
		});
}

function display_form(new_formation)
{
	var com = document.getElementById(new_formation);
	if(com.style.display == "block") com.style.display = "none";
	else com.style.display = "block";
}

function delete_participant(id_num, id, id_f, id_td)
{
	$(id_td).update("<img src=\"/images/load.gif\" alt=\"\" />");
		new Ajax.Request('ajax.php',
		{method: 'post', parameters: 'id_num='+id_num+'&insert_id='+id+'&id_f='+id_f+'&bloc='+id_td, onSuccess: function(ajax)
			{
				$(id_td).update(ajax.responseText);
			}
		});
}

function end_formation(num_id)
{
	$('contact_end').update("<img src=\"/images/load.gif\" alt=\"\" />");
		new Ajax.Request('ajax.php',
		{method: 'post', parameters: 'fin_form='+num_id, onSuccess: function(ajax)
			{
				$('contact_end').update(ajax.responseText);
			}
		});
}

function verif_test(num_id)
{
	if (document.getElementById(num_id).value == "Saisir nom, prenom et fonction du participant")
	{
		alert('Veuillez Saisir nom, prénom et fonction du participant');
		return false;
	}
	else
	{
		return true;
	}
}