window.addEvent('domready', function() {
	
	//create our Accordion instance
	var myAccordion = new Accordion($('accordion'), 'h4.toggler', 'div.element', {
		opacity: false,
		onActive: function(toggler, element){
			toggler.setStyle('color', '#D6BF85');
			toggler.setStyle('display', 'inline-block');
			toggler.setStyle('background', 'none repeat scroll 0 0 #291D08');
			toggler.setStyle('padding', '5px 7px 5px 0px');
			toggler.setStyle('margin-bottom', '0px');
			toggler.setStyle('border-top-left-radius', '4px');
			toggler.setStyle('-moz-border-top-left-radius', '4px');
			toggler.setStyle('-webkit-border-top-left-radius', '4px');
			toggler.setStyle('border-top-right-radius', '4px');
			toggler.setStyle('-moz-border-top-right-radius', '4px');
			toggler.setStyle('-webkit-border-top-right-radius', '4px');
			toggler.setStyle('-webkit-transition', 'all .2s linear');
			toggler.setStyle('-moz-transition', 'all .2s linear');
			toggler.setStyle('transition', 'all .2s linear');
			toggler.setStyle('-ms-transition', 'all .2s linear');
		},
		onBackground: function(toggler, element){
			toggler.setStyle('color', '#291D08');
			toggler.setStyle('display', 'inline-block');
			toggler.setStyle('background', 'none');
			toggler.setStyle('padding', 'inherit');
			toggler.setStyle('-webkit-transition', 'all .2s linear');
			toggler.setStyle('-moz-transition', 'all .2s linear');
			toggler.setStyle('transition', 'all .2s linear');
			toggler.setStyle('-ms-transition', 'all .2s linear');
		}
	});

	//add click event to the "add section" link
//	$('add_section').addEvent('click', function(event) {
//		event.stop();
//		
//		// create toggler
//		var toggler = new Element('h4', {
//			'class': 'toggler',
//			'html': 'Common descent'
//		});
//		
//		// create content
//		var content = new Element('div', {
//			'class': 'element',
//			'html': '<p>Testing testing.</p>'
//		});
//		
//		// position for the new section
//		var position = 0;
//		
//		// add the section to our myAccordion using the addSection method
//		myAccordion.addSection(toggler, content, position);
//	});
});


//	display:inline-block; //////#a77d4b
//	background:none repeat scroll 0 0 #291D08; 
//	padding:7px 10px; color:#D6BF85;
//	border-top-left-radius: 4px; -mox-border-top-left-radius: 4px; -webkit-border-top-left-radius: 4px;
//-webkit-transition: all 1s ease-in-out;
//	border-top-right-radius: 4px; border-top-right-radius: 4px; border-top-right-radius: 4px;
