window.addEvent('domready', function() {
var accordion = new Accordion('h2.t1', 'div.t2', {
start:'all-closed',
opacity: false,
duration: 350,
alwaysHide: true,
onActive: function(togglers, stretchers){
togglers.setStyle('color', '#DE0725');
togglers.setStyle('background-image', 'url(images/icono_preguntas_abierto.gif)');
},
onBackground: function(togglers, stretchers){
togglers.setStyle('color', '#333333');
togglers.setStyle('background-image', 'url(images/icono_preguntas_cerrado.gif)');
stretchers.setStyle('height', stretchers.offsetHeight);
$$('h3.t3o').setStyle('color', '#333333');
$$('h3.t3o').setStyle('background-image', 'url(images/icono_categorias_cerrado.gif)');
$$('div.t3').setStyle('height','0');//you close all sub accordion
}
}, $('sidebar'));
var accordion1 = new Accordion('h3.t3o', 'div.t3', {
start:'all-closed',
opacity: false,
duration: 400,
alwaysHide: true,
onActive: function(togglers, stretchers){
togglers.getParent().setStyle("height", "auto");
togglers.setStyle('color', '#DE0725');
togglers.setStyle('background-image', 'url(images/icono_categorias_abierto.gif)');
},
onBackground: function(togglers, stretchers){
togglers.setStyle('color', '#333333');
togglers.setStyle('background-image', 'url(images/icono_categorias_cerrado.gif)');
stretchers.setStyle('height',stretchers.offsetHeight);
}
}, $('sidebar'));
var accordion2 = new Accordion('div.t4o', 'div.t4', {
start:'all-closed',
opacity: false,
duration: 400,
alwaysHide: true,
onActive: function(togglers, stretchers){
togglers.getParent().setStyle("height", "auto");
},
onBackground: function(togglers, stretchers){
stretchers.setStyle('height',stretchers.offsetHeight);
}
}, $('sidebar'));
});
