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() {

	// porfolio slider
	
    $('#mycarousel').jcarousel({
        auto: 5,
        wrap: 'last',
        scroll: 1,
        animation: 'slow',
        initCallback: mycarousel_initCallback
    });
    
    $("#mycarousel a").bind("mouseenter",function(){
      $(this).next("span").fadeIn('fast');
    }).bind("mouseleave",function(){
      $(this).next("span").hide();
    });

    
    // Colors
    
    $("a.white").click(function(){
		$("body").css({backgroundColor : "#ffffff"});
	});
	$("a.pink").click(function(){
		$("body").css({backgroundColor : "#bf3535"});
	});
	$("a.yellow").click(function(){
		$("body").css({backgroundColor : "#f2efbc"});
	});
	$("a.green").click(function(){
		$("body").css({backgroundColor : "#ecf248"});
	});
	$("a.grey").click(function(){
		$("body").css({backgroundColor : "#f265a7"});
	});
	$("a.red").click(function(){
		$("body").css({backgroundColor : "#f2c4cf"});
	});
	$("a.light-blue").click(function(){
		$("body").css({backgroundColor : "#b4dfff"});
	});
	$("a.violet").click(function(){
		$("body").css({backgroundColor : "#8bbf1c"});
	});
	$("a.brown").click(function(){
		$("body").css({backgroundColor : "#9873dc"});
	});
	$("a.fucsia").click(function(){
		$("body").css({backgroundColor : "#da1a7d"});
	});

});