var accordion;
var accordionTogglers;
var accordionContents;

window.onload = function() {
  accordionTogglers = document.getElementsByClassName('accToggler');

  accordionTogglers.each(function(toggler){
    //remember the original color
    toggler.origColor = toggler.getStyle('background');
    //set the effect
    toggler.fx = new Fx.Style(toggler, 'background');
  });

  accordionContents = document.getElementsByClassName('accContent');

  accordion = new Fx.Accordion(accordionTogglers, accordionContents,{
     start: 'all-closed',
     transition: Fx.Transitions.quadOut,
    //when an element is opened change the background color to blue
    onActive: function(toggler){
      toggler.setStyle('background','#F5F9E7 url(/images/arrows/arrow_aboutDown.gif) 0 50% no-repeat');
      },
    onBackground: function(toggler){
      //change the background color to the original (green)
      //color when another toggler is pressed
      toggler.setStyle('background','url(/images/arrows/arrow_about.gif) 0 50% no-repeat', toggler.origColor);
    }
  });
};