jQuery(document).ready(function () {
    var id = 0;
    $('#SenderName').live('change', function () {
        if ($('#SenderName option:selected').data('id')) {
            var id = $('#SenderName option:selected').data('id');
        }
        $('#SenderId').val(id);
    });


    $('#cusType').on('click', function () {

        $.post('policyAjaxController.php?do=getCustomers', function (res) {
            $('#SenderName').val('');
            $('#SenderName').html(res);
            $('#SenderName').val('-1').change();
        });
    });

    $('#supType').on('click', function () {

        $.post('policyAjaxController.php?do=getSuppliers', function (res) {
            $('#SenderName').val('');
            $('#SenderName').html(res);
            $('#SenderName').val('-1').change();
        });
    });
});


