function items(sekce, start) {
	var load_data = {'from': start, 'sekce': sekce};
	var lightBox_settings = {
		overlayOpacity: 0.9,
		imageBtnClose: "images/nic.gif" };
	
	// animace dodělat !!!!!!
	
	$("#" + sekce).load("tisk/index.php", load_data, function(){
		// vsechny obrazky do lightboxu
		$("a[href*=.jpg],a[href*=.gif],a[href*=.png]", $("#" + sekce))
			.each(function() {
				$(this)
					.click(function(event) {
						event.preventDefault();
					})
					.lightBox(lightBox_settings);
			});
	});
}

/*
 * Onload
 */
var ServerScript = 'tisk/ajax.php';
function getList(sekce) {
    
    $('#' + sekce + '_navigator').loadingSmall('images/loadingSmall.gif');
    
    $.post(ServerScript, {type: 'enter', sekce: sekce}, function(html) {
        var years = new Array();
        $('li', html).each(function(i) { 
            years.push(Number($(this).text()));
        });
        
        // items
        $('#' + sekce + '_output').loadingContent('images/loadingContent.gif');
        
        $.post(ServerScript, {type: 'walk', year: years[0], sekce: sekce}, function(html) {
            
            jsNavigator.create({
                box: {
                    html: {
                        selected: 0,
                        list: years
                    }
                }, 
                target: sekce,
                callback: getDataByYear
            });
            
            $('#' + sekce + '_output').css('display', 'none').html(html).slideDown(400);
            
        }, 'html');
    }, 'html');
}

/*
 * Onlick
 */
function getDataByYear(p) {
    $('#' + p.sekce + '_output').loadingContent('images/loadingContent.gif');
    
    $.post(ServerScript, {type: 'walk', year: p.list[p.selected], sekce: p.sekce}, function(html) {
        $('#' + p.sekce + '_output').css('display', 'none').html(html).slideDown(400);
    }, 'html');
}
///////////////////////////////////////////////////////////////////
$(function() {
    getList('tiskovezpravy');
    getList('napsalionas');
    getList('stanoviskackp'); 
});

