var authentication2 =
{
	login: function()
	{
		$('#' + resources.get('CID_Login_Message')).hide();
		$('#' + resources.get('CID_Login_ButtonLogin')).hide();
		$('#' + resources.get('CID_Login_Spinner')).show();

		$('#' + resources.get('CID_Login_ButtonPostbackLogin')).click();
	},
	onLogin: function(response)
	{
		if (response.ErrorMessage != null)
		{
			$('#' + resources.get('CID_Login_Message')).html(response.ErrorMessage);
			$('#' + resources.get('CID_Login_Spinner')).hide();
			$('#' + resources.get('CID_Login_ButtonLogin')).show();
			$('#' + resources.get('CID_Login_Message')).show();
		}
		else
			document.location.href = response.RedirectURL;
	},
	init: function()
	{
		$('#' + resources.get('CID_Login_Nickname') + ', ' + '#' + resources.get('CID_Login_Password')).keydown(function(event)
		{
			if (events.keyCode(event) == 13)
			{
				authentication2.login();
				return false;
			}
			return true;
		});
		$('#' + resources.get('CID_Login_ButtonLogin')).click(function()
		{
			authentication2.login();
		});
		$('#tblLogin').show();
	}
}
