function makeRequestRechercheVo(url) 
{
	if (ajaxinuse==false)
	{
		lockAjax();	
		sendRequestRechercheVo(url);
	}
}

function sendRequestRechercheVo(url)
{
	ajaxrequest.onreadystatechange = onResponseRechercheVo;
	ajaxrequest.open("GET", url, true);
	ajaxrequest.send(null);
}

function checkReadyStateRechercheVo(obj)
{
	if(obj.readyState == 0) { document.all['tdlistevo'].innerHTML = ChargementEnCours(); }
	if(obj.readyState == 1) { document.all['tdlistevo'].innerHTML = ChargementEnCours(); }
	if(obj.readyState == 2) { document.all['tdlistevo'].innerHTML = ChargementEnCours(); }
	if(obj.readyState == 3) { document.all['tdlistevo'].innerHTML = ChargementEnCours(); }
	if(obj.readyState == 4)
	{
		if(obj.status == 200)
		{
			unlockAjax();
			return true;
		}
		else if(obj.status == 404)
		{
			// Add a custom message or redirect the user to another page
			unlockAjax();
			document.all['tdlistevo'].innerHTML = MsgErreur();
		}
		else
		{
			unlockAjax();
			document.all['tdlistevo'].innerHTML = MsgErreur();
		}
	}
}

function onResponseRechercheVo() 
{
	if(checkReadyStateRechercheVo(ajaxrequest))
	{
		document.all['tdlistevo'].innerHTML = ajaxrequest.responseText;
		typeAffichage = 'Liste' ;
		trValidation.style.display="none";
		FermeFicheVo();
		if (document.all['NombreVO'].value > 0)
		{
			makeRequestPagination("Pagination.asp");
			
		}
		else
		{
			document.all['tdPagination'].innerHTML = '' ;
			if(document.all['maxvo'])
			{
				alert(MsgTropDeVO()) ;
			}
			if(document.all['noresponse'])
			{
				if (document.all['msgListeVo'])
					document.all['msgListeVo'].innerHTML = "<a href='/login_form.asp?direction=/AlerteEmail/GestionAlertesEmail.asp'>"+MsgAucunVehicule()+"</a>" ;
				//document.all['tdPagination'].innerHTML = MsgAucunVehicule() ;
			}
		}
	}
}