$(document).ready(function() {
  $("#flash_notice, #flash_error").slideDown(function() {
    timeout = setTimeout(function() {
      $("#flash_notice, #flash_error").slideUp();
    }, 10000);
  });
	
  $("#login, #password, #q").focus(function() {
    if(/Email|Password|Search/.test($(this).val())) {
      $(this).val("");
    }
	});

  $('.home .main').append('<div class="shadow"></div>');

  $('.review_section_link').click(function(event) {
    event.preventDefault();
    $('.review_content > *').hide();
    $($(this).attr('href')).show();
    $('.review_section_link').removeClass('selected');
    $(this).addClass('selected');
    $('.equal-height').css({'height': 'auto'});
    equalizeHeights();
  })
  
  equalizeHeights();
});

function equalizeHeights() {
  var max = 0;
  var height = 0;
  var query = $('.equal-height');
  query.each(function() {
    height = $(this).height();
    if (height > max) max = height;
  });
  query.height(max);
}