window.onload=function(){
 
    // get all togglers
    togglers = $$('div#left h3');
    // get all accordion elements
    accordions = $$('div#left ul');
 
    // set initial style of the accordions (don't show them)	
    accordions.setStyles({'height': '0', 'overflow': 'hidden'});
 
    // create the accordion effect
    var myAccordion = new Fx.Accordion(togglers, accordions,{
    	// color and background of the toggler on open
        onActive: function(toggler){
            toggler.setStyle('color', '#000');
        },
        // color and background of the toggler on close
        onBackground: function(toggler){
            toggler.setStyle('color', '#7f7f7f');
          },
        alwaysHide: true,
        start : 'all-closed',
        height: true,
        opacity : false
    });
 
    // find the accordion (el) in accordions that has a child with id 'menuselected' and open it.
    accordions.each(function(el, i){
        if (el.hasChild($('current'))) {
            myAccordion.display(i);
        }
    });
}