I think I might have done a bit more with that old Mivascript, but would have to dig out the code.
Since I originally posted years ago, I think...