    (function () {
        // Get the image link from within its (parent) container.
        function getImage(parent) {
            var el = parent.firstChild;
                    
            while (el) { // walk through till as long as there's an element
                if (el.nodeName.toUpperCase() == "IMG") { // found an image
                    return el.src.replace(/&h=81&w=81&zc=CC$/, "&amp;w=456&amp;h=456&amp;far=CC");
                }
                el = el.nextSibling;
            }
            
            return "";
        }
                
        YAHOO.util.Event.onDOMReady(function (ev) {
            var spotlight   = YAHOO.util.Dom.get("spotlight"),
                carousel    = new YAHOO.widget.Carousel("container", {
			// specify number of columns and number of rows
			numVisible: [3,3]
                });
                       
            carousel.on("itemSelected", function (index) {
                // item has the reference to the Carousel's item
                var item = carousel.getElementForItem(index);

                if (item) {
                    spotlight.innerHTML = "<img class=\"slide\" src=\""+getImage(item)+"\" />";
                }
            });
                
            carousel.render(); // get ready for rendering the widget
            carousel.show();   // display the widget
        });
    })();

