        Cufon.replace('.seg_n', { fontFamily: 'Segoe Print', hover: true });
        Cufon.replace('.zar_box > div:first-child, .second', { fontFamily: 'Segoe Print', fontWeight: 'bold', hover: true, textShadow: '#393939 -1px -1px' }); 
        Cufon.replace('.zakladka .tytul', { fontFamily: 'Segoe Print', fontWeight: 'bold', hover: true, textShadow: '#000 -2px 0px' }); 
        Cufon.replace('.zakladka .opis', { fontFamily: 'Segoe Print', fontWeight: 'bold', hover: true, textShadow: '#000 -1px 0px' }); 
        Cufon.replace('.seg_b', { fontFamily: 'Segoe Print', fontWeight: 'bold', hover: true }); 
        Cufon.replace('.zapisy', { fontFamily: 'Segoe Print', hover: true, textShadow: '#656565 -1px -1px' });
        var i = 0;
        var zakladka_count;
        var timer;
        var zmien_zakladke = function()
        {
            $('.z'+i).animate({'top' :  300}, 1000, function()
            {
                $('.zs'+i).attr('src', './img/opencircle.png');
                    i++;
                    if(i>=zakladka_count) i = 0;
                    $('.zs'+i).attr('src', './img/closedcircle.png');
                    $('.z'+i).animate({'top' :  10}, 700, function()
                    {
                        $(this).animate({top:"-=10px"},100).animate({top:"+=10px"},200).animate({top:"-=10px"},250).animate({top:"+=5px"},300);
                    });
            });
        }
        function valid()
        {
           var blad = '';
           var reg = /^([A-Za-z0-9_\-\.])+\@([A-Za-z0-9_\-\.])+\.([A-Za-z]{2,4})$/;
           var email = document.getElementById('r_email').value;
           if(reg.test(email) == false) { blad += "Proszę podać poprawny adres e-mail\n"; }
           if(document.getElementById('telefon').value == 'telefon') { blad += "Proszę podać numer telefonu\n"; }
           if(document.getElementById('imie').value == 'imie') { blad += "Proszę podać imię\n"; }
           if(document.getElementById('nazwisko').value == 'nazwisko') { blad += "Proszę podać nazwisko\n"; }
           if(blad != '')
           {
        		alert(blad);
        		return false;
           }
        }
        function slider_zmien(j)
        {
            clearInterval(timer);
            $('.z'+i).animate({'top' :  300}, 1000, function()
            {
                $('.zs'+i).attr('src', './img/opencircle.png');
                    i = j;
                    $('.zs'+i).attr('src', './img/closedcircle.png');
                    $('.z'+j).animate({'top' :  10}, 700, function()
                    {
                        $(this).animate({top:"-=10px"},100).animate({top:"+=10px"},200).animate({top:"-=10px"},250).animate({top:"+=5px"},300);
                    });
            });
        }   
        function v_ns()
        {
           var blad = '';
           var reg = /^([A-Za-z0-9_\-\.])+\@([A-Za-z0-9_\-\.])+\.([A-Za-z]{2,4})$/;
           var address = document.getElementById('newsletter').value;
           if(reg.test(address) == false) {
        		blad += "Proszę podać poprawny adres e-mail\n";
           }
           if(blad != '')
           {
        		alert(blad);
        		return false;
           }
        }    
	   $(document).ready(function()
       {
            $("#rejestracja").find("input, textarea").each(
            function()
            { 
                this.defaultValue = this.value;
                $(this).click(
                function()
                {
                    if(this.value == this.defaultValue)
                    {
                        $(this).val("");
                        $(this).css("color", "#000");
                    }
                    return false;
                });
                $(this).blur(function()
                {
                    if(this.value == "")
                    {
                        $(this).val(this.defaultValue);
                        $(this).css("color", "#999");
                    }
                });
            });
            $(".zar_box").hover(function()
            {
                $(this).animate({'top' :  "-="+($(this).height()-28)}, 300); 
            },
            function(){
                $(this).animate({'top' :  "+="+($(this).height()-28)},300);    
            });
            timer = setInterval(zmien_zakladke, 10000);
            $(".tip_down").tooltip(
            {
                offset: [120, 50],
                effect: 'slide',
                tipClass: 'tooltip_bot'
            });
            $(".tip_up").tooltip(
            {
                offset: [10, 20],
                effect: 'slide'
            });
            zakladka_count = $(".zakladka").length;
            $(".fancybox").fancybox();
/*=======================================================================================*/
/*=======================================================================================*/ 
            var ile= 5;
            roller_count = $("#roller_1 div a").length;
            if(roller_count <= ile) 
            {
                $("#slider_gallery #down").hide();
            }
            var roller_current = 0;
            var click_down = function()
            {
                var btn_down = $(this); 
                btn_down.unbind();
                if((roller_count - roller_current) > ile)
                {
                    var current = parseInt($("#roller_1 div").css('top'));
                    var height = parseInt($("#roller_1 div a").css('height'));
                    $(".r"+(roller_current+ile)).css('opacity', 0);
                    $(".r"+(roller_current+ile)).animate({'opacity' :  1}, 1000);
                    $(".r"+roller_current).animate({'opacity' :  0}, 200);
                    $("#roller_1 div").animate({'top' :  current - height - 7 + "px"}, 500);
                    roller_current++;
                    $("#slider_gallery #up").show();
                    $("#slider_gallery #up").animate({'opacity' :  1}, 1000, function(){btn_down.bind('click', click_down);});
                }
                if(roller_current >= (roller_count-ile))
                {
                    $("#slider_gallery #down").animate({'opacity' :  0}, 1000, function(){$("#slider_gallery #down").hide();});    
                }                  
            }
            var click_up = function()
            {
                var btn_up = $(this); 
                btn_up.unbind();
                if(roller_current > 0)
                {
                    var current = parseInt($("#roller_1 div").css('top'));
                    var height = parseInt($("#roller_1 div a").css('height'));
                    roller_current--;
                    $(".r"+(roller_current+ile)).animate({'opacity' :  0}, 200);
                    $(".r"+roller_current).animate({'opacity' :  1}, 1000);
                    $("#roller_1 div").animate({'top' :  current + height + 7 +"px"}, 500, function(){btn_up.bind('click', click_up);});
                }
                if(roller_current == 0)
                {
                    $("#slider_gallery #up").animate({'opacity' :  0}, 1000, function(){$("#slider_gallery #up").hide();});  
                    $("#slider_gallery #down").show();
                    $("#slider_gallery #down").animate({'opacity' :  1}, 1000); 
                }
                else
                {
                    $("#slider_gallery #down").show();
                    $("#slider_gallery #down").animate({'opacity' :  1}, 1000);    
                }                
            }
            $("#slider_gallery #up").bind('click', click_up);
            $("#slider_gallery #down").bind('click', click_down);
/*=======================================================================================*/
/*=======================================================================================*/
            $("#partnerzy").hover(
            function()
            {
	           $("#partnerzy").stop(true,false).animate({marginLeft: 0}, 500);
            },
            function()
            {
                $("#partnerzy").stop(true,false).animate({marginLeft: -171}, 500);
            });
            $("#facebook").hover(
            function()
            {
	           $("#facebook").stop(true,false).animate({marginRight: 211}, 500);
            },
            function()
            {
                $("#facebook").stop(true,false).animate({marginRight: 0}, 500);
            });
            if(!$.cookie('projekty_show'))
            {
                $.cookie('projekty_show', 'yes', { expires: 7 }); 
                $("#footer").css('margin-bottom', '0px');    
            }
            else
            {
                if($.cookie('projekty_show') == 'yes')
                {
                    $("#footer").css('margin-bottom', '0px'); 
                        
                }
                else
                {
                    $("#footer").css('margin-bottom', '-148px');       
                }
            }
            $("#footer_show").click(
            function()
            {
                if($("#footer").css('margin-bottom') == '0px')
                {
                    $.cookie('projekty_show', 'no', { expires: 7 }); 
                    $("#footer").stop(true,false).animate({marginBottom: -148}, 500); 	                                   
                }
                else
                {
                    $.cookie('projekty_show', 'yes', { expires: 7 });
                    $("#footer").stop(true,false).animate({marginBottom: 0}, 500);     
                }
            });
	});    

