Set window.onclick to null after closing type box