Thank you both for your replies.
I went with jamezw's solution as I wanted to keep it all in the javascript function, and it worked a treat.
I then used VB on the error page (i.e. Me.Request.Form.item("param") ) to pick up the passed in parameters, rather than javascript as I needed to process the parameters as part of an existing VB process. That worked a treat too.
So I now have a much neater and more secure redirect happening. Thankyou very much !!!