$slideshow2 = {
    context: false,
    tabs: false,
    timeout: 0,      // time before next slide appears (in ms)
    slideSpeed: 500,   // time it takes to slide in each slide (in ms)
    tabSpeed: 900,      // time it takes to slide in each slide (in ms) when clicking through tabs
    fx: 'scrollHorz',   // the slide effect to use
    
    init2: function() {
        // set the context2 to help speed up selectors/improve performance
        this.context = $('#carousel');
        
        // set tabs to current hard coded navigation items
        this.tabs = $('ul.carousel-nav li', this.context);
        
        // remove hard coded navigation items from DOM 
        // because they aren't hooked up to jQuery cycle
        this.tabs.remove();
        
        // prepare slideshow and jQuery cycle tabs
        this.prepareSlideshow2();
    },
    
    prepareSlideshow2: function() {
        // initialise the jquery cycle plugin -
        // for information on the options set below go to: 
        // http://malsup.com/jquery/cycle/options.html
        $('div.studies > ul', $slideshow2.context2).cycle({
            fx: $slideshow2.fx,
            timeout: $slideshow2.timeout,
            speed: $slideshow2.slideSpeed,
            fastOnEvent: $slideshow2.tabSpeed,
            pager: $('ul.carousel-nav', $slideshow2.context2),
            pagerAnchorBuilder: $slideshow2.prepareTabs2,
            before: $slideshow2.activateTab,
            pauseOnPagerHover: true,
            pause: true,
			next: ("#next2"),
			prev: ("#prev2"),
			fit:0

        });            
    },
    
    prepareTabs2: function(i, slide) {
        // return markup from hardcoded tabs for use as jQuery cycle tabs
        // (attaches necessary jQuery cycle events to tabs)
        return $slideshow2.tabs.eq(i);
    },

    activateTab: function(currentSlide, nextSlide) {
        // get the active tab
        var activeTab = $('a[href="#' + nextSlide.id + '"]', $slideshow.context2);
                  
    }            
};


$(function() {
    // add a 'js' class to the body
    $('body').addClass('js');
    
    // initialise the slideshow when the DOM is ready
    $slideshow2.init2();
});  