
$(document).ready(function(){
	$('#animation img').addClass('closed');
	startAnimation()
	$('#animation').animate({dummy: 1,}, 2000,function(e) {
		startAnimation()
	});
	$('#logo').animate({dummy2: 1,}, 4000 ,function(e) {
		startAnimation()
	});
});

var t = 3;
//var t1 = 3;
startAnimation = function () {
	
	var s = Math.floor(Math.random()*18)
	var st = 2200+Math.floor(Math.random()*t*1000);
	//$('#logo').html(st+' '+$('#animation img.closed:eq('+s+')').attr('src'))
	$('#animation img.closed:eq('+s+')').animate({
					opacity: 1.0,
	}, st ,function(e) {
			stopAnimation(this)
				//	startAnimation () 
	});
	$('#animation img.closed:eq('+s+')').attr('class','running');
			
	
}
stopAnimation = function (th) {
	
	var s = Math.floor(Math.random()*18)
	var st = 2200+Math.floor(Math.random()*t*1000);
//	$('#logo').html(st+' '+$('#animation img.closed:eq('+s+')').attr('src'))
	$(th).animate({
					opacity: 0.1,
	}, st ,function(e) {
			$(th).attr('class','closed');
			startAnimation()
	});
}



