OK I got part of it to work but still some probs...
this code goes in oninit at level 1...
Code:
oninit:function(headers, expandedindices){ //custom code to run when headers have initalized
//do nothing
var re=new RegExp("catid=(\\d+)", "i") //regex to match catid=nnnnn integer
if(!re.test(document.URL)){ //if no catid in url
ddaccordion.collapseall('expandable0'); //collapse menu level 0
}else{ //catid exists in url so check expandedindices.length
if(expandedindices.length == 0){//NO headers are expanded so...
var urlparam=document.URL.match(/catid=(\d+)/i) //get catid from URL...
var catid = urlparam[1];
//set menu element id=prefix+catid in html
//use this to access menu element and get at ddacc headerindex...
var headerindex = document.getElementById("mh"+catid).getAttribute("headerindex");
headerindex=headerindex.replace("h", ""); //drop the h prefix for index id
//and use expandone to expand it...
ddaccordion.expandone('expandable0', headerindex);
}
}
It will collapseall if outside the relevant site section - 
(I dont know what happens below level 0 - maybe all levels need collapsing - but it looks OK for now anyway!)
code will auto-expand the menu for requests from external links/bookmarks...
But only at first menu level. I cant get it to work at lower levels :-(
Anybody know how to do this please?
tnx
l.
please note:
js is not my strong point and this is only for testing.
if you can see its wrong or know a better way please let me know.
Bookmarks