var YUD = YAHOO.util.Dom; function getMenuTags ( root,tag ) { var tags = new Array() for(var i=0; i < root.childNodes.length; i++) { n = root.childNodes[i] if(n.nodeType != 1) continue if(n.nodeName.toLowerCase() == 'a') { tags.push(n) continue } t = getMenuTags(n) for(var j=0; j < t.length; j++) { tags.push(t[j]) } } return tags } var id; var root_id = 'main-menu' tags = getMenuTags(document.getElementById(root_id)) for (var i = 0; i< tags.length; ++i) { tag = tags[i] href = tag.toString() var element = tag.parentNode var host = element.parentNode while(host) { if(host.id) { id = host.id break } host = host.previousSibling } if (id && href == window.location.href) { if(host.id != root_id) { AccordionMenu.setting(root_id, { animation:false }) AccordionMenu.openDtById(id) AccordionMenu.setting(root_id, { animation:true }) YUD.addClass(host, 'a-m-t-active') } YUD.addClass(element, 'a-m-t-active') break } }