	$(document).ready(function () {
		

	    $('#carousel').jcarousel({
			vertical: true,
			scroll: 1,
			auto: 2,
			wrap: 'last',
			animation: 3000,
			initCallback: mycarousel_initCallback
	   	});

 
	//Front page Carousel - Initial Setup
   	$('div#slideshow-carousel a img').css({'opacity': '1.0'});
   	$('div#slideshow-carousel a img:first').css({'opacity': '1.0'});
   	$('div#slideshow-carousel li a:first').append('<span class=\"arrow\"></span>')
   	$('div#slideshow-carousel li a:first').find('.bunka_normal').attr('class', 'bunka_selected');
   	$('div#slideshow-carousel li a:first').find('.img').attr('class', 'img_border');
   	$('div#slideshow-carousel li a:first').find('.text').attr('class', 'text_border');
 
  
  	//Combine jCarousel with Image Display
    $('div#slideshow-carousel li a').hover(        
       	function () {
       		if (!$(this).has('span').length) {
        		$('div#slideshow-carousel li a img').stop(true, true).css({'opacity': '1.0'});
   	    		$(this).stop(true, true).children('img').css({'opacity': '1.0'});
       		}		
       	},
       	function () {
        		
       		$('div#slideshow-carousel li a img').stop(true, true).css({'opacity': '1.0'});
       		$('div#slideshow-carousel li a').each(function () {
 
       			if ($(this).has('span').length) $(this).children('img').css({'opacity': '1.0'});
 
       		});
        		
       	}
	).click(function () {
 
	      $('span.arrow').remove();
 		    $('#slideshow-carousel').find('.bunka_selected').attr('class', 'bunka_normal');
        $('#slideshow-carousel').find('.img_border').attr('class', 'img');
        $('#slideshow-carousel').find('.text_border').attr('class', 'text');
                        
		    $(this).append('<span class=\"arrow\"></span>');
		    $(this).find('.bunka_normal').attr('class', 'bunka_selected');
		    $(this).find('.img').attr('class', 'img_border');
		    $(this).find('.text').attr('class', 'text_border');
		    

		    
       	$('div#slideshow-main li').removeClass('active');                                                 
       	$('div#slideshow-main li.' + $(this).attr('rel')).addClass('active');	
        	
       	return false;
	});
 
 
});
 
 
//Carousel Tweaking
 
function mycarousel_initCallback(carousel) {
	
	// Pause autoscrolling if the user moves with the cursor over the clip.
	carousel.clip.hover(function() {
		carousel.stopAuto();
	}, function() {
		carousel.startAuto();
	});
}
