Event.observe(window,"load",function(){$("expandableNoScript").remove();
initExpandableMenus();
handleExpandableMenus();
if($("expandAll")){$("expandAll").observe("click",function(){$$(".expandable").each(function(e){e.down("ul").show();e.addClassName("active");});});}
});

function handleExpandableMenus(){if($$(".expandable h4").first()){
$$(".expandable").each(function(e){e.down("h4").observe("click",function(){toggleMenu(e);});});}
}

function initExpandableMenus(){
if($("home")){$$(".expandable").each(function(e){e.down("ul").hide();});
}else{$$(".expandable").each(function(e){e.addClassName("active");});}
$$(".expandable").each(function(e){if(e.hasClassName("preExpanded")){e.down("ul").show();e.addClassName("active");}
if(e.hasClassName("preCollapsed")){e.down("ul").hide();e.removeClassName("active");}
});
}

function toggleMenu(e){
if(!e.down("ul").visible()){new Effect.BlindDown(e.down("ul"),{duration:.5,afterFinish:function(){e.down("ul").setStyle("height: auto");}});e.addClassName("active");
}else{new Effect.BlindUp(e.down("ul"),{duration:.5});e.removeClassName("active");}
}