var fax = {
    settings: {
        company_autocompleteUrl: '',
        branch_autocompleteUrl: '',
    },
    init: function() {
        this.bindAutoComplete();

        jQ('#companies').bind('change', function () {
            var val = jQ(this).val();
            jQ('#form-company-id').val(val);
        });

        jQ('#branches').bind('change', function () {
            var val = jQ(this).val();
            jQ('#form-branch-id').val(val);
        });
    },
    bindAutoComplete: function() {
        global.autocomplete.bind(fax.settings.company_autocompleteUrl, '#form-company-desc', '#form-company-id');
        global.autocomplete.bind(fax.settings.branch_autocompleteUrl, '#form-branch', '#form-branch-id');

    }
};