		//
		//  In my case I want to load them onload, this is how you do it!
		// 
		Event.observe(window, 'load', loadAccordions, false);

	
		//
		//	Set up all accordions
		//
		function loadAccordions() {

                        var navAccordion = new accordion('#nav_container', {
                                classNames : {
                                        toggle : 'expander',
                                        toggleActive : 'expanded',
                                        content : 'expand_content'
                                }
                        });
                      var paneAccordion = new accordion('#panes', {
                                classNames : {
                                        toggle : 'pane',
                                        toggleActive : 'pane_active',
                                        content : 'pane_open'
                                },
                                defaultSize : {
                                      width : 345
                                },
                                direction : 'horizontal'
                        });
                           
if($$('.pane')[4]) {
paneAccordion.activate($$('.pane')[4]);
}


if(navactive) {
navAccordion.activate($$('#nav_container .expander')[navactive-1]);
} 
		}

function fixheights() {
document.getElementById('nav_container').style.padding = "12px 0 0 50px";
for(i=0; i<5; i++) { $$('.pane .activator')[i].style.padding = "0 0 0 0"; $$('.pane_content')[i].style.padding = "16px 16px 16px 16px"; }

document.getElementById('panes').style.display = 'block';

var menuheight = document.getElementById("nav_container").offsetHeight;
//alert(menuheight);
if(menuheight > 220) {
contentheight = $$('.pane_active')[0].next(1).offsetHeight;

if((menuheight+50) < contentheight) {
//alert(menuheight+', '+contentheight);
document.getElementById('nav_container').style.padding = "12px 0 "+ (contentheight - (menuheight + 50)) + "px 50px";
for(i=0; i<5; i++) { $$('.pane .activator')[i].style.padding = "0 0 "+ (contentheight - 289) + "px 0"; }
} else { 
//alert('!');
document.getElementById('nav_container').style.padding = "12px 0 21px 50px";
for(i=0; i<5; i++) { $$('.pane .activator')[i].style.padding = "0 0 "+(menuheight - 218) + "px"; }
$$('.pane_active')[0].next(1).childNodes[1].style.padding = "16px 16px "+ (menuheight + 39 - $$('.pane_active')[0].next(1).childNodes[1].offsetHeight) + "px 16px";
}
}
}

function accordion_done() {
fixheights();
}
