$(function () {
	
	// The code in this section will run when the document is ready (page load).

	// Remove default margins, borders, and padding from last element
	$(".caption p:last").addClass("last");
	$(".section p:last").addClass("last");
	$(".section:last").addClass("last");
	$(".double-callout .top p:last").addClass("last");
	
	
	// Use the class "external" to open links in a new window
	$(".external").click(function () {
		window.open(this.href);
		return false;
	});
	
	// Add a class for IE buttons
	$(".button").hover(
		function () {
			$(this).addClass("over");
		},
		
		function () {
			$(this).removeClass("over");
		}
	);
	
	// Show and hide the photo gallery on the events page
	$(".photo-gallery").hide();
	$(".show").show();
	$(".show").toggle(
		function () {
			var gallery = $(this).attr("href");
			$(this).html("Hide Photos");
			$(gallery).slideDown("slow");
			return false;
		},
		
		function () {
			var gallery = $(this).attr("href");
			$(this).html("Show Photos");
			$(gallery).slideUp("slow");
			return false;
		}
	);
});
