//these variables denote what content to show and what content to reveal when clicked
var containers; //list of all itemContainers
var lastClicked = null; //the location of the last item clicked

var itemContainer = ".caption"; //the class of the container of each item
var visibleContent = "div"; //the class of the container of the visible content within the item
var hiddenContent = "blockquote"; //the class of the container of the hidden content within the item

$(document).ready(captionSetup);

function captionSetup() {

	containers = $(itemContainer);
	
	$(hiddenContent, containers).fadeTo(1, .9);
	
	for (var i = 0; i < containers.length; i++) {
		var menuItem = new MenuItem(containers[i]);
		menuItem.whenHovered();
	}
		
}

function MenuItem(location) {
	this.location = location;
}

MenuItem.prototype.whenHovered = function() {
	var location = this.location;
	
		$(location).hover(
			function() {					   
				$(hiddenContent, location).slideUp("fast");	
			},
			function() {
				$(hiddenContent, location).slideDown("fast");
			}
		);
		
}