window.addEvent('domready', function() {

var accordion = new Accordion('div.t1', 'div.t2', {
							  
start:'all-closed',
opacity: true,
duration: 100,
alwaysHide: true,
onActive: function(togglers, stretchers){
togglers.setStyle('background-color', '#A3BAE3');
$$('div.t2-o').setStyle('height','0');//you close all sub accordion
$$('div.t2o-o').setStyle('height','0');//you close all sub accordion
},
onBackground: function(togglers, stretchers){
togglers.setStyle('background-color', '#EBECFF');
stretchers.setStyle('height', stretchers.offsetHeight);
$$('div.t3').setStyle('height','0');//you close all sub accordion
$$('div.t3-o').setStyle('height','0');//you close all sub accordion

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