$("#client-container").ready(function(){ window.setInterval("doFading()",3200)})

function doFading() {
	var cl = $(".client");
	$.each(cl, function(i,item){ $(item).delay(400*i).shuffleClRow()})	
}

function randomFromTo(from, to){ return Math.floor(Math.random() * (to - from + 1) + from)}

$.fn.shuffleClRow = function() {
	var  n =randomFromTo(0,23);  
	var pos = "0% "+n*37+"px";
	var cur_pos = $(this).css("background-position");
	if(pos == cur_pos){ n = ( n+1 == 24 ? n-1 : n+1); var pos = "0% "+n*37+"px"}
	$(this).fadeOut("normal", function(){
		$(this).css("background-position", pos );
		$(this).fadeIn("normal");
	});
};
