jQuery(document).ready(function() {	
	jQuery('#partnersCarosel').jcarousel({
        size: 30,
		auto: 3,
        wrap: 'last',
        initCallback: mycarousel_initCallback,
        easing: 'easeInOutExpo',
        animation: 1200
    });
	
	/*
	jQuery('#heroCarosel').jcarousel({
		scroll: 1,
		auto: 1,
        wrap: 'last',
        initCallback: mycarousel_initCallback,
        easing: 'easeInOutCubic',
        animation: 2000
    });
	*/

	$("#cycleFeature").before('<div id="nav">').cycle({ 
		fx:     'fade', 
	    speed:   700, 
	    timeout: 5000, 
	    next:   '#cycleFeature', 
	    pause:   1, 
		pager:  '#nav'
	});
});

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.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;
	}
};

jQuery.easing['easeInOutExpo'] = function (x, t, b, c, d) {
	if (t==0) return b;
	if (t==d) return b+c;
	if ((t/=d/2) < 1) return c/2 * Math.pow(2, 10 * (t - 1)) + b;
	return c/2 * (-Math.pow(2, -10 * --t) + 2) + b;
};

jQuery.easing['easeInOutCubic'] = function (x, t, b, c, d) { 
	if ((t/=d/2) < 1) return c/2*t*t*t + b; return c/2*((t-=2)*t*t + 2) + b; 
};
