/*	Adds Accordion functionality to site.  Should use accToggler on H2s, since colour already good.	*/
function flexiArticles() {
	// Get Togglers and Configure
	var accordionTogglers = document.getElementsByClassName('accToggler');
	accordionTogglers.each(function(toggler){
		//remember the original color
//		toggler.origColor = toggler.getStyle('background-color');
		toggler.origColor = toggler.getStyle('color');
		//set the effect
//		toggler.fx = new Fx.Style(toggler, 'background-color');
		toggler.fx = new Fx.Style(toggler, 'color');
	});
	// Get Content Blocks
	var accordionContents = document.getElementsByClassName('accContent');
	// Run it
	accordion = new Fx.Accordion(accordionTogglers, accordionContents,{
	//when an element is opened change the background color to blue
		onActive: function(toggler){
			toggler.fx.start('#FF0000');											// May need to set this colour.
		},
		onBackground: function(toggler){
			//change the background color to the original
			//color when another toggler is pressed
//			toggler.setStyle('background-color', toggler.origColor);
			toggler.setStyle('color', toggler.origColor);
		},
		alwaysHide: true
	});
}
window.addEvent('domready', flexiArticles);