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();
    });
};


$(document).ready(function(){

	// Home advertenties
	var adv = function()
    {
        setTimeout(function(){
            $('#adv li:first').animate( {marginTop: '-120px'}, 800, function()
            {
                $(this).detach().appendTo('ul#adv').removeAttr('style');
				adv();
            });
        }, 2500);
    };
    adv();
	
    $('#feed').jcarousel({
        horizontal: true,
		auto: 2,
		scroll: 1,
		wrap: "circular",
		animation: 5000
		//initCallback: mycarousel_initCallback
    });

    $('#nieuws').jcarousel({
        horizontal: true,
		auto: 1,
		scroll: 1,
		wrap: "circular",
		animation: 2500
		//initCallback: mycarousel_initCallback
    });
	
	/*
	$('#adv').jcarousel({
        vertical: true,
		auto: 1,
		scroll: 1,
		wrap: "circular",
		animation: 2500,
		//initCallback: mycarousel_initCallback
    });
	*/
	
	// CTA_Home onClick
	$('table.home table').click(function(){
		document.location.href = $(this).find('a').attr('href');
		});

});
