Accordion {Navigation} - matching current link

Accordion {Navigation} - matching current link


Hi there, I'm sure there are plenty of you familiar with the Accordion
extension....
I'm trying to use it for a left hand side navigation menu, and most of
it is ideal. However, it seems to want an exact match of the page URI
(after tld) and the <li> link. This works in many cases but as soon as
I append something to the URI it fails to open any menu whatsoever.
i.e. so if the link was 'data.php?ext=money', everything is fine, but
'data.php?ext=money&sort=1' breaks it.
I think I can see why it's so, I suppose it's so that 'data.php?
ext=money' and 'data.php?ext=money_bags' don't both return as current.
However, I've been careful with my addresses because I want it to
return current when the <li> link matches exactly the first part of
the URI. Tricky to explain does that make sense?
So, if I've a menu like...
<li><a href=''data.php?ext=import'>Import</a></li>
<li><a href=''data.php?ext=files'>Files</a></li>
<li><a href=''data.php?ext=foobar'>FooBar</a></li>
Then all of the following will mark the respective <li> as current...
/data.php?ext=import_1
/data.php?ext=files&blah=TRUE
/data.php?ext=foobars
For those of you who don't have this extension but fancy a challenge,
I think the following code may be the area for modifcation, but it's
quite likely that I'm wrong!
function findActive(headers, selector) {
    return selector != undefined
        ? typeof selector == "number"
            ? headers.filter(":eq(" + selector + ")")
            : headers.not(headers.not(selector))
        : selector === false
            ? $([])
            : headers.filter(":eq(0)");
}
If anyone can help, I'd appreciate it a lot.