function ClassLogin()
{
	this.LoginUrl = Settings.RootPath + '?controller=Login&action=ajax_show';
	
	this.Initialize = function()
	{
		//
	}
	
	this.Authenticate = function()
	{
		this.CallXmlHttp(this.LoginUrl);
	}
	
	this.Message = function(message)
	{
		if(message != 'false')
		{
			if(message == "jobseeker")
			{
				window.location.href = Settings.RootPath + '?controller=Jobseeker&action=show';
			}
			if(message == "client")
			{
				window.location.href = Settings.RootPath + '?controller=Clients&action=show';
			}
			if(message == "admin")
			{
				window.location.href = Settings.RootPath + '?controller=Admin&action=show';
			}
			//CloseTab();
		}
		else
		{
			Validation.CreateFeedback('Je hebt een ongeldige inlognaam en/of foutief wachtwoord opgegeven.');
		}
	}

	this.CallXmlHttp = function(url)
	{
		var XMLHTTP = false
		if ( window.ActiveXObject ) XMLHTTP = new ActiveXObject("Microsoft.XMLHTTP")
		if ( window.XMLHttpRequest ) XMLHTTP = new XMLHttpRequest()

		XMLHTTP.onreadystatechange = function()
		{
			if (XMLHTTP.readyState == 4)
			{
				Login.Message(XMLHTTP.responseText);
				XMLHTTP = null
			}
		}

		XMLHTTP.open("POST", url, true);
		var uname = document.getElementById('userName').value;
		var upass = document.getElementById('userPassword').value;

		XMLHTTP.setRequestHeader("Content-type", "application/x-www-form-urlencoded");
		XMLHTTP.send('userName='+uname+'&userPassword='+upass);
		
	}
}