/* $Id: jquery.wsdatepicker.js 18334 2011-10-05 16:57:00Z tcoehoorn $ */

/*
 * jquery.wsdatepicker.js
 *
 * This file contains the Weddingstar datepicker plugin.  It automatically
 * accounts for our custom "No Date" option.  If a user selects this option,
 * the input value is set to "No Date".  If the user selects a date, the
 * input value is set to the date value.
 */

(function($) {
    /* Invoke the Weddingstar datepicker functionality
     *
     * @param  options  string - a command, optionally followed by additional parameters or
     *                  Object - settings for attaching new datepicker functionality
     * @return  jQuery object 
     */
    $.fn.wsdatepicker = function(options) {
        $(this).datepicker(options);

        return $(this).focus(function() {
            input = this;
            $('#ui-datepicker-nodate').click(function()
            {
                $(input).val('No Date');
            });
        });
    }
}) (jQuery);


