$(document).ready(function(){
  $('.block a').each(function() {
    setupAssetBlockHover($(this));
  });

  $('.io_editable_content').bind('closeEditor', function(event){
    setupAssetBlockHover($('a', $(this)));
  });
});

// sets up the proper hovering behavior to the given anchor tag
// the anchor tag should have a json string on the rel attribute
function setupAssetBlockHover(ele)
{
  ele.hover(function() {
    data = $.parseJSON($(this).attr('rel'));
    $('#work_status h2').html(data.title);
    $('#work_status div.desc').html(data.description);
  }, function() {
    $('#work_status h2').html('');
    $('#work_status div.desc').html('');
  });
}

function setupVimeo()
{
$('.fancybox-vimeo').each(function() {

      $(this).fancybox({
          'padding'		: 0,
          'autoScale'		: false,
          'transitionIn'	: 'none',
          'transitionOut'	: 'none',
          'width'			: 800,
          'height'		    : 530,
          'href'			: $(this).attr('href'),
          'type'			: 'iframe'
      });
  });
}
