function Request(url) {
         this.queryString = null;
         this.parameters = new Array();
         var paramsStart = url.search(/\?/);
         if (paramsStart > -1) {
             this.queryString = url.substring(paramsStart + 1);

             hParams = this.queryString.split('&');
             for (var i = 0; i < hParams.length; i++) {
                  var pos = hParams[i].search(/=/);
                  if (pos > -1) {
                      if (pos == (hParams[i].length - 1)) {
                          this.parameters[hParams[i].substring(0, pos)] = '';
                      } else {
                        this.parameters[hParams[i].substring(0, pos)] = unescape(hParams[i].substring(pos + 1));
                      }
                  } else {
                      this.parameters[hParams[i].substring(0, pos)] = '';
                  }
             }
         }

         this.getParameter = function (name) {
              for (var arrKey in this.parameters) {
                if (arrKey == name) {
                    return this.parameters[name];
                }
              }

              return null;

         }
}

function getRequest() {
         return new Request(document.URL);
}