<!--

function makeRequest(url,type,nomform)
{
    var http_request = false;
    if (window.XMLHttpRequest)
    { // Mozilla, Safari,...
        http_request = new XMLHttpRequest();
        if (http_request.overrideMimeType)
        {
            http_request.overrideMimeType('text/xml');
        // Voir la note ci-dessous à propos de cette ligne
        }
    }
    else if (window.ActiveXObject)
    { // IE
        try
        {
            http_request = new ActiveXObject("Msxml2.XMLHTTP");
        } catch (e)
        {
            try
            {
                http_request = new ActiveXObject("Microsoft.XMLHTTP");
            } catch (e) {}
        }
    }
    if (!http_request)
    {
        alert('Abandon :( Impossible de créer une instance XMLHTTP');
        return false;
    }

/******************************************************************************/
    switch(type)
    {
        case "envoyernewsletter":
            http_request.onreadystatechange = function()
            {
                alertContents(http_request,"reponseenvoyernewsletter","");
            };
            break;
        case "reponsecaptcha":
            http_request.onreadystatechange = function()
            {
                alertContents(http_request,"reponsecaptcha",nomform);
            };
            break;
        default:
            http_request.onreadystatechange = function()
            {
                alertContents(http_request,"reponseenvoyerami","");
            };
            break;
    }
			 
    http_request.open('GET', url, true);
    http_request.send(null);
}
/******************************************************************************/
function attendre(nomdiv,duree)
{
    string="efface('"+nomdiv+"')";
    a=setTimeout(string,duree)
}
/******************************************************************************/
function efface(nomdiv)
{
	
    var nombre = document.getElementById(nomdiv).childNodes.length;
    if (nombre>0)
    {
        var noeud=document.getElementById(nomdiv).firstChild;
        disparu = document.getElementById(nomdiv).removeChild(noeud);
    }
		
    if (document.getElementById("envoyeramiemail"))
    {
        document.getElementById("envoyeramimonemail").value="";
        document.getElementById("envoyeramiemail").value="";
        masquepopUp('popUp1')
    }
    if (document.getElementById("envoyeremailnewsletter"))
    {
        document.getElementById("envoyeremailnewsletter").value="";
        //masquepopUp('popUp2')
    }
}
	
/******************************************************************************/
function alertContents(http_request,nomdiv,nomform)
{
    okemail=false;
    if (http_request.readyState == 4)
    {
        if (http_request.status == 200)
        {
            //alert(http_request.responseText);
            //eval(http_request.responseText);
            var tmp = http_request.responseText;
            if(typeof(tmp) != "undefined")
            {
                eval(tmp);
            }
            if ((ok=="vrai")||(ok=="faux"))
            {
                if (ok=="faux")
                {
                    //alert("votre pseudo est deja pris");
                    var nombre = document.getElementById(nomdiv).childNodes.length;
                    if (nombre>0)
                    {
                        var noeud=document.getElementById(nomdiv).firstChild;
                        disparu = document.getElementById(nomdiv).removeChild(noeud);
                    }

                    if (reponse=="") reponse="Pb : Pas envoyé";
                    document.getElementById(nomdiv).appendChild(document.createTextNode(reponse));
                }
                else
                {
                    //alert("votre pseudo est libre");
                    var nombre = document.getElementById(nomdiv).childNodes.length;
                    if (nombre>0)
                    {
                        var noeud=document.getElementById(nomdiv).firstChild;
                        disparu = document.getElementById(nomdiv).removeChild(noeud);
                    }
					
            	
                    if(nomdiv=="reponsecaptcha")
                    {
                        document.forms[nomform].submit();
                    }
                    else
                    {
                        reponse="Envoyé";
                        document.getElementById(nomdiv).appendChild(document.createTextNode(reponse));
                        attendre(nomdiv,3000);
                    }
                }
            }
        } else
        {
            alert('Un problème est survenu avec la requête.');
        }
    }
}
-->