function login()
{
	var OAjax;
	mail = document.getElementById('mail').value;
    pass = document.getElementById('pass').value;
	page = document.getElementById('page').value;
	if (window.XMLHttpRequest) OAjax = new XMLHttpRequest();
	else if (window.ActiveXObject) OAjax = new ActiveXObject('Microsoft.XMLHTTP'); 
	OAjax.open('GET',"../php/connexion.php?mail="+mail+"&pass="+pass,true);
	OAjax.onreadystatechange = function()
	{
		if (OAjax.readyState == 4 && OAjax.status==200)
		{
			if (document.getElementById) 
			{	
				if (OAjax.responseText =='true') {
			   	window.location=page;		
				}else{
				 alert(OAjax.responseText);
				}
			}
		}
	}
	
	OAjax.setRequestHeader('Content-type','application/x-www-form-urlencoded');
    OAjax.send(null);

}

