window.addEvent('domready', function() {
	
	//create our Accordion instance
	var myAccordion = new Accordion($('accordion'), 'h3.toggler', 'div.element', {
		opacity: false,
		display: -1,
		alwaysHide: true,
		onActive: function(toggler, element){
			toggler.setStyle('color', '#a96c0e');
		},
		onBackground: function(toggler, element){
			toggler.setStyle('color', '#5c6165');
		}
	});

	//add click event to the "add section" link 
	//uncomment the below code if you need to add sections in accordion
//	$('add_section').addEvent('click', function(event) {
//		event.stop();
//		
//		// create toggler
//		var toggler = new Element('h3', {
//			'class': 'toggler',
//			'html': 'Common descent'
//		});
//		
//		// create content
//		var content = new Element('div', {
//			'class': 'element',
//			'html': '<p>new content goes here</p>'
//		});
//		
//		// position for the new section
//		var position = 0;
//		
//		// add the section to our myAccordion using the addSection method
//		myAccordion.addSection(toggler, content, position);
//	});
});