function getXhr(){//fonction qui créer l'objet ajax pour la requete au serveur
var xhr = null; 
	
if(window.XMLHttpRequest) // Firefox et autres
	xhr = new XMLHttpRequest(); 
else if(window.ActiveXObject){ // Internet Explorer 
	try {
		xhr = new ActiveXObject("Msxml2.XMLHTTP");
		} catch (e) {
	xhr = new ActiveXObject("Microsoft.XMLHTTP");
		}
}
else { // XMLHttpRequest non supporté par le navigateur 

alert("Cette opération ne peut être réalisée sur votre navigateur : utilisez Firefox ou Internet Explorer."); 
xhr = false; 
} 
 return xhr
}
function go(script,div)//fonction ajax qui récupére le script php de traitement et le div concerné par la mise à jour
{
	var xhr = getXhr()
	// On défini ce qu'on va faire quand on aura la réponse
	xhr.onreadystatechange = function()
	{
		// On ne fait quelque chose que si on a tout reçu et que le serveur est ok
		if(xhr.readyState == 4 && xhr.status == 200)
		{
			leselect = xhr.responseText;
			document.getElementById(div).innerHTML = leselect;
		}
		else
		{	
			leselect = xhr.responseText;
			if (document.getElementById(div)!=null){document.getElementById(div).innerHTML = "<center><b>Chargement...</b></center>";}
		}
	}
	xhr.open("GET",script,true);
	xhr.send(null);
}
function verif_login(login)
{
	if(login==" ")
	{
		return true;
	}
	else
	{
		alert('Vous devez vous identifier pour pouvoir répondre à une nouvelle');
		return false;
	}
}
/************Fonctions qui servent à remttre à zero les formulaires d'exo sous IE********************/
function raz_exo_phrase_1()
{
	window.location.href="menu.php?module=exo_phrase_1&gra";
}
function raz_exo_phrase_2()
{
	window.location.href="menu.php?module=exo_phrase_2&gra";
}
function raz_exo_phrase_3()
{
	window.location.href="menu.php?module=exo_phrase_3&gra";
}
function raz_exo_accords_1()
{
	window.location.href="menu.php?module=exo_accords_1&gra";
}
function raz_exo_accords_2()
{
	window.location.href="menu.php?module=exo_accords_2&gra";
}
function raz_exo_accords_3()
{
	window.location.href="menu.php?module=exo-accords-3&gra";
}
function raz_exo_ortho_1()
{
	window.location.href="menu.php?module=exo-ortho-1&ort";
}
function raz_exo_ortho_2()
{
	window.location.href="menu.php?module=exo-ortho-2&ort";
}
function raz_exo_ortho_3()
{
	window.location.href="menu.php?module=exo-ortho-3&ort";
}
function raz_exo_ortho_4()
{
	window.location.href="menu.php?module=exo-ortho-4&ort";
}
function raz_exo_ortho_5()
{
	window.location.href="menu.php?module=exo-ortho-5&ort";
}
function raz_exo_ortho_6()
{
	window.location.href="menu.php?module=exo-ortho-6&ort";
}