Hi Shinu,
Thanks for your help.
It now sort of works, except that when the javascript is displayed the popup is displayed, then instantly hidden again. I presume this is something to do with the postbacks resetting the control but I'm unsure how to fix it.