/**
 * @author - 301 Design
 * 
 * Provides FAQ
 */
$(function() {

	var collapseAll = function() {
		$("div.expander")
		.find("li.question")
		.removeClass("expanded")
		.end()
		.removeClass("expanded");
	};
	
	
	var expandAll = function() {
		$("div.expander")
		.addClass("expanded")
		.find("li.question")
		.addClass("expanded");
	};

	// Expand All
	$("a.expandAll").click(function() {
		expandAll();
	});


	// Collapse All
	$("a.collapseAll").click(function() {
   		collapseAll();
	});



   // Provide click event for section blocks
   $("div.expander h3.label").click(function() {
      var $div = $(this).parent("div.expander");
      if ($div.hasClass("expanded")) {
         $div.removeClass("expanded");
      } else {
         $div.addClass("expanded");
      }
   });


   // Provide click event for individual questions
   $("div.expander ul li.question").click(function() {
      var $li = $(this);
      if ($li.hasClass("expanded")) {
         $li.removeClass("expanded");
      } else {
         $li.addClass("expanded");
      }
   });
   
   
   // Set initial state
   collapseAll();

});


