function getXMLHTTP()
{
    var xhr = null;
    if(window.XMLHttpRequest)
    { 
        xhr = new XMLHttpRequest();
    }
    else if(window.ActiveXObject)
    { 
        try
        {
            xhr = new ActiveXObject("Msxml2.XMLHTTP");
        }
        catch(e)
        {
            try
            {
                xhr = new ActiveXObject("Microsoft.XMLHTTP");
            }
            catch(e1)
            {
                xhr = null;
            }
        }
    }
    else
    { 
        alert("Votre navigateur ne supporte pas les objets XMLHTTPRequest...");
    }

    return xhr;
}

function ieTrick(sep)
{
	d = new Date();
	trick = d.getYear() + "ie" + d.getMonth() + "t" + d.getDate() + "r" + d.getHours() + "i" + d.getMinutes() + "c" + d.getSeconds() + "k" + d.getMilliseconds();

	if (sep != "?")
	{
		sep = "&";
	}

	return sep + "ietrick=" + trick;
}

var XHR = null;

function compteur_co2()
{

	XHR = getXMLHTTP();

	XHR.open("GET", "compteur.php?value=co2" + ieTrick(), true);

	XHR.send(null);
}

function compteur_dechets()
{

	XHR = getXMLHTTP();

	XHR.open("GET", "compteur.php?value=dechets" + ieTrick(), true);

	XHR.send(null);
}

function compteur_eau()
{

	XHR = getXMLHTTP();

	XHR.open("GET", "compteur.php?value=eau" + ieTrick(), true);

	XHR.send(null);
}

function compteur_energie()
{

	XHR = getXMLHTTP();

	XHR.open("GET", "compteur.php?value=energie" + ieTrick(), true);

	XHR.send(null);
}

function compteur_temps()
{

	XHR = getXMLHTTP();

	XHR.open("GET", "compteur.php?value=temps" + ieTrick(), true);

	XHR.send(null);
}

function compteur_produit()
{

	XHR = getXMLHTTP();

	XHR.open("GET", "compteur.php?value=produit" + ieTrick(), true);

	XHR.send(null);
}

function compteur_argent()
{

	XHR = getXMLHTTP();

	XHR.open("GET", "compteur.php?value=argent" + ieTrick(), true);

	XHR.send(null);
}