$(document).ready(function () {
	$.ajax({
		type: "POST",
		data: JSON.stringify({ Value: "as" }),
		url: "/Home/Profile/UserNameSection?handler=UserName",
		headers: { "RequestVerificationToken": $('input[name="__RequestVerificationToken"]').val() },
		contentType: "application/json; charset=utf-8",
		dataType: "json",
		success: function (response) {
			$("#usernameH").text(response.firstName + " " + response.surname);
		},
		error: function (error) {
			console.log(error)
		}
	})
})

function logOut() {
	$.ajax({
		type: "POST",
		data: JSON.stringify({ Value: "as" }),
		url: "/Index?handler=LogOff",
		headers: { "RequestVerificationToken": $('input[name="__RequestVerificationToken"]').val() },
		contentType: "application/json; charset=utf-8",
		dataType: "json",
		success: function (response) {
			window.location.href = "/Index";
		},
		error: function (error) {
			console.log(error)
		}
	})
}