$(document).ready(function(){  

$("#programs").hover( 
  function () {
			$("#programs > ul").fadeIn("fast");  
			},
  function () {
			$("#programs > ul").fadeOut("fast");  
		}
);  

$("#about").hover( 
  function () {
			$("#about > ul").fadeIn("fast");  
			},
  function () {
			$("#about > ul").fadeOut("fast");  
		}
); 

$("#events").hover( 
  function () {
			$("#events > ul").fadeIn("fast");  
			},
  function () {
			$("#events > ul").fadeOut("fast");  
		}
); 

  // Go through each item in the main blog page and shorten if bigger than 1500px
  $('.faculty_info').each(function (i) {
    var div_height = $(this).height();
    if (div_height > 300) {
      $(this).height(300);
      $(this).append('<input type="hidden" class="item-height" value="' + div_height + '" />');
      var id = 'expando-num-' + i;
      $(this).attr('id', id);
      $(this).after('<a href="' + id + '" class="expando-div">read the rest of their bio</a>');
    }
  });
  
  // Add the 'click to expand' behavior to the links
  $('.expando-div').click(function () {
    $(this).remove();
    var $div = $('#' + $(this).attr('href'));
    var div_height = $div.find('.item-height').val();
    $div.animate({height:div_height}, 1000);
    return false;
  });

});
