// Place your application-specific JavaScript functions and classes here
// This file is automatically included by javascript_include_tag :defaults

function toggle_items(items_to_toggle) {
  items_to_toggle.each(Element.toggle);
}

function set_content_wrapper_height() {
  $('#content_wrapper').css('min-height', $(window).height() + 'px')
}

$(function() {
  if (location.pathname == '/') {
    var player = $f("player", "/flash/flowplayer-3.2.1.swf");
  }
  
  $("a[rel]").overlay({
    mask: {color: '#000'},
    speed: 'slow',
    onLoad: function() {
      player.load();
    },
    onClose: function() {
      player.unload();
    }
  });

  set_content_wrapper_height();

  $(window).resize(function() {
    set_content_wrapper_height();
  });
});