(function($){

$(document).ready(function() {
    var theLinks = $('#mmButtonLinks a').map(function(){return [this]});

        $('.landing_page_slideshow').after('<div id="home_page_carousel_nav"><div id="Div1"></div></div>').cycle({
            fx: 'fade', 
            speed: '700',
            timeout: '4000',
            pager: '#home_page_carousel_nav',
            pagerEvent: 'mouseover',
            fastOnEvent: true,
            activePagerClass: 'activeSlide',
            pagerAnchorBuilder: function (index) {
                var title = theLinks[index].innerHTML;
                var href = theLinks[index].href;
                var target = theLinks[index].target;

                var output = '<a ';
                output += 'href="' + href + '" ';
                output += 'target="' + target + '"><p>';
                output += title + '</p></a>';
                return output;
            }
            
        });

    $('#home_page_carousel_nav a').click(function() {
        if (this.target == "" || this.target == "_blank") {
            var win = window.open(this.href);
        } else {
            location.href = this.href;
        }
        return false;
    });
      
    });
})(jQuery);
