

/**
 * Custom button state handler for enabling/disabling button state.
 * Called when the carousel has determined that the previous button
 * state should be changed.
 * Specified to the carousel as the configuration
 * parameter: prevButtonStateHandler
 **/
var handlePrevButtonState = function(type, args) {
    var leftImage = args[1];
    leftImage.src = baseUrl + "/images/new/content/slider/butt_left.png";
};

/**
 * Custom button state handler for enabling/disabling button state.
 * Called when the carousel has determined that the next button
 * state should be changed.
 * Specified to the carousel as the configuration
 * parameter: nextButtonStateHandler
 **/
var handleNextButtonState = function(type, args) {
    var rightImage = args[1];
    rightImage.src = baseUrl + "/images/new/content/slider/butt_right.png";
};


/**
 * You must create the carousel after the page is loaded since it is
 * dependent on an HTML element (in this case 'mycarousel'.) See the
 * HTML code below.
 **/
var carousel; // for ease of debugging; globals generally not a good idea
var pageLoad = function() {
    carousel = new YAHOO.extension.Carousel("mycarousel",
    {
        numVisible:        4,
        animationSpeed:    1,
        scrollInc:         3,
        navMargin:         20,
        prevElement:     "prev-arrow",
        nextElement:     "next-arrow",
        size:              sliderSize,
        prevButtonStateHandler:   handlePrevButtonState,
        nextButtonStateHandler:   handleNextButtonState
    }
    );

};

YAHOO.util.Event.addListener(window, 'load', pageLoad);

