$(document).ready(function(){
    //lang
    $('body').on('click', '[lang]', function () {
        $.cookie('lang', $(this).attr('lang'), {
            expires: 5
        });
        location.reload();
    });

    $('body').on('click', '#close_lock', function () {
        $.cookie('cab', null);
        location.reload();
    });


    $(".chzn-select").each(function(){
        $(this).select2($(this).data());
    });
    //capcha
    function RECaptcha(){
        $('input[name="capcha"]').val('');
        $('#capchaimg').attr('src', '/captcha');
        document.getElementById('captcha').src = '/captcha';
    }
    $('#capchaimg').click(function(){ RECaptcha(); });

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