function getXhr() 
{ 
	var xhr=null; 	
	if(window.XMLHttpRequest)//firefox 
		xhr=new XMLHttpRequest(); 
	else if(window.ActiveXObject)//ie
		try
		{
			xhr=new ActiveXObject("Msxml2.XMLHTTP"); 
		}
		catch(e)
		{
			xhr=new ActiveXObject("Microsoft.XMLHTTP"); 
		}
	else
	{ 
		alert("Fonction non supportée par le navigateur"); 
		xhr=false; 
	}
	return (xhr); 
} 
	
function searchData(url, functionName, options)
{
	var xhr=getXhr();
	xhr.onreadystatechange=function(){ 
		if(xhr.readyState==4 && xhr.status==200)
		{
			if(functionName!=null)
				functionName(xhr.responseText, options);
			else
				return true;
		}
		else if(xhr.readyState==4)
		{
			if(functionName!=null)
				functionName(xhr.responseText, options);
		}
	}
	xhr.open("GET", url, false);
	xhr.send(null);
}
