Have you taken a look at the JS code in this macro:
?
For more information, see the wiki Searching the Forum for Answers section.