/*
faculty.js

This file handles the sliding interface of the faculty members' detailed information.
Author: Zachary Rattner
Version: 1.0

*/

$(document).ready(function() {
	// Scroll to anchor
	
						   
						   
	// Hide the details. Done in JS so non-JS browsers will not have content hidden.
	$('.tier_two').hide();
	//$('#staff').hide();
	$("#alternate_staff").hide();
	
	// Show the "More Information" divs and set its cursor to pointer
	$('.more_information').show();
	$('.more_information').css("cursor", "pointer");
	
	// This function is called whenever a "More Information" button is clicked
	$('.more_information').click(function() {
										  
		// Check whether the clicked div is faculty or staff, because the DOM layout is different between the two
		//if ($(this).attr('id') == "staff_toggle")
			// There is a decent amount of information underneath the staff slider, so take 2 seconds to slide
			//$("#staff").slideToggle(2000);
		//else
			// Assume the div is faculty if it is not staff, and slide the information
		$(this).parent().next().slideToggle("slow");
		
		// Toggle between open and closed disclosure triangle
		if ($(this).children().filter("img").attr("src") == "../images/closed.jpg")
			$(this).children().filter("img").attr("src","../images/open.jpg");
		else
			$(this).children().filter("img").attr("src","../images/closed.jpg");
	});

});