jQuery(document).ready(function(){
	
	jQuery("#info > ul").tabs();
	
	jQuery('#pause').click(function() {
		jQuery('#slides').cycle('pause');
		return false;
	});
    jQuery('#play').click(function() {
		jQuery('#slides').cycle('resume');
		return false;
	});
    
    jQuery('#chirashi').hover(function() {
		jQuery('#controls').fadeIn();
		jQuery('#chirashiTitle').fadeOut();
	},function() {
		jQuery('#controls').fadeOut();
		jQuery('#chirashiTitle').fadeIn();
	});
    
    jQuery('#slides').cycle({
        fx:     'fade',
        speed:   400,
        timeout: 6000,
        next:   '#next',
        prev:   '#prev'
    });

});

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