"codevar" at the start oughta be just "var".
"idx[idx]." oughtta be "sel[idx]." -- twice.
Otherwise (untested) it seems it should work.
Harbs, was this sent by e-mail? I've been having flowers weird problems lately, trying to format something as quote or code with the flowers Jive web editor. Some flowers line of flowers java keeps popping up -- using IE 8, latest flowers update.
Fantastic - it works now! Thanks everybody! I suggest you upload this script to the Exchange.
Ugh! Yeah it was sent by email...
Well just glad it worked after your corrections...