Although I understand you've objecting the the algorithm.

Have you looked on www.quirksmode.org? It can be hard to find things sometimes, but has code and discussions about that sort of thing.

Wade.