$(document).ready(function(){

    var ref = window.location.pathname;
    ref = ref.split('/',3);
    if(!!ref[2]) {
        if(ref[2].length == 32)
        {
            $.ajax({
                type : 'POST',
                data : "idF="+ref[2],
                url  : '/',
                success: function(data){
                    $.notij(data,{'type':'info'});
                }
            });

        }
    }else
        window.history.pushState(null, null, "/forgot");

    //lang
    $('body').on('click', '[lang]', function () {
        $.cookie('lang', $(this).attr('lang'), {
            expires: 5
        });
        location.reload();
    });
    $(".chzn-select").each(function(){
        $(this).select2($(this).data());
    });
    //capcha
    function RECaptcha(){
        $('input[name="captcha"]').val('');
        $('#capchaimg').attr('src', '/captcha');
        //document.getElementById('captcha').src = 'capcha/captcha.php';
    }
    $('#capchaimg').click(function(){ RECaptcha(); });

    //login
    $('#account').focus();

});