function openSection(section) {
	$(section).next("ul").show();
	$(section).next("div").show();
	/* MASSIVE BLAST:
	// Show everything even remotely close to the clicked section
	
	$(section).parent("li").children("div").show();
	$(section).siblings().show();
	$(section).siblings().children().show();
	$(section).next().show();
	$(section).next().next().show();
	$(section).show();
	$(section).parent().show();
	$(section).children().show();
	
	*/
}

function closeSection(section) {
	$(section).next().hide();
}

function showWeeklyNuggets() {
	$("#weeklyNuggets").parent("div").show();
	$("#weeklyNuggets").show();
}

function showROB() {
	$("#readOurBook").parent("div").show();
	$("#readOurBook").show();
}

function showInterestingReads() {
	$(".now-reading").parent("div").show();
	$(".now-reading").show();
}

function showUpcomingEvents() {
	$("#upcomingEvents").parent("div").show();
	$("#upcomingEvents").show();
}

$(document).ready(function(){
						   
// Close all the sidebar elements
	$("#sidebar .widget > h2 + ul").hide();
	$("#sidebar .widget > h2 + div").hide();
	$("#sidebar2 .widget > h2 + ul").hide();
	$("#sidebar2 .widget > h2 + div").hide();
	$(".execphpwidget").show();
	
correctSidebars();
	
//	openSection("#weeklyNuggets");
//	openSection("#subscribe");

	$("#sidebar .widget > h2").click(function () {
		if ($(this).next().css("display") != 'none') { $(this).next().hide(); return false; }

		openSection($(this));
		openSection("#subscribe");

		$(".execphpwidget").show();
		$(".execphpwidget").parent().show();
	});
	
	$("#sidebar2 .widget > h2").click(function () {
		if ($(this).next().css("display") != 'none') { $(this).next().hide(); return false; }

		openSection($(this));

		$(".execphpwidget").show();
		$(".execphpwidget").parent().show();
	});
	
});