
jQuery(document).ready(function() {
    // vytvoreni zalozek
    tabControll = '';
    jQuery('#screen .block').each(function() {
        tabControll += '<li><a href="#' + jQuery(this).attr('id') + '">' + jQuery('h1', this).text() + '</a>';
        jQuery('h1', this).remove();
    });
    jQuery('#screen').prepend('<ul class="tab-controll">' + tabControll + '</ul>');

    // vytvoreni tabu a volba nahodneho
    blocksCount = jQuery('#screen .block').size();
    random = Math.round(Math.random()*(blocksCount));
    jQuery('#screen').tabs().tabs( 'select', random);
    //console.log(random);

    jQuery('#screen').show();
});