
function mycarousel_initCallback(carousel)
{
    // Disable autoscrolling if the user clicks the prev or next button.
    carousel.buttonNext.bind('click', function() {
        carousel.startAuto(0);
    });

    carousel.buttonPrev.bind('click', function() {
        carousel.startAuto(0);
    });

    // Pause autoscrolling if the user moves with the cursor over the clip.
    carousel.clip.hover(function() {
        carousel.stopAuto();
    }, function() {
        carousel.startAuto();
    });
};

	$(function () {

	    $('#all_activities .feeds_carousel').jcarousel({
	        auto: 3,
	        wrap: 'circular',
			vertical: true, 
			scroll: -1,
			start: 1,
			animation:1000,
			buttonNextHTML: null,
			buttonPrevHTML: null,
	        initCallback: mycarousel_initCallback
	    });
		/*
		jQuery('#current_user_activities .feeds_carousel').jcarousel({
	        auto: 3,
	        wrap: 'circular',
			vertical: true, 
			scroll: 1,
			start: 30,
			animation:1000,
			buttonNextHTML: null,
			buttonPrevHTML: null,
	        initCallback: mycarousel_initCallback
	    });
		*/

		//Making the feed span to aligned Middle vertically.
		$('span.feed ').each(function(index) {
				if ($(this).height() > 50) //for 4 liners
				{
					$(this).css("margin-top", "3px");
				}else if ($(this).height() > 40) //for 3 liners
				{
					$(this).css("margin-top", "10px");
				}else if ($(this).height() > 20) //for 2 liners
				{
					$(this).css("margin-top", "18px");
				}else {
					$(this).css("margin-top", "23px");
				}
				
		  });
	});

