$(document).ready(function() {
        $("div.stronicowanieEasy ul li").live ("click",function() {
                if ($(this).hasClass("doGory"))
                    return true;
                //zmien strony:
                number = parseInt($(this).parent().attr("class").replace("number", ""));
                //po prostu zapewniamy ze widoczna jest pierwsz i ostatnia + sasiednie 4
                link = $("<a></a>").attr("href", "#").text("...");
                trzykropek = $("<li></li>").addClass("empty").append(link);
                //zmiana zaznaczenia:
                $(this).siblings("li.empty").remove();
                $(this).siblings(":not(.doGory)").hide().children("a").removeClass("zaznaczona");
                $(this).children("a").addClass("zaznaczona");
                //pokazywanie pierwszej i ostatniej:
                //$(this).parent("ul").fadeOut("slow").children("li:not(.doGory)").hide();
                $(this).parent("ul").children("li:not(.doGory)").filter(":first").show();
                $(this).parent("ul").children("li:not(.doGory)").filter(":last").show();
                //pokazywanie sasiednich
                $(this).nextAll(":not(.doGory)").filter(":lt("+number+")").show();
                ostatni = $(this).nextAll(":not(.doGory)").eq(number+1);
                if (ostatni.length) {
                    ostatni.before(trzykropek.clone());
                }
                $(this).prevAll(":not(.doGory)").filter(":lt("+number+")").show();
                pierwszy = $(this).prevAll(":not(.doGory)").eq(number+1);
                if (pierwszy.length) {
                    pierwszy.after(trzykropek);
                }
                $(this).show();
                //$(this).parent("ul").fadeIn("slow");
                return false;
            });
    });
