$(document).keydown(function(e) {
  if (e.which == 27) {
    hideModal();

    return false;
  }
});

function minimize(id) {
  var $div = $('#' + id);
  var $content = $('#' + id + ' .minimizable');;

  if ($div.hasClass('closed')) {
    $div.removeClass('closed');

    $content.slideDown('normal', function() {
      $content.find('a.green_arrow, .bottom, .report').show();
    });
  } else {
    $content.find('a.green_arrow, .bottom, .report').hide();

    $div.addClass('closed');
    $content.slideUp();
  }

  return false;
}

$(document).ready(function() {
  $('.flash a.close').click(function() {
    $('.flash').fadeOut();
  });
});