$(function(){
	
	var config = {    
	     over: colourUp, // function = onMouseOver callback (REQUIRED)    
	     timeout: 500, // number = milliseconds delay before onMouseOut    
	     out: colourDown // function = onMouseOut callback (REQUIRED)    
	};
	
	$(".portfolio_box").hoverIntent(config);
	
	$(".portfolio_box").click(function() {
		var url = $(this).children('a').attr('href');
		window.location = url;
	});
	
});

function colourUp() {
	//Show Services
	$(this).children('span.client_services').fadeIn(500);
	$(this).children('img.portfolio_image').fadeOut(500);
}

function colourDown() {
	//Hide Services
	$(this).children('span.client_services').fadeOut(500);
	$(this).children('img.portfolio_image').fadeIn(500);
}

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