
Lookup = {
    company: 0,
    exclude: '',
    request: null,
    init: function(container) {
        jQuery(container).on('keyup', '#user-search', function(event) {
            if (Lookup.request !== null) {
                Lookup.request.abort();
            }
            Lookup.request = jQuery.ajax({
                url: eDoc.basePath + '/lookup/search',
                data: {
                    s: jQuery(this).val(),
                    x: Lookup.exclude,
                    c: Lookup.company,
                    r: jQuery(this).data('row')
                },
                type: 'GET',
                cache: false,
                beforeSend: function() {
                    progessBar = '<div class="progress progress-striped active"><div class="progress-bar active" role="progressbar" style="width: 100%"></div></div>';
                    jQuery('.table-users-lookup tbody').html('<tr><td class="notice text-center" colspan="2">' + progessBar + 'Please wait...</td></tr>');
                },
                success: function(data) {
                    jQuery('.table-users-lookup tbody').html(data);
                    Lookup.request = null;
                }
            });
        });
    }

}