could explain how this jquery ui month and year picker works

This jquery function

 $(function() {
    $("input[id$=dntFromMonth]").datepicker({
        changeMonth: true,
        changeYear: true,
        showButtonPanel: true,
        dateFormat: 'M yy'
    }).focus(function() {
        var thisCalendar = $(this);
        $('.ui-datepicker-calendar').detach();
        $('.ui-datepicker-close').click(function() {
            var month = $("#ui-datepicker-div .ui-datepicker-month :selected").val();
            var year = $("#ui-datepicker-div .ui-datepicker-year :selected").val();
            thisCalendar.datepicker('setDate', new Date(year, month, 1));
            $("input[id$=dntToMonth]").datepicker("option", "minDate", new Date(year, month, 1));
        });
    });
});