public/javascripts/yui/carousel/carousel-debug.js
function (el, attrs) {
            var carousel = this,
                elId     = el,  // save for a rainy day
                parse    = false,
                selected;

            if (!el) {
                YAHOO.log(el + " is neither an HTML element, nor a string",
                        "error", WidgetName);
                return;
            }

            carousel._hasRendered = false;
            carousel._navBtns     = { prev: [], next: [] };
            carousel._pages       = { el: null, num: 0, cur: 0 };
            carousel._pagination  = {};
            carousel._itemAttrCache = {};

            carousel._itemsTable  = { loading: {}, numItems: 0,
                                      items: [], size: 0 };

            YAHOO.log("Component initialization", WidgetName);

            if (JS.isString(el)) {
                el = Dom.get(el);
            } else if (!el.nodeName) {
                YAHOO.log(el + " is neither an HTML element, nor a string",
                        "error", WidgetName);
                return;
            }

            Carousel.superclass.init.call(carousel, el, attrs);

            // check if we're starting somewhere in the middle
            selected = carousel.get("selectedItem");
            if(selected > 0){
                carousel.set("firstVisible",getFirstVisibleForPosition.call(carousel,selected));
            }

            if (el) {
                if (!el.id) {   // in case the HTML element is passed
                    el.setAttribute("id", Dom.generateId());
                }
                parse = carousel._parseCarousel(el);
                if (!parse) {
                    carousel._createCarousel(elId);
                }
            } else {
                el = carousel._createCarousel(elId);
            }
            elId = el.id;

            carousel.initEvents();

            if (parse) {
                carousel._parseCarouselItems();
            }

            // add the selected class
            if(selected > 0){
                setItemSelection.call(carousel,selected,0);
            }

            if (!attrs || typeof attrs.isVertical == "undefined") {
                carousel.set("isVertical", false);
            }

            carousel._parseCarouselNavigation(el);
            carousel._navEl = carousel._setupCarouselNavigation();

            instances[elId] = { object: carousel };
            carousel._loadItems(Math.min(carousel.get("firstVisible")+carousel.get("numVisible"),carousel.get("numItems"))-1);
        }
function (el, attrs) {
            var carousel = this,
                elId     = el,  // save for a rainy day
                parse    = false,
                selected;

            if (!el) {
                YAHOO.log(el + " is neither an HTML element, nor a string",
                        "error", WidgetName);
                return;
            }

            carousel._hasRendered = false;
            carousel._navBtns     = { prev: [], next: [] };
            carousel._pages       = { el: null, num: 0, cur: 0 };
            carousel._pagination  = {};
            carousel._itemAttrCache = {};

            carousel._itemsTable  = { loading: {}, numItems: 0,
                                      items: [], size: 0 };

            YAHOO.log("Component initialization", WidgetName);

            if (JS.isString(el)) {
                el = Dom.get(el);
            } else if (!el.nodeName) {
                YAHOO.log(el + " is neither an HTML element, nor a string",
                        "error", WidgetName);
                return;
            }

            Carousel.superclass.init.call(carousel, el, attrs);

            // check if we're starting somewhere in the middle
            selected = carousel.get("selectedItem");
            if(selected > 0){
                carousel.set("firstVisible",getFirstVisibleForPosition.call(carousel,selected));
            }

            if (el) {
                if (!el.id) {   // in case the HTML element is passed
                    el.setAttribute("id", Dom.generateId());
                }
                parse = carousel._parseCarousel(el);
                if (!parse) {
                    carousel._createCarousel(elId);
                }
            } else {
                el = carousel._createCarousel(elId);
            }
            elId = el.id;

            carousel.initEvents();

            if (parse) {
                carousel._parseCarouselItems();
            }

            // add the selected class
            if(selected > 0){
                setItemSelection.call(carousel,selected,0);
            }

            if (!attrs || typeof attrs.isVertical == "undefined") {
                carousel.set("isVertical", false);
            }

            carousel._parseCarouselNavigation(el);
            carousel._navEl = carousel._setupCarouselNavigation();

            instances[elId] = { object: carousel };
            carousel._loadItems(Math.min(carousel.get("firstVisible")+carousel.get("numVisible"),carousel.get("numItems"))-1);
        }
function ( el , attrs ) { var carousel = this , elId = el , // save for a rainy day parse = false , selected ; if ( ! el ) { YAHOO . log ( el + " is neither an HTML element, nor a string" , "error" , WidgetName ) ; return ; } carousel . _hasRendered = false ; carousel . _navBtns = { prev : [ ] , next : [ ] } ; carousel . _pages = { el : null , num : 0 , cur : 0 } ; carousel . _pagination = { } ; carousel . _itemAttrCache = { } ; carousel . _itemsTable = { loading : { } , numItems : 0 , items : [ ] , size : 0 } ; YAHOO . log ( "Component initialization" , WidgetName ) ; if ( JS . isString ( el ) ) { el = Dom . get ( el ) ; } else if ( ! el . nodeName ) { YAHOO . log ( el + " is neither an HTML element, nor a string" , "error" , WidgetName ) ; return ; } Carousel . superclass . init . call ( carousel , el , attrs ) ; // check if we're starting somewhere in the middle selected = carousel . get ( "selectedItem" ) ; if ( selected > 0 ) { carousel . set ( "firstVisible" , getFirstVisibleForPosition . call ( carousel , selected ) ) ; } if ( el ) { if ( ! el . id ) { // in case the HTML element is passed el . setAttribute ( "id" , Dom . generateId ( ) ) ; } parse = carousel . _parseCarousel ( el ) ; if ( ! parse ) { carousel . _createCarousel ( elId ) ; } } else { el = carousel . _createCarousel ( elId ) ; } elId = el . id ; carousel . initEvents ( ) ; if ( parse ) { carousel . _parseCarouselItems ( ) ; } // add the selected class if ( selected > 0 ) { setItemSelection . call ( carousel , selected , 0 ) ; } if ( ! attrs || typeof attrs . isVertical == "undefined" ) { carousel . set ( "isVertical" , false ) ; } carousel . _parseCarouselNavigation ( el ) ; carousel . _navEl = carousel . _setupCarouselNavigation ( ) ; instances [ elId ] = { object : carousel } ; carousel . _loadItems ( Math . min ( carousel . get ( "firstVisible" ) + carousel . get ( "numVisible" ) , carousel . get ( "numItems" ) ) - 1 ) ; }
Initialize the Carousel.

@method init
@public
@param el {HTMLElement | String} The html element that represents
the Carousel container.
@param attrs {Object} The set of configuration attributes for
creating the Carousel.
Initialize the Carousel .