function showmsg(msg,type)//type = metier ou formation
{
$("#interactive_search_"+type).fadeOut(300,
	function () {$(this).html(msg).fadeIn(300); }
)
}
function reload (type)
{
	name = $("#interactive_search_"+type+" > div > select").attr('name');
	id = $("#interactive_search_"+type+" > div > select").val();
	$.post("http://"+document.location.host+"/fr"+"/rechercher/interactive/"+type+"", {name:name, id:id} ,function(data){
			if (data.split('\n')[0] != "redirect") 
				showmsg(data,type); 
			else
				if (data.split('\n')[1])
					redirect(data.split('\n')[1]);
				else
					redirect("/"+type+"s/liste_recherche/proceed");
	});
}
function redirect (url)
{
	document.location.href="http://"+document.location.host+"/fr"+url;
}
function preload (name,id,type)
{
	$.post("http://"+document.location.host+"/fr"+"/rechercher/interactive/"+type, {name:name, id:id} ,function(data){showmsg(data,type)});
}
$(document).ready(function(){ 

	$.post("http://"+document.location.host+"/fr"+"/rechercher/interactive/formation", {} ,function(data){
			if (data != "redirect") 
				showmsg(data,'formation'); 
			else
				redirect("/formations/liste_recherche/proceed");
	});



});
