Datepicker Custom Buttons layout issue

Datepicker Custom Buttons layout issue

We have added 2 custom buttons to the bottom of the date picker.  They work great but when the buttons are showing and the datepicker decides to go above the input field, it blocks the input field.  If the buttons are not showing then it works as expected and does not block the field.  How can we make the date picker appear above the input field and not cover it up? Below is the code that creates the two custom buttons. Thanks.

$(function () {
    $('.datepicker').datepicker({
        showButtonPanel: true,
        beforeShow: function (input) {
            dpEmptyButton(input);
            dpTodayButton(input);
        },
        onChangeMonthYear: function (yy, mm, instance) {
            dpEmptyButton(instance.input);
            dpTodayButton(instance.input);
        }
    }); //Initialise any date pickers
    $("body").delegate(".datepicker", "focusin", function () {
        $(this).datepicker({
            showButtonPanel: true,
            beforeShow: function (input) {
                dpEmptyButton(input);
                dpTodayButton(input);
            },
            onChangeMonthYear: function (yy, mm, instance) {
                dpEmptyButton(instance.input);
                dpTodayButton(instance.input);
            }
        });
    });
    // notes datepicker
    $('.DatepickerNoButtonPanel').datepicker({
        showButtonPanel: false,

    });
    $("body").delegate(".DatepickerNoButtonPanel", "focusin", function () {
        $(this).datepicker({
            showButtonPanel: false,
        });
    });

});

function dpTodayButton(input) {
    setTimeout(function () {
        var buttonPane = $(input)
        .datepicker("widget")
        .find(".ui-datepicker-buttonpane");

        $("<button>", {
            text: "Today()",
            click: function () {
                $(dateVar).val('Today()');
                jQuery(input).datepicker('hide');
            }
        }).appendTo(buttonPane).addClass("ui-datepicker-clear ui-state-buttonPane");
    }, 1)
}

function dpEmptyButton(input) {
    setTimeout(function () {
        var buttonPane = $(input)
        .datepicker("widget")
        .find(".ui-datepicker-buttonpane");

        $("<button>", {
            text: "Empty()",
            click: function () {
                $(dateVar).val('Empty()');
                jQuery(input).datepicker('hide');
            }
        }).appendTo(buttonPane).addClass("ui-datepicker-clear ui-state-buttonPane");
    }, 1)
}