>     window.caption = files[current_item] || "Untitled"

See that's what I mean - everything I can think of in Ruby has already been
implemented.
Obviously I have far too few opportunities to write Ruby code, but when I
do, I get all these enlightning experiences :-)

Mikkel