/*
 * Application behaviours
 * Fueled by jQuery
 */

/*
 * DOM Ready
 */
$(function(){
  
  // Initial shizzle
  $('body').addClass('js');
  $('.box .meta').css({ 'opacity': 0 });
  
  
  // Masonry
  $('#primary').masonry({
    columnWidth: 190, 
    itemSelector: '.box'
  });
  
  
  //$("#dropmenu ul").css({display: "none"}); // Opera Fix
  $("#dropmenu li").hover(
    function(){ 
      $(this).find('ul:first').css({visibility: "visible",display: "none"}).show(268); 
    },function(){ 
      $(this).find('ul:first').css({visibility: "hidden"}); 
  }); 

  // Show meta info on rollover
  $(".box li").hover(
    function(){
      $(".meta", $(this)).stop();
      $(this).find(".meta").animate({ 'opacity': 1 });
    }, function(){
      $(".meta", $(this)).stop();
      $(this).find(".meta").animate({ 'opacity': 0 });
  });
  
  // Make the whole box clickable
  $(".box li").click(function(){
    window.location = $('a', $(this)).first().attr('href');
  });
  
});
