/* Fonction File, méthode GET */
function file(fichier)
{
	if(window.XMLHttpRequest) // FIREFOX
		xhr_object = new XMLHttpRequest();
	else if(window.ActiveXObject) // IE
		xhr_object = new ActiveXObject("Microsoft.XMLHTTP");
	else
	{
		alert('Erreur XHR');
		return(false);
	}
	xhr_object.open("GET", fichier, false);
	xhr_object.send(null);
	if(xhr_object.readyState == 4)
	{
		return(xhr_object.responseText);
		alert('Connexion au fichier OK');
		/*
		if(xhr_objet.status == 200)
		{
			return(xhr_object.responseText);
			alert('Connexion au fichier OK');
		}
		else
			return('<div class="informations">Chargement ...</div>');
		*/
	}
	else
	{
		alert('Erreur XHR');
		return(false);
	}
}
/* Fonction File, méthode POST */
function filePOST(fichier, donnees)
{
	if(window.XMLHttpRequest) // FIREFOX
		xhr_object = new XMLHttpRequest();
	else if(window.ActiveXObject) // IE
		xhr_object = new ActiveXObject("Microsoft.XMLHTTP");
	else
	{
		alert('Erreur XHR');
		return(false);
	}
	xhr_object.open("POST", fichier, false);
	xhr_object.setRequestHeader('Content-Type', 'application/x-www-form-urlencoded');
	xhr_object.send(donnees);
	if(xhr_object.readyState == 4)
	{
		return(xhr_object.responseText);
		alert('Connexion au fichier OK');
		/*
		if(xhr_objet.status == 200)
		{
			return(xhr_object.responseText);
			alert('Connexion au fichier OK');
		}
		else
			return('<div class="informations">Chargement ...</div>');
		*/
	}
	else
	{
		alert('Erreur XHR');
		return(false);
	}
}
/* Fonction XHR reponse */
function reponse()
{
	if(xhr.readyState == 4)
	{
		if(xhr.status == 200)
		{
			document.getElementById('corps').innerHTML = xhr.reponseText;
		}
		else
		{
			document.getElementById('corps').innerHTML = '<h2>La page n\est pas disponible.<br /><br />Erreur : '+xhr.status+'</h2>';
		}
	}
	else
		document.getElementById('corps').innerHTML = '<div class="informations">Chargement ...</div>';
}
