$(function() {
        $.nyroModalSettings({
            processHandler: function(settings) {
                var url = settings.url;
                if (url && url.indexOf('http://www.youtube.com/watch?v=') == 0) {
                    $.nyroModalSettings({
                        type: 'swf',
                        height: 355,
                        width: 425,
                        url: url.replace(new RegExp("watch\\?v=", "i"), 'v/')
                    });
                }
            }
        });
//            openSelector: '.lightbox'

    $('[rel="lightbox"]').addClass('nyroModal');
    $('[rel="lightbox"]').nyroModal();
    $('[rel="lightbox[a]"]').addClass('nyroModal');
    $('[rel="lightbox[a]"]').nyroModal();
    $('[rel="lightbox[b]"]').addClass('nyroModal');
    $('[rel="lightbox[b]"]').nyroModal();
    $('[rel="lightbox[c]"]').addClass('nyroModal');
    $('[rel="lightbox[c]"]').nyroModal();
    
    
    //Priprava na galerii Tomas
  $.getJSON("http://api.webeasy.cz/galerie/api/api.php?galerie=%2Fwww.skiareal-benecko.cz%2Ffoto1&format=json&jsoncallback=?",
        function(data){
          $.each(data.items, function(i,item){
                $("<img />").attr({
                    src: item.media.m,
                    title: item.title,
                    alt: item.title,
                    'class': 'stin_obrazku',
                    border: '0'})
                .appendTo("#galerie").wrap("<span style='width: 200px; float: left'></span>")
                .after(item.title).wrap("<a href='" + item.link + "' class='lightbox' rel='gal' target=\"_blank\"></a>");
            //$("<img/>").attr("src", item.media.m).appendTo("#galerie");
            //$("<br>").appendTo("#galerie");
            //if ( i == $("#pocet").val() ) return false;
            
          });
  });
  
    //Toto fungovalo s jslighboxem  
    /*
    $('#galerie3 a').lightBox();
    //vyhazuje chybu
    $("a[rel*='lightbox']").lightBox(); // Select all links that contains lightbox in the attribute rel
    $("a[rel*='gal']").lightBox(); // Select all links that contains lightbox in the attribute rel
    $('#gallery a').lightBox(); // Select all links in object with gallery ID
    */
    
    //Prvni ficura THSOFT JQuery
    /*
    var barva=["","#000000"];
    barva=$("table#pruhy").attr('rel').split(':');
    $('table#pruhy td:nth-col(even)').css("background",barva[1]);
    */
      
});