// Wait until images have loaded before starting cycle
$(window).load(function() {
	
	$('.slideshow').cycle({
		fx: 'fade',
		speed:  'slow',
		pager:  '#community_nav',
		before: onBefore,
		pagerAnchorBuilder: function(index, el) {
        	return '<a href="#"> </a>';
    	}
	});
});

// callback fired when each slide transition begins
function onBefore(curr,next,opts) {
    var $slide = $(next);
    var w = $slide.outerWidth();
    var h = $slide.outerHeight();
    $slide.css({
        marginTop: (65 - h) / 2,
        marginLeft: (198 - w) / 2
    });
    $('#community_output').html($(".community_info",this).html());
};
