added a few functions in dom.js