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.setStyle('background-color', '#414c4e');
},
onBackground: function(togglers, stretchers){
togglers.setStyle('background-color', '#414c4e');
stretchers.setStyle('height', stretchers.offsetHeight);
$$('div.t3').setStyle('height','0');//you close all sub accordion
}
}, $('sidebar'));
var accordion1 = new Accordion('div.t3o', 'div.t3', {
start:'all-closed',
opacity: false,
duration: 100,
alwaysHide: true,
onActive: function(togglers, stretchers){
togglers.getParent().setStyle("height", "auto");
},
onBackground: function(togglers, stretchers){
stretchers.setStyle('height',stretchers.offsetHeight);
}
}, $('sidebar'));
});