function login()
{
	showModal("modal_authenticating")
	
	var xmlhttp=new GetXmlHttpObject();
	
	xmlhttp.onreadystatechange= function()
	{
		if (xmlhttp.readyState==4)
		{
			if(xmlhttp.responseText==1)
			{
				var expire = new Date();
				expire.setTime(expire.getTime() + 1200000);
				//;expires=" + expire.toGMTString();
				
				document.cookie = "email=" + email
				document.cookie = "password=" + password
				
				window.location.reload()
			}
			else
			{
				closeModal("modal_authenticating")
				showModal("modal_denied")
			}
		}
	}

	var dt = new Date().getTime()
	
	var email = document.getElementById("login_email").value
	var password = document.getElementById("login_password").value
	
	xmlhttp.open("GET", "app_code/authenticateUser.php?email="+email+"&password="+password+"&dt="+dt, true);
	xmlhttp.send(null);
}

function checkEnter(e)
{
	if(e.keyCode==13)
		login()
}
