﻿function checkLogin(username, password) {
	$('#loginerror').show().html('&nbsp;');
	$.ajax({
		type: "POST", dataType: 'json',
		url: "/account/login",
		data: { 'Username': username, 'Password': password },
		success: function(msg) {
			if (msg == true)
				window.location = '/customer';
			else
				$('#loginerror').show().html('Wachtwoord incorrect');
		}
	});
}

var tid = null;
function closelogin() {
	tid = null;
	$('#logindetails').slideUp(250);
}

function initpage() {
	$('#loginmenu').bind('mouseenter', function() { if (tid != null) { clearTimeout(tid); tid = null; } $('#logindetails').slideDown(250); });
	$('#loginmenu').bind('mouseleave', function() { tid = setTimeout('closelogin()', 1000); });
}
