var hash = location.hash;

$(function () {
	if ($(".question + .answer").length)
	{
		collapseAnswers();
	}
});

function collapseAnswers ()
{
	$(".question + .answer").slideUp(1);
	$(".question").css ("cursor", "pointer").click (function () {
		var $answer = $(this).next();
		if ($answer.is(":visible"))
		{
			$answer.stop().slideUp();
		}
		else
		{
			$(".answer").stop().slideUp();
			$answer.stop().slideDown();
		}
	}).hover(function () {
		$(this).css("color", "#85b700");
	}, function () {
		$(this).css("color", "#3f3f3f");
	});
	if (hash && $(".question" + hash).length)
	{
		$(hash).next().slideDown(1);
//		$.scrollTo(hash, 1000);
		$(hash).next().andSelf().effect("highlight", {}, 3000);
	}
}

// stop the nasty question/answer 'jumping' bug
$("head").append('<style type="text/css">.answer{display: none;}</style>');


