﻿$(document).ready(function() {
	// hide all the toggle containers
	$(".toggle_container").hide();

	// attach event to the H2 so the next 
	// toggle_container is shown
	$("h2.trigger").click(function() {
		$(".toggle_container").hide(); 
		$(this).next(".toggle_container").toggle();            
	});
});

// packaged hide/show functions
function showEl(elToShow) { $("#" + elToShow).show(); }

function hideEl(elToHide) { $("#" + elToHide).hide(); }

function toggleEl(elToToggle) { $("#" + elToToggle).toggle(); }

function hideElPlayOptions(elToShow) {
	$('#divPlayOverview').hide();
	$('#divPlaySpecialEvents').hide();
	$('#divPhotosVideos').hide();
	$('#divInterviews').hide();
	$('#divBuyTickets').hide();
	$('#divMediaReleases').hide();
	$('#divPlayCurriculumConnections').hide();
	$('#divTeachersNotes').hide();
	$('#divMediaReleases').hide();
	
	showEl(elToShow);
}

jQuery.preloadImages = function() {
	for (var i = 0; i < arguments.length; i++) {
		jQuery("<img>").attr("src", arguments[i]);
	}
}

function rollOver(elToSwitch) {
	$(elToSwitch).attr("src", $(elToSwitch).attr("src").split(".").join("_over."));
}

function rollOut(elToSwitch) {
	$(elToSwitch).attr("src", $(elToSwitch).attr("src").split("_over.").join("."));
}

