// Incense and peppermint

$(document).ready(function() {
	// Hide the pBody menu divs initially
	$("#p-navigation,#p-search,#p-statistics,#p-tb,#p-personal").children(".pBody").hide();
	
	// Adds the left and right graphics to the page if they aren't in the html source
	if ($("#column-left,#column-right").length == 0) {
		$('#globalWrapper').prepend('<div id="column-left"></div><div id="column-right"></div>');
	}
	
	// Hovering over menu items should show the correct pBody menu div if it isn't empty
	$(".portlet h5").hover(
		function() {
			pBody = $(this).parent().children(".pBody:parent");
			if (pBody.length >= 1) {
				pBody.stop(true, false).fadeTo(200, 1);
				$("#contentTitle").stop(true, false).fadeTo(200, 0).hide(0);
			}
		},
		function() {
			pBody = $(this).parent().children(".pBody:parent");
			if (pBody.length >= 1) {
				pBody.stop(true, false).fadeTo(200, 0).hide(0);
				$("#contentTitle").stop(true, false).fadeTo(200, 1);
			}
		}
	);
	
	// Hide the pBody menu divs, unhide when hovered over
	$("#p-navigation,#p-search,#p-statistics,#p-tb,#p-personal").children(".pBody").hide().hover(
		function() {
			// Fade in the pBody menu div
			$(this).stop(true, false).fadeTo(200, 1);
			// Fade out the contentTitle page title div
			$("#contentTitle").stop(true, false).fadeTo(200, 0).hide(0);
		},
		function() {
			// Fade out the pBody menu div
			$(this).stop(true, false).fadeTo(200, 0).hide(0);
			// Fade out the contentTitle page title div
			$("#contentTitle").stop(true, false).fadeTo(200, 1);
		}
	);
	
	
	$(document).ready(function() {
		$("#firstHeading").FontEffect({//,#p-search>.pBody
			outline: true,
			shadow: true,
			shadowColor: "#000",
			shadowOffsetTop :3,
			shadowOffsetLeft: 3
		});
	});
});
