function DoForgot() {
	$('#errormsg').hide();

	if ($('#email').val().length < 5) {
		$('#errormsg').html("L'adresse e-mail que vous avez tapée est trop courte.");
		$('#errormsg').show();
		return true;
	}
	
	if ($('#captcha').val().length < 5) {
		$('#errormsg').html("S'il vous plaît entrez le code correctement.");
		$('#errormsg').show();
		return true;
	}
	$('#forgot').hide(); $('#trying').show();
	
	$.post( $("#forgotform").attr('action'), $("#forgotform").serialize() ).done(function(data) {
		$('#trying').hide();
		if (data != 'done') {
			$('#errormsg').html(data);
			$('errormsg').show();
			$('forgot').show();
			RefreshImg();
		} else {
			$('#passsent').show();
		}
	}).fail(function(jqXHR, textStatus) {
		$('#trying').hide(); $('#forgot').show();
		alert('Erreur HTTP: '+textStatus+'.\nEssayez un autre fois plus tard.');
	});

}

function RefreshImg() {
	$('#captchaimg').attr('src','captcha.php?' + Math.random());
	$('#captcha').val('');
}
