
$(document).ready(function() 
  { 
      $('.accordionButton').click(function() 
      
        {
          if($(this).next().is(':hidden') !== true) 
            {
              $(this).removeClass('on'); 
              $(this).next().slideUp('normal');
            }
            else 
            {
              $('.accordionButton').removeClass('on');  
              $('.accordionContent').slideUp('normal');
              
              if($(this).next().is(':hidden') === true) 
                {
                  $(this).addClass('on');
                  $(this).next().slideDown('normal');
                 }
            }
         });
  
        $('.switch').click(function() 
        
          {
            if($(this).text() == 'Collapse All') 
            {
              $('.accordionContent').slideUp('normal');
              $('.accordionButton').removeClass('on'); 
              $(this).text($(this).text() == 'Expand All' ? 'Collapse All' : 'Expand All');
            }
            else
            {
              $('.accordionContent').slideDown('normal');
              $('.accordionButton').addClass('on'); 
              $(this).text($(this).text() == 'Expand All' ? 'Collapse All' : 'Expand All');
            }
          }
        );

  /*** REMOVE IF MOUSEOVER IS NOT REQUIRED ***/
  
  //ADDS THE .OVER CLASS FROM THE STYLESHEET ON MOUSEOVER 
  $('.accordionButton').mouseover(function() 
    {
      $(this).addClass('over');
    
  //ON MOUSEOUT REMOVE THE OVER CLASS
    }).mouseout(function() 
    {
      $(this).removeClass('over');                    
    });
    
  /*** END REMOVE IF MOUSEOVER IS NOT REQUIRED ***/
  
  
  /********************************************************************************************************************
  CLOSES ALL S ON PAGE LOAD
  ********************************************************************************************************************/  

        $('.accordionContent').hide();
  });
