function FileLister()
{
	this.dir = null;
	this.deep = false;
	this.phpLocation = '';
	
	this.getList = getList;
	
	function getList()
	{	
		if (window.XMLHttpRequest)
		{ 
			var xhr = new XMLHttpRequest();
		}
		else if (window.ActiveXObject)
		{
			try 
			{
				var xhr = new ActiveXObject("Msxml2.XMLHTTP");
			}
			catch(e)
			{
				var xhr = new ActiveXObject("Microsoft.XMLHTTP");
			}
		}
		
		var ok = false;
		
		//test des états  xhr
		xhr.onreadystatechange = function()
		{
			if(xhr.readyState == 4)
			{
				if(xhr.status == 200)
				{
					//marquage de la variable de test
					ok = true;
				}
			}
		};
		
		//lancement de la requete Ajax
		var adresse = encodeURI(this.phpLocation + "FileLister.php?deep=" + this.deep + "&dir=" + this.dir + "&phpLocation=" + this.phpLocation);
		xhr.open("GET", adresse, false);
		xhr.setRequestHeader('Content-type', 'application/x-www-form-urlencoded; charset=UTF-8');
		xhr.send(null);
		
		//verification de l'etat de la variable de test
		if (ok)
		{
			//renvoi de l'objet domDocument une fois nettoyé 
			eval('(' + 'result = ' + xhr.responseText + '.json)')
			return result;
		}
	}
}
