/*
* Called when DOM is ready.
*
*/
$(function() {
	//set click event.
	$("#expandBoatDivesLink").click(function(evt) {
		evt.preventDefault();
		
		expandSection("boatDivesLongVersionContainer", "boatDivesShortVersionContainer")
	});
	
	//set click event.
	$("#expandShoreDivesLink").click(function(evt) {
		evt.preventDefault();
		
		expandSection("shoreDivesLongVersionContainer", "shoreDivesShortVersionContainer")
	});
	
	//set click event.
	$("#expandFirstTimeDivesLink").click(function(evt) {
		evt.preventDefault();
		
		expandSection("firstTimeDivesLongVersionContainer", "firstTimeDivesShortVersionContainer")
	});
	
	//set click event.
	$("#expandDiveBoatsLink").click(function(evt) {
		evt.preventDefault();
		
		expandSection("diveBoatsLongVersionContainer", "diveBoatsShortVersionContainer")
	});
	
	//set click event.
	$("#expandDiveSitesLink").click(function(evt) {
		evt.preventDefault();
		
		expandSection("diveSitesLongVersionContainer", "diveSitesShortVersionContainer")
	});
	
	//set click event.
	$("#expandRentalGearLink").click(function(evt) {
		evt.preventDefault();
		
		expandSection("rentalGearLongVersionContainer", "rentalGearShortVersionContainer")
	});	
	
	//set click event.
	$("#expandNitroxLink").click(function(evt) {
		evt.preventDefault();
		
		expandSection("nitroxLongVersionContainer", "nitroxShortVersionContainer")
	});
	
	//set click event.
	$("#expandDiveMapLink").click(function(evt) {
		evt.preventDefault();
		
		expandSection("diveMapLongVersionContainer", "diveMapShortVersionContainer")
	});	
});


/*
* Expand one section and hide another section.
*
* @param {Object} sectionToExpand
* @param {Object} sectionToHide
*/
function expandSection(sectionToExpand, sectionToHide) {
	//hide section.
	$("#" + sectionToHide).hide("slow");
	
	//display section.
	$("#" + sectionToExpand).show("slow");
}