/**
*  carousel
**/

var carouselDelay = 7000;
var turnSpeed = 900;
var carIndex = 1;
var itemCount;
var qwe;



function carouselTurn(ind){

	carIndex+=ind;
	
	$('.top-article-item').each(function(cs){
		itemCount=cs+1;
	});
	
	
	if (carIndex<1)carIndex=itemCount;
	if (carIndex>itemCount)carIndex= 1;
		
	$('.top-article-item').each(function(){
		$(this).fadeOut(turnSpeed);		
	});
	$('.top-article-item').each(function(k){
		if( (k+1)==carIndex ) $(this).fadeOut(turnSpeed).fadeIn(turnSpeed);		
	});
	
	clearTimeout(qwe);
	qwe=setTimeout( 'carouselTurn(1)', carouselDelay);
}

