window.addEvent('domready', function() {
	
	//create our Accordion instance
	var myAccordion = new Accordion($('accordion'), 'a.toggler', 'div.element', {
	//opacity: false,
	//opacity: true,
	//	show: -1,
	show: 'none',
	//show: 'true',
	//alwaysHide: true,
	start: 'all-closed',
	duration: 500,		
		onActive: function(toggler, element){

			var accordion = $('accordion');	
			
			if(accordion.elementToShow) {
				
				var myFx21 = new Fx.Tween(accordion.elementToShow);
				//Transitions the background color of the Element from black to red:
				myFx21.set('tween', {duration: 'short'});				
				myFx21.start('color', '#fff', '#23234B');
				//myFx21.set('color', '#23234B');			

			
			}

			$('accordion').elementToShow = element.getPrevious();

			if(accordion.elementTogglerToShow) {
				
				var myFx22 = new Fx.Tween(accordion.elementTogglerToShow);
				//Transitions the background color of the Element from black to red:
				myFx22.set('tween', {duration: 'short'});				
				myFx22.start('color', '#fff', '#1E6289');			
				//myFx22.set('color', '#1E6289');		
				
			}

			$('accordion').elementTogglerToShow = toggler;

			var myFx1 = new Fx.Tween(element.getPrevious());
			//Transitions the background color of the Element from black to red:
			//myFx1.set('tween', {duration: 'short'});
			myFx1.start('color', '#23234B', '#fff');
			//myFx1.set('color', '#fff');

			var myFx2 = new Fx.Tween(toggler);
			//Transitions the background color of the Element from black to red:
			//myFx2.set('tween', {duration: 'short'});
			myFx2.start('color', '#1E6289', '#fff');
			//myFx2.set('color', '#fff');
			
			
		},
		onBackground: function(toggler, element){

		},
		onComplete: function(){

    	}
		
	});

});

