Best way to display a Modal dialog on initialise of Portlet?

I need to display a modal dialog on the first display of my portlet with a message for the user to acknowledge before continuing.

I’ve tried creating a hidden toggle button and toggling that on the server side during the initialise action, but that doesn’t work. I suspect that the toggle must happen in JS on the client to work correctly.

Which brings me to my next question - is it possible to hook javascript into the initial load of the portlet?

and/or is there an easier way to do this?

thanks for any help in advance…