$(document).ready(function(){
	
	if ($(".questionList").length > 0) {
		hideAllTypes();
		$("#content").css("display", "block");
		$("#content").addClass("weirdCSSHackForShowingTheQList");
		$(".questionList").css("display", "block");
		$("#backButton").css("display", "block");
		
		setCategoryTitlebar();
	}
	
	if ($(".answer").length > 0) {
		hideAllTypes();
		$("#content").css("display", "block");
		$("#backButton").css("display", "block");
		
		setCategoryTitlebar();
	}
	
});

function hideAllTypes() {
	$("#home").css("display", "none");
	$("#content").css("display", "none");
	$(".questionList").css("display", "none");
}

function setCategoryTitlebar() {
	var catName = $(".current").text();
	$("#pageTitle").text(catName);
}