$(document).ready(function(){	
	var $box = $("#akce-slideshow");
    $('div:gt(0)',$box).hide();
    $($box).children("div:last").addClass('last');
    var cur = $('div:first',$box);   
	var akce_length = $($box).children("div").length;
	
    function animate(){
        cur.hide();
        if (cur.attr('class') == 'last') {
			cur = $('div:first', $box);
		}
		else {
			cur = cur.next();
		}
        cur.fadeIn(2000);   
    }
	
	if (akce_length > 1) {
		window.setInterval(function(){
			animate();
		}, 7000);
	}
});
