function onBefore() {
    $('#slidetitle').html($(this).find('img').attr('alt'));
}

jQuery(document).ready(function() {
    //SUPERFISH PLUGIN FOR MENU
    $("#menu ul").superfish({
        autoArrows: false,
        delay: 0,
        speed : 200,
        animation:{
            height: "show"
        },
        dropShadows : true
    });

    $('#slides').cycle({
        fx:     'fade',
        speed:   500,
        timeout: 9000,
        delay:  -2000,
        pager: '#slidenav',
        before: onBefore,
        pagerAnchorBuilder: function(idx, slide) {
            return '<a href="#"></a>';
        },
        before:     function(currSlideElement, nextSlideElement) {
            var caption = $(nextSlideElement).find('img').attr('alt');
            if ( $(nextSlideElement).find('img').attr('title') ) {
                caption = '<span class="caption_title">' + $(nextSlideElement).find('img').attr('title') + '</span> - ' + caption;
            }
            $('#caption').fadeOut(250, function() {
                $('#caption').html(caption).fadeIn(250);
            })
        }
    });
});












