var patient_billing_refund = {
    settings: {
        patient_autocompleteUrl: '',
        branch_autocompleteUrl: '',
        company_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(patient_billing_refund.settings.patient_autocompleteUrl, '#form-patient-fullName', '#form-patient-id');
        global.autocomplete.bind(patient_billing_refund.settings.branch_autocompleteUrl, '#form-branch', '#form-branch-id');
        global.autocomplete.bind(patient_billing_refund.settings.company_autocompleteUrl, '#form-company-desc', '#form-company-id');

    }
};