Here you can find the code of the dhtml
class.
You should always use it, it is self documented and that’s the only API that’s not likely to change. Additionnaly it adds a few functionnality that you will need. You can find some examples in the wiki to get you started.