It's funny, but I wrote something similar back around 1999, built for the dhtml v4 browser days... I am so glad to be doing web development today vs the bad old days.. abstracting box drawing between Ie4 and NN4 browsers for stack diagrams and gantt charts was no fun at all... neither was masking while drawing because of NN4.x's bad flicker, or dealing with the various overflows, or bugginess all around... IE's broken 5.0 release (included with Office 2000), fixed in 5.0.1, and various other quirky behavior at the time.
(end of rant)