// JavaScript Document

function getXhr()
	{
		var xhr = null;
		if(window.XMLHttpRequest)
			{xhr = new XMLHttpRequest();}
		else if(window.ActiveXObject)
			{ // Internet Explorer
				try {xhr = new ActiveXObject("Msxml2.XMLHTTP");}
				catch (e) {xhr = new ActiveXObject("Microsoft.XMLHTTP");}
			}
		else 
			{ 
				alert("Votre navigateur ne supporte pas les objets XMLHTTPRequest...");
				xhr = false;
			}
		return xhr;
	}
	
	function select_produit(cb_type)
	{
					var xhr = getXhr();
							xhr.onreadystatechange = function()
								{
									if(xhr.readyState == 4 && xhr.status == 200)
										{
											and=xhr.responseText;
											document.getElementById('select_produit').innerHTML = and;
										}
								}
							xhr.open("POST","recette-select-produit.php",true);
							xhr.setRequestHeader('Content-Type','application/x-www-form-urlencoded');
						   
							xhr.send("type_recette="+cb_type);
		                    	
	}
	
	function select_produit_rech(cb_type)
	{
					var xhr = getXhr();
							xhr.onreadystatechange = function()
								{
									if(xhr.readyState == 4 && xhr.status == 200)
										{
											and=xhr.responseText;
											document.getElementById('select_produit_rech').innerHTML = and;
										}
								}
							xhr.open("POST","recette-select-produitR.php",true);
							xhr.setRequestHeader('Content-Type','application/x-www-form-urlencoded');
						   
							xhr.send("cb_type="+cb_type);
		                    	
	}
	
	
	
	function select_produit_rech_droite(cb_type)
	{
					var xhr = getXhr();
							xhr.onreadystatechange = function()
								{
									if(xhr.readyState == 4 && xhr.status == 200)
										{
											and=xhr.responseText;
											document.getElementById('select_produit_rech_droite').innerHTML = and;
										}
								}
							xhr.open("POST","recette-select-produit-droite.php",true);
							xhr.setRequestHeader('Content-Type','application/x-www-form-urlencoded');
						   
							xhr.send("cb_type="+cb_type);
		                    	
	}