$j(function(){

	/*Myspace Carousel*/
	$j("#actu span.next").click(function(){
		
		thisLeft = $j("#actu ul").css("left");
		thisLeftPx = thisLeft.lastIndexOf("px");
		thisLeft = thisLeft.substring(thisLeftPx,0);
		newLeft = thisLeft - 366;
		
		maxLeftLength = $j("#actu li").length;
		maxLeft = maxLeftLength * 366;
		
		if(newLeft == -maxLeft){
			$j("#actu ul").animate({left: 0});
		} else {
			$j("#actu ul").animate({left: newLeft});
		}
		
	});
	
	$j("#actu span.prev").click(function(){
	
		thisLeft = $j("#actu ul").css("left");
		thisLeftPx = thisLeft.lastIndexOf("px");
		thisLeft = thisLeft.substring(thisLeftPx,0);
		thisLeft = parseInt(thisLeft);
		newLeft = thisLeft + 366;
				
		if(newLeft == 366){
			$j("#actu ul").css("left",0);
		} else {
			$j("#actu ul").animate({left: newLeft});
		}
		
	});

});