function login() {
    $('#logerror').html('');
    $.post("/ajax.php?loger=loger", {email: $('#moncompte_identifiant').attr('value'), password: $('#moncompte_passe').attr('value')}, 
        function(data) {
            if(data=='1') {
                 window.location.href='';
            }
            else {
            $('#logerror').html(data);
            }
     });
    
}
function logout() {
    $.get("/ajax.php?loger=logout", 
        function(data) {
            if(data=='1') {
                 window.location.href='/';
            }
            else {
                window.location.href='';
            }
     });
}
function lostpass() {
    $('#logerror').html('&nbsp;');
    $.post("/ajax.php?loger=lostpass", {email: $('#moncompte_email').attr('value'), lost: 'yes'}, 
        function(data) {
            if(data==1) {
                closeLPF()
                $('#logerror').html('Nouveau mot de passe envoyé. Veuillez consulter votre courriel.');
            }
            else {
                $('#logerror').html('Vous avez entré un email inconnu.');
            }
        }
     );
    
}

function closeLPF()
{
    $('#logerror').html('&nbsp;');
	$('#user-login').removeClass('hidden').show();
	$('#user-lostpwd').removeClass('hidden').hide();
	return false;
}
function textLPF() {
    $('#logerror').html('Veuillez saisir votre email afin de recevoir un nouveau mot de passe.');
}

function favoritSup(Fwhere, FID) {
    $.get("/ajax.php?loger=favoritsup&where="+Fwhere+"&id="+FID, 
        function(data) {
            window.location.href='';
        }
     );
    
}
