function init() {
	
	// Add click handlers to the plus/minus buttons in the sidebar
	$('a.plus').click(function() {
							   
		var thisBlock = $(this).parent().parent().attr("class"); // get the block to show/hide
		var thisImage = $(this).children("img").attr("id"); // get the image to swap out
		showHide(thisBlock,thisImage); // Run the showHide function
		
	});
	
}	




// Function to show/hide sidebar items
function showHide(theDiv,theImg) {
	
	theDiv = theDiv.replace("view-header ","");
	//alert('showing ' +theDiv);
	$("div."+theDiv).siblings('div.view-content').toggle();
	$("div."+theDiv).siblings('div.view-footer').toggle();
	
	var existingImage = $("img#"+theImg).attr("src");
	
	// are the last ten characters of existingImage "_minus.png" ?
	var currLengthComparisonEnd = existingImage.length;
	var currLengthComparisonStart = (currLengthComparisonEnd - 10);
	var existingEnding = existingImage.substring(currLengthComparisonStart,currLengthComparisonEnd);
	var newSource = ""; // make a var for the new source path to go into
	
	//alert(existingEnding);
	if(existingEnding == "_minus.png") {
		newSource = existingImage.replace("_minus","");
	} else {
		newSource = existingImage.replace(".png","_minus.png");
	}
	
	//alert(newSource);
	
	$("img#"+theImg).attr("src",newSource);
	
}




$(document).ready(function(){ // On DOM ready

	// Get the ball rolling
	init();
	
});



