public/javascripts/yui/calendar/calendar.js
function() {
        var el = this.submitEl,
            f = this.__getCfg("initialFocus");

        if (f && f.toLowerCase) {
            f = f.toLowerCase();
            if (f == "year") {
                el = this.yearEl;
                try {
                    this.yearEl.select();
                } catch (selErr) {
                    // Ignore;
                }
            } else if (f == "month") {
                el = this.monthEl;
            }
        }

        if (el && YAHOO.lang.isFunction(el.focus)) {
            try {
                el.focus();
            } catch (focusErr) {
                // TODO: Fall back if focus fails?
            }
        }
    }
function() {
        var el = this.submitEl,
            f = this.__getCfg("initialFocus");

        if (f && f.toLowerCase) {
            f = f.toLowerCase();
            if (f == "year") {
                el = this.yearEl;
                try {
                    this.yearEl.select();
                } catch (selErr) {
                    // Ignore;
                }
            } else if (f == "month") {
                el = this.monthEl;
            }
        }

        if (el && YAHOO.lang.isFunction(el.focus)) {
            try {
                el.focus();
            } catch (focusErr) {
                // TODO: Fall back if focus fails?
            }
        }
    }
function ( ) { var el = this . submitEl , f = this . __getCfg ( "initialFocus" ) ; if ( f && f . toLowerCase ) { f = f . toLowerCase ( ) ; if ( f == "year" ) { el = this . yearEl ; try { this . yearEl . select ( ) ; } catch ( selErr ) { // Ignore; } } else if ( f == "month" ) { el = this . monthEl ; } } if ( el && YAHOO . lang . isFunction ( el . focus ) ) { try { el . focus ( ) ; } catch ( focusErr ) { // TODO: Fall back if focus fails? } } }
Sets the initial focus, based on the configured value
@method setInitialFocus
Sets the initial focus based on the configured value