My reply, with complete script, has been moved to a new topic:
For more information, see the wiki Searching the Forum for Answers section.