
function dateformation(id,type,defaut)
	{
	if(window.XMLHttpRequest) // FIREFOX
	xhr_object = new XMLHttpRequest();
	else if(window.ActiveXObject)// IE
	xhr_object = new ActiveXObject("Microsoft.XMLHTTP");

	fichier='../IMAGES/JS/date_formation.php?id=' + id + '&defaut=' + defaut;
	//alert(fichier);
	xhr_object.open("GET", fichier, true);
	xhr_object.send(null);  
	
    //on définit l'appel de la fonction au retour serveur
    xhr_object.onreadystatechange = function() { date_formation_alert(xhr_object,id,type); };
	}


function date_formation_alert(xhr_object,id,type)
	{
	if(xhr_object.readyState == 4) 
		{
		if(type=='par')
			{
			document.getElementById("date_formation").innerHTML=xhr_object.responseText;
			document.getElementById("stage").value=id;
			document.getElementById('jp').innerHTML=document.getElementById('Duree' + id).value + "jours (soit " + (document.getElementById('Duree' + id).value*7) + "H)";
			document.getElementById('lieu_formation').innerHTML=document.getElementById('Lieu' + id).value;
			}
		if(type=='dif')
			{
			document.getElementById("stage_dif").value=id;
			document.getElementById("date_formation_dif").innerHTML=xhr_object.responseText;
			document.getElementById('jd').innerHTML=document.getElementById('Duree_dif' + id).value + "jours (soit " + (document.getElementById('Duree_dif' + id).value*7) + "H)";
			document.getElementById('lieu_formation_dif').innerHTML=document.getElementById('Lieu' + id).value;
			}
		}
	}

