var $j = jQuery.noConflict();

$j.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;
	}
};


$j(document).ready(function() {	
	var a = $j("li.recipeSelected").attr("actualitem");	
	var count = $j("#recieptlistmenu").children().length;
	var isclicked = $j("#recieptlistmenu").attr("iscklicked");	
	var effect = 'linear';
	var animation = 'slow';
	
	if(a < 4) {a = 1;}
	if(isclicked != '1') {a = count; animation = 1000;}

    $j('#recieptlistmenu').jcarousel({
        start: a,
    	scroll: 4,
    	visible: 4,
    	easing:  effect,
    	animation: animation,
        initCallback: function(carousel) {        		
				if (isclicked != '1') {    
					setTimeout(function() {
							carousel.scroll(parseInt(1, 0));
							carousel.startAuto();
							
					}, 500);
					 carousel.next();
				}
		}
    });
    
});





