function initAccordion() {
//hides all the sections
  $('#accordionList .accordionListItemSubContent').hide();
//shows the first section on load, and sets background and color of question
  $('#accordionList .accordionListItemSubContent:first').show();
  $('#accordionList .accordionListItemSubContent:first').prev().removeClass().addClass('selected');
//function that runs when you click on a question
  $('#accordionList li a').click(
    function() {
      var checkElement = $(this).next();
//checks if section is already open "selected"; if it is, it closes it "inactive"
      if((checkElement.is('.accordionListItemSubContent')) && (checkElement.is(':visible'))) {
	  	$('#accordionList .accordionListItemSubContent:visible').slideUp('normal');
	  	$(this).removeClass().addClass('inactive');
        return false;
        }
//checks if section is closed "inactive"; if closed, open and set as "selected"
      if((checkElement.is('.accordionListItemSubContent')) && (!checkElement.is(':visible'))) {
      	var visible_subcontent = $('#accordionList .accordionListItemSubContent:visible');
        visible_subcontent.slideUp('normal');
        visible_subcontent.prev().removeClass().addClass('inactive');
        $(this).removeClass().addClass('selected');
        checkElement.slideDown('normal');
        return false;
        }
      }
    );
  }
$(document).ready(function() {initAccordion();});