jQuery = jQuery.noConflict(); 
 

jQueryslideshow = {
    context: false,
    tabs: false,
    timeout: 5000,      // time before next slide appears (in ms)
    slideSpeed: 1500,   // time it takes to slide in each slide (in ms)
    tabSpeed: 300,      // time it takes to slide in each slide (in ms) when clicking through tabs
    fx: 'fade',   // the slide effect to use e.g. 'fade', 'scrollright', 'scrollleft', 'scrolltop', 'scrollbottom'
    pauseOnPagerHover: true, // set true/false, if you want the slideshow to stop when mouse on the tabs
    pause: false, // set true/false, if you want the slideshow to stop when mouse on BIG Images



// DO NOT TOUCH BELOW HERE
// DO NOT TOUCH BELOW HERE
// DO NOT TOUCH BELOW HERE
// DO NOT TOUCH BELOW HERE
// DO NOT TOUCH BELOW HERE
// DO NOT TOUCH BELOW HERE


    init: function() {
        // set the context to help speed up selectors/improve performance
        this.context = jQuery('#slideshow');

        // set tabs to current hard coded navigation items
        this.tabs = jQuery('ul.slides-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.prepareSlideshow();
    },

    prepareSlideshow: function() {
        // initialise the jquery cycle plugin -
        // for information on the options set below go to: 
        // http://malsup.com/jquery/cycle/options.html
        jQuery("div.slides > ul", jQueryslideshow.context).cycle({
            fx: jQueryslideshow.fx,
            timeout: jQueryslideshow.timeout,
            speed: jQueryslideshow.slideSpeed,
            fastOnEvent: jQueryslideshow.tabSpeed,
            pager: jQuery("ul.slides-nav", jQueryslideshow.context),
            pagerAnchorBuilder: jQueryslideshow.prepareTabs,
            before: jQueryslideshow.activateTab,
            pauseOnPagerHover: jQueryslideshow.pauseOnPagerHover,
            pause: jQueryslideshow.pause

        });
    },

    prepareTabs: function(i, slide) {
        // return markup from hardcoded tabs for use as jQuery cycle tabs
        // (attaches necessary jQuery cycle events to tabs)
        return jQueryslideshow.tabs.eq(i);
    },

    activateTab: function(currentSlide, nextSlide) {
        // get the active tab
        var activeTab = jQuery('a[href="#' + nextSlide.id + '"]', jQueryslideshow.context);

        // if there is an active tab
        if (activeTab.length) {
            // remove active styling from all other tabs
            jQueryslideshow.tabs.removeClass('on');

            // add active styling to active button
            activeTab.parent().addClass('on');
        }
    }
};


jQuery(function() {
    // initialise the slideshow when the DOM is ready
    jQueryslideshow.init();
});