window.addEvent('domready', function() {
var accordion = new Accordion('div.t1', 'div.t2', {
start:'all-closed',
opacity: true,
duration: 500,
alwaysHide: true,
onActive: function(togglers, stretchers){
togglers.setStyle('background', '#5075AC  url(../img/icon_accordion_open1.png) no-repeat');
},
onBackground: function(togglers, stretchers){
togglers.setStyle('background', '#5075AC url(../img/icon_accordion_closed1.png) no-repeat');
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: true,
duration: 500,
alwaysHide: true,
onActive: function(togglers, stretchers){
togglers.setStyle('background', '#7FC0F8 url(../img/icon_accordion_open2.png) no-repeat');
togglers.setStyle('background-Position', '20px 0');
togglers.getParent().setStyle("height", "auto");
},
onBackground: function(togglers, stretchers){
stretchers.setStyle('height',stretchers.offsetHeight);
togglers.setStyle('background', '#7FC0F8 url(../img/icon_accordion_closed2.png) no-repeat');
togglers.setStyle('background-Position', '20px 0');
}
}, $('sidebar'));

});