adding functionalities to open/close nodes by javascript code