// connexion au compte wagwire

function Ajax_Identification()
{
	$.ajax
	({
		type: 'POST',
		url: "/ajax/Identification.php",		
		data: "username="+$('div.navigation > div.identification > div.form > label.username > input.text').val()+"&password="+$('div.navigation > div.identification > div.form > label.password > input.password').val(),
		dataType: 'json',

		success: function (reponse) 
		{  
			switch (reponse.state)
			{
				case "success":
					if (reponse.sessionTest == "false")
					{
						document.location.href = "";
					}
					else if ($("div#header div.navigation").attr("currentpage") == "game")
					{
						document.location.href = "";
					}
					else if ($("div#header div.navigation").attr("currentpage") != "message")
					{
						document.location.href = "/account/mailbox/";
					}
					else 
					{
						document.location.href = "";
					}
					break;
										
				default :
					$('div.navigation > div.identification > div.feedback').html(reponse.htmlData);
					UI_Identification_UserFeedback(reponse.state);
					break;
			}
		},

		error: function () {
			// alert('error');
		}

	});// End Ajax

}