$(document).ready(function () {
    $('div.inputdate input').live('focus', function () {
        $(this).datepicker({
            beforeShow: function () { $(this).css("background-color", "#ff9"); },
            onSelect: function (dateText, inst) {
                var thisTime = new Date();
                $(this).css("background-color", "").attr('value', dateText);
            },
            onClose: function (dateText, inst) {
                $(this).css("background-color", "");
            }
        });
    });

    $('div.inputdtime input').live('focus', function () {
        $(this).datepicker({
            beforeShow: function () { $(this).css("background-color", "#ff9"); },
            onSelect: function (dateText, inst) {
                var thisTime = new Date();
                var Hours = (thisTime.getHours() < 10) ? '0' + thisTime.getHours() : thisTime.getHours();
                var Minutes = (thisTime.getMinutes() < 10) ? '0' + thisTime.getMinutes() : thisTime.getMinutes();
                $(this).css("background-color", "").attr('value', dateText + " " + Hours + ":" + Minutes);
            },
            onClose: function (dateText, inst) {
                $(this).css("background-color", "");
            }
        });
    });
});