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();
    });
};

jQuery(document).ready(function() {
    jQuery('#mycarousel').jcarousel({
        auto: 5,
        scroll: 1,
        wrap: 'last',
        initCallback: mycarousel_initCallback
    });
});

function enterEvent(event){
    if(event.keyCode=='13'){
        freeWordSearch();
    }
}

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();
    });
};

jQuery(document).ready(function() {
	var str = getSearchKeyword();
    if(str.match(/紙管/i)){
    $("#topcarousel").css("display", "block");
    jQuery('#topcarousel').jcarousel({
    	auto: 8,
		scroll: 1,
		wrap: 'circular'		
    });
    } else if(str.match(/梱包材/i)){
    $("#topcarousel2").css("display", "block");
    jQuery('#topcarousel2').jcarousel({
    	auto: 8,
		scroll: 1,
		wrap: 'circular'		
    });
    } else if(str.match(/プラスチック/i)){
    $("#topcarousel3").css("display", "block");
    jQuery('#topcarousel3').jcarousel({
    	auto: 8,
		scroll: 1,
		wrap: 'circular'		
    });
    } else if(str.match(/高粘液/i)){
    $("#topcarousel4").css("display", "block");
    jQuery('#topcarousel4').jcarousel({
    	auto: 8,
		scroll: 1,
		wrap: 'circular'		
    });
    } else if(str.match(/紙容器/i)){
    $("#topcarousel5").css("display", "block");
    jQuery('#topcarousel5').jcarousel({
    	auto: 8,
		scroll: 1,
		wrap: 'circular'		
    });
    } else {
    $("#topcarousel_default").css("display", "block");
        jQuery('#topcarousel_default').jcarousel({
    	auto: 8,
		scroll: 1,
		wrap: 'circular'		
    });
    }
});

