I have no idea what to do with this code, it is without context. The last part, the script is the code that will close the sidebar, but the way it is here, it will do that as soon as the page is loaded, so nothing will happen. That code has to be triggered by something you do on the page.
Milan