function closeData()
	{
	document.getElementById('search').innerHTML = '';
	}

function sendData(data, page, method)
	{
	// affichage du loading...
	document.getElementById('loading').style.display='inline';
	if(window.ActiveXObject)
		{
		//Internet Explorer
		var XhrObj = new ActiveXObject("Microsoft.XMLHTTP") ;
		}
    else
    		{
		var XhrObj = new XMLHttpRequest();
		}
    
	//définition de l'endroit d'affichage:
    var content = document.getElementById("search");
    
    //si on envoie par la méthode GET:
    if(method == "GET")
		{
		if(data == 'null')
			{
			//Ouverture du fichier sélectionné:
			XhrObj.open("GET", page);
			}
		else
			{
			//Ouverture du fichier en methode GET
			XhrObj.open("GET", page+"?"+data);
			}
    		}
	else if(method == "POST")
		{
		//Ouverture du fichier en methode POST
		XhrObj.open("POST", page);
		}

	//Ok pour la page cible
	XhrObj.onreadystatechange = function()
		{
		if (XhrObj.readyState == 4 && XhrObj.status == 200)
			{
			content.innerHTML = XhrObj.responseText ;
			// fermeture du loading...
			document.getElementById('loading').style.display='none';
			}
		}    

	if(method == "GET")
		{
		XhrObj.send(null);
		}
	else if(method == "POST")
		{
		XhrObj.setRequestHeader('Content-Type','application/x-www-form-urlencoded');
		XhrObj.send(data);
		}
	}

function getFile(page)
	{
    sendData('null', page, 'GET')
	}

function loadData(type)
	{
	if (document.getElementById('motcle').value.length > 2)
		{
		sendData('motcle='+ escape(document.getElementById('motcle').value) +'&type='+ type, 'recherche/quicksearch.php', 'POST');
		}
	else
		{
		document.getElementById('search').innerHTML = '';
		}
	}
