If you need to look at the parm strings in the current URL here is a way to do it that loads
the parms as JS vars, so
Once the code below has run will result in 2 JS vars called q1 and q2 which you can then act on.
myArray = document.location.href.split('?').split('&');
for(x=1; x<myArray.length; x++)
var tmp = myArray[x].split('=');
eval(unescape(tmp) + '="' + unescape(tmp) + '"');
The count x starts a 1 to avoid you having an undefined JS var called openpage