$=jQuery;

$(document).ready(function() {
						   
	//Hide all the answers to the questions
	$('.answer').hide();
	//Hide the link that is used when Javascript is disabled to "return to top"
	$('.return').hide();
	
	
	//Main Links
	//When called, this will close all the interior links - when clicking on another main link
	function closeAnswer() {
		$('.answer:visible').slideUp('fast');
	}
	
	
	$('.question').hover(function(){
		$(this).css("cursor","pointer");
	});
	
	
	//All the main links need to have the .question class so they can call this on click.
	$('.question').live("click", function(e) {
		//If it is hidden then call closeIt to make sure everything else gets closed, & then open it.
		if ($(this).next().is(":hidden")) {
			closeAnswer();
			$(this).next().slideDown('fast');
		}
		//If it isn't hidden, then closeIt and everything else.
		else {
			closeAnswer();
		}
	});
	
	//change the color on mouseover
	$('.question').mouseover(function() {
		$(this).css("color","#2CAAE2");									  
	}).mouseout(function() {
		$(this).css("color","#2E3086");
	});
	
	
});

