var letterTracker = {
    settings: {
        patient_autocompleteUrl: '',
        provider_autocomplete_url: '',
    },
    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);
        });

        jQ('#clinicians').bind('change', function () {
            var val = jQ(this).val();
            jQ('#form-clinician-id').val(val);
        });
    },
    bindAutoComplete: function() {
        global.autocomplete.bind(letterTracker.settings.patient_autocompleteUrl, '#form-patient-fullName', '#form-patient-id');
        global.autocomplete.bind(letterTracker.settings.provider_autocomplete_url, '#form-provider-fullName', '#form-provider-id');

    }
};