// Rysownik.com JS by titos2k

function centrujMiniatury(){
      $('.miniatury').animate({
        /* przesuń miniatury 18-scroll 132-miniatura 10-margines */
        'marginLeft':(((($(window).width() - 18) % (132 + 1)) / 2))
      }, 50);
};
    
Cufon.replace('#greetings h1, #greetings p, #o-mnie,.section h1.title');
Cufon.replace('#greetings a' , {
    hover: true
});
          
jQuery(document).ready(function($){
    $('.lightbox').lightbox();
     centrujMiniatury();
        var windowc = $(window).width();

        $(".thumb2").each(function(){            
            var mini = 150;
            var modulo =  windowc % mini;
            var divided = Math.floor(windowc / mini);
              
           $(this).css('width', mini + Math.floor(modulo / divided));
           $(this).find("a").css('width', mini + Math.floor(modulo / divided));      
        });        
     
});

$(function(){
    $('a[href*=#]').click(function() {
    
    if (location.pathname.replace(/^\//,'') == this.pathname.replace(/^\//,'') 
        && location.hostname == this.hostname) {
        
            var $target = $(this.hash);
            
            $target = $target.length && $target || $('[name=' + this.hash.slice(1) +']');
            
            if ($target.length) {
            
                var targetOffset = $target.offset().top;
                
                $('html,body').animate({scrollTop: targetOffset}, 1000);
                    
                return false;                
            }            
        }      
    });    

    $(".thumb a").hover(function(){
        var klasa = "info";
        var where = $(window).width() - $(this).offset().left;
        if (where < 500){
          klasa = "info2";
        };
        var str = $(this).find("img").attr("alt").split(/-/g);
        $(this).parent().append("<div class=\""+klasa+"\"><div class=\"info-content\"><span class=\"info-pick\"></span><h1>"+str[0]+"</h1><span>"+str[1]+"</span></div></div>");
        $(this).parent().find("."+klasa+"").fadeIn("fast");       
    },function(){
        var klasa = "info";
        var where = $(window).width() - $(this).offset().left;
        if (where < 500){
          klasa = "info2";
        };        
        $(this).parent().find("."+klasa+"").hide();
    }); 

    $(window).resize(function(){ 
        centrujMiniatury();
    });

});




