frok from http://code.google.com/p/delphi-html-parser/