window.addEvent('domready', function() {
var accordion = new Accordion('div.t1', 'div.t2', {
start:'all-closed',
opacity: false,
duration: 100,
alwaysHide: true,
onActive: function(togglers, stretchers){
	togglers.set('class', 't1-set');
	stretchers.setStyles({
		border: '3px solid #f8e9d7',
		'border-top' : 'none',
		margin: '0 0 8px 0'
		});
},
onBackground: function(togglers, stretchers){
	togglers.set('class', 't1');
	stretchers.setStyles({
		height: stretchers.offsetHeight,
		border: 'none',
		'border-top' : 'none',
		margin: 0
		});
	$$('div.t3').setStyle('height','0');//you close all sub accordion
	$$('div.t3').setStyle('padding','0');
	$$('div.t3o-set').set('class', 't3o');
}
}, $('sidebar'));

var accordion1 = new Accordion('div.t3o', 'div.t3', {
start:'all-closed',
opacity: false,
duration: 100,
alwaysHide: true,
onActive: function(togglers, stretchers){
	togglers.getParent().setStyles({
		height: 'auto'
	});
	togglers.set('class', 't3o-set');
	stretchers.setStyles({
		padding: '5px 15px'
		});
},
onBackground: function(togglers, stretchers){
	togglers.set('class', 't3o');
	stretchers.setStyle('height',stretchers.offsetHeight);
	stretchers.setStyles({
		height: stretchers.offsetHeight,
		padding: 0
		});
}
}, $('sidebar'));
});