jQuery(document).ready(function($){
    var csl_form = $('#csl-form');
    $('#csl-upload-file').css('display', 'none');
    $('#csl-preloader').css('display', 'none');
    $('#csl-alert').css('display', 'none');

    $('#csl-ctr-upload-file').click(function(event){
        event.preventDefault();
        $('#csl-upload-file').click();
    });
    $('#csl-upload-file').change(function(){
        $(csl_form).submit()  
    });
    $(csl_form).submit(function(e){
        e.preventDefault();
        $.ajax({
            type: 'POST',
            url: 'includes/ajax.php',
            data: new FormData(this),
            contentType: false,
            cache: false,
            processData: false,
            success: function(data) {
                location.reload();
            }
        });
    })
})