$(function() {
	
	// F.A.Q.
	$('#faq dt').live('click',function(){
		var dd = $(this).next();
		
		// If the title is clicked and the dd is not currently animated,
		// start an animation with the slideToggle() method.
		
		if(!dd.is(':animated')){
			dd.slideToggle();
			$(this).toggleClass('opened');
		}
		
	});
	
	$('#faq a.button').click(function(){
		
		// To expand/collapse all of the FAQs simultaneously,
		// just trigger the click event on the DTs
		
		if($(this).hasClass('expand'))
		{
			$('#faq dt:not(.opened)').click();
			$(this).toggleClass('expand');
			$('#faq a.button').attr("href", "#collapse");
			$('#faq a.button').html("Collapse All Questions");
		}
		else
		{
			$('#faq dt.opened').click();
			$(this).toggleClass('expand');
			$('#faq a.button').attr("href", "#expand");
			$('#faq a.button').html("Expand All Questions");
		}
		
		return false;
	});

});
