<!--
/**
 * We use the initCallback callback
 * to assign functionality to the controls
 */
function event_carousel_initCallback(carousel)
{

	/*
	* Scrolls the carousel to a certain position.
	* @method scroll
	* @return undefined
	* @param item_index {Number} The index of the element to scoll to.
	* @param animation {Boolean} Flag indicating whether to perform animation.
	*/

	jQuery('.jcarousel-control a').bind('click', function() {
		var container = $('#event_carousel');
		var startPlace = $('li',container).index($("#"+this.name,container));
		startPlace = startPlace + 1;
		if (carousel.first != startPlace) {
			carousel.scroll(jQuery.jcarousel.intval(startPlace));
		}
		return false;
	});

	jQuery('.jcarousel-control a').hover(function() {
		var container = $('#event_carousel');
		var startPlace = $('li',container).index($("#"+this.name,container));
		startPlace = startPlace + 1;
		if (carousel.first != startPlace) {
			carousel.scroll(jQuery.jcarousel.intval(startPlace));
		}
		return false;
    }, function() {
		return false;
	});

	// 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();
    });
};
 
jQuery(document).ready(function() {
	$('#event_carousel li.event_item_hidden').show();
	var container = $('#event_carousel');
	var startPlace = $('li',container).index($('.event_item_active',container));
	startPlace = startPlace + 1;
	jQuery('#event_carousel').jcarousel({
		start: startPlace,
		auto: 4,
		scroll: 1,
		visible: 1,
		wrap: 'circular',
		buttonNextHTML: null,
		buttonPrevHTML: null,
		initCallback: event_carousel_initCallback
	});
});
-->
