	function getXmlHttpRequest()
{
	if(window.XMLHttpRequest)
	{
		xhr = new XMLHttpRequest();
	}
	else if(window.ActiveXObject)
	{
		try
		{
			xhr = new ActiveXObject("Msxml2.XMLHTTP");
		}
		catch(e)
		{
			xhr = new ActiveXObject("Microsoft.XMLHTTP")
		}
	}
	else
	{
		alert("Votre navigateur ne supporte pas l'objet XMLHTTPRequest !");
		xhr = false;
	}
}



function selectRace()
{
	getXmlHttpRequest();
	xhr.onreadystatechange = function() {	
		if(xhr.readyState == 4 && xhr.status == 200)
		{
			menu = xhr.responseText;
			document.getElementById('selectRace').innerHTML = menu;
		}
	}
	xhr.open("post","/anilife/selectRaceAjax.php",true);
	xhr.setRequestHeader('Content-Type','application/x-www-form-urlencoded; charset=UTF-8');
	race = escape(document.getElementById('selRace').value);
	xhr.send("Race="+race);
}


function envoyerPassword(clientEmailId)
{
	getXmlHttpRequest();
	xhr.onreadystatechange = function() {	
		if(xhr.readyState == 4 && xhr.status == 200)
		{
			menu = xhr.responseText;
			alert(menu);
			//document.getElementById('retourAjaxPasswrd').innerHTML = menu;
		}
	}
	xhr.open("post","/anilife/envoyerPassword.php",true);
	xhr.setRequestHeader('Content-Type','application/x-www-form-urlencoded; charset=UTF-8');
	xhr.send("clientEmailId="+clientEmailId);
}


function choisirPaiement(contrat_id,paiement_id)
{
	getXmlHttpRequest();
	xhr.onreadystatechange = function() {	
		if(xhr.readyState == 4 && xhr.status == 200)
		{
			menu = xhr.responseText;
			//alert(menu);
			//document.getElementById('retourAjaxPasswrd').innerHTML = menu;
		}
	}
	xhr.open("post","/anilife/choisirPaiementAjax.php",true);
	xhr.setRequestHeader('Content-Type','application/x-www-form-urlencoded; charset=UTF-8');
	xhr.send("contrat_id="+contrat_id+"&paiement_id="+paiement_id);
}




function effacerContrat(contrat_id){
	getXmlHttpRequest();
	xhr.onreadystatechange = function() {	
		if(xhr.readyState == 4 && xhr.status == 200)
		{

			menu = xhr.responseText;
			window.location = 'Assurance-chien-chat-souscription-en-ligne.html';
		}
	}
	xhr.open("post","/javascript/supprimerContrat.php",true);
	xhr.setRequestHeader('Content-Type','application/x-www-form-urlencoded; charset=UTF-8');
	xhr.send("contrat_id="+contrat_id);

}






