$(document).ready(function() {

    // Szukajka
    if ($("#search").length > 0)
    {
        var queryInput = 'Wpisz szukaną frazę';

        if ($("#query").val() == '')
        {
            $("#query").val(queryInput);
        }

        $("#query").focus(function() {
            if ($(this).val() == queryInput)
            {
                $(this).val('');
            }
        });

        $("#query").blur(function() {
            if ($(this).val() == '')
            {
                $(this).val(queryInput);
            }
        });
    }

    // Lightbox
    $("a[href$=.jpg], a[href$=.png], #blips a:has(img)").lightBox();
    $(".entry-content a[href$=.jpg], .entry-content a[href$=.png]")
        .css('position', 'relative')
        .append('<span class="zoom"></span>');

    // "Czytaj dalej"
    $(".entry-content:has(a.more-link)").each(function() {
        var more_link = $(this).find('a.more-link').attr('href');
        $(this).find('a.more-link').remove();
        $(this).next().append('<li><a href="' + more_link + '">Czytaj dalej &raquo;</a></li>');
    });

});
