(function(){
var url = 'http://mydomain.com/?q=microsoft&p=next'
var s = url.search.substring(1).split('&');
if(!s.length) return;
window.GET = {};
for(var i = 0; i < s.length; i++) {
var parts = s[i].split('=');
GET[unescape(parts[0])] = unescape(parts[1]);
}
}())
Think this will work..