Code:
var uriString = window.location.href;
var getVars = new Array();
if (-1 != (quePos = uriString.indexOf('?')))
{
 uriString = uriString.substr(quePos + 1);
 uriString = uriString.split(/&/);
 for (var i in uriString)
 {
  var currentVar = uriString[i];
  var equalPos = currentVar.indexOf('=');
  equalPos = equalPos==-1 ? currentVar.length : equalPos;
  var currentVal = currentVar.substr(equalPos + 1);
  currentVar = currentVar.substr(0, equalPos);
  getVars[currentVar] = unescape(currentVal);
 }
}
Hope it helps someone