$(function(){
    $('#newsletter_tresc form').submit(function(){
        $.getJSON(window.location + '?'+ $(this).serialize(), function(data){
            alert(data);
        });
        return false;
    });

    var newsletter = 'wpisz e-mail';
    $('#newsletter_tresc input')
    .val(newsletter).css('color', '#0f0f0f')
    .focus(function(e){
        if ($(this).val() == newsletter){
            $(this).val('');
        }
    }).blur(function(e){
        if ($(this).val() == ''){
            $(this).val(newsletter);
        }
    });

    $('.comment_to_news').hide();
    $('.caly_tekst').hide();
    $('.roll').toggle(
        function(){
            $('#comments_to_news'+$(this).attr('jq')).show();
            $('#dymek'+$(this).attr('jq')).css('background','url(img/comments_hide.png)');
        },
        function(){
            $('#comments_to_news'+$(this).attr('jq')).hide();
            $('#dymek'+$(this).attr('jq')).css('background','url(img/comments_show.png)');
        });

    $('.wiecej').toggle(
        function(){
            var t = $(this).attr('jq');
            $('#wiecej'+ t).slideDown('fast');
            $('#wiecej_change'+ t ).empty().text('ukryj ^');
        },
        function(){
            var t = $(this).attr('jq');
            $('#wiecej'+ t).slideUp('fast');
            $('#wiecej_change'+ t ).empty().html('więcej &raquo;');
        });
});
