var 
    speed       = 500, 
    halfSpeed   = speed/2,
    defaultEasing = 'easeInQuart';

$(document).ready(blogMica_init);







function blogMica_init(){
    
    
    /* isotope */
    $('#main').isotope({
      // options
      itemSelector : '.post',
      layoutMode : 'masonry',
      masonry: {
         gutterWidth: 10  
      },
      animationEngine: 'css',
      animationOptions: {
        duration: 750,
        easing: 'linear',
        queue: false
   }
    });
    
    
    /* header */
    $('header h1').mouseover(dropDownOpen);
    $('header').mouseout(dropDownClose);

    $('.post img').each(function(){
        var ratio = $(this).width()/$(this).height();
        $(this).width(400);
        $(this).height(400/ratio);
    })
}


function dropDownOpen(){
    $('header').stop().animate({marginTop:0}, speed, defaultEasing);
}
function dropDownClose(){
    $('header').stop().animate({marginTop:-155}, halfSpeed, 'easeOutQuart');
}
