// Credits: Robert Penners easing equations (http://www.robertpenner.com/easing/).
$.easing['BounceEaseOut'] = function(p, t, b, c, d) {
	if ((t/=d) < (1/2.75)) {
		return c*(7.5625*t*t) + b;
	} else if (t < (2/2.75)) {
		return c*(7.5625*(t-=(1.5/2.75))*t + .75) + b;
	} else if (t < (2.5/2.75)) {
		return c*(7.5625*(t-=(2.25/2.75))*t + .9375) + b;
	} else {
		return c*(7.5625*(t-=(2.625/2.75))*t + .984375) + b;
	}
};


function hcarousel_work_initCallback(carousel) {
    $('#home_feat_work .next').bind('click', function() {
        carousel.next();
        return false;
    });

    $('#home_feat_work .prev').bind('click', function() {
        carousel.prev();
        return false;
    });
};

function hcarousel_news_initCallback(carousel) {
    $('#home_news .next').bind('click', function() {
        carousel.next();
        return false;
    });

    $('#home_news .prev').bind('click', function() {
        carousel.prev();
        return false;
    });	
};

$().ready(function () {
	
    $("#hcarousel_work").jcarousel({
        scroll: 3,
		initCallback: hcarousel_work_initCallback,
        // This tells jCarousel NOT to autobuild prev/next buttons
        buttonNextHTML: null,
        buttonPrevHTML: null, 
        easing: 'swing',		      
		animation: 1000,
    });
	
    $("#hcarousel_news").jcarousel({
        scroll: 3,
		initCallback: hcarousel_news_initCallback,
        // This tells jCarousel NOT to autobuild prev/next buttons
        buttonNextHTML: null,
        buttonPrevHTML: null, 
        easing: 'swing',		      
		animation: 1000,
    });	

	//single pages	
$('.ic_container').mouseover(function() {
        $(this).children('.ic_caption').stop().animate({ bottom: '67px', height: '67px' }, { duration: 350, easing: 'swing' });
		
	}).mouseout(function(){
		$(this).children('.ic_caption').stop().animate({ bottom: '0px', height: '0px' }, { duration: 350, easing: 'swing' });
    });

}); 	
