update implementation of window.
implement alert support.
add dialog document.