function RequestUrl(c){if(c===undefined){c={}}var d=true;if(c===false||c.baseUrl!==undefined){d=false}if(typeof c=="string"){c={baseUrl:c}}this.path="";this.query={};var g=c.baseUrl||location.href;g=g.split("#").shift();var b=g.split("?");this.path=b.shift();if(d&&b.length>0){var k=b.shift().split("&");for(var f=0;f<k.length;f++){var e=k[f].split("=");var a=e.shift();if(e.length>0){var j=e.shift()}else{var j=""}if(unescape(a).substr(unescape(a).length-2,2)=="[]"){a=unescape(a)}if(a.substr(a.length-2,2)=="[]"){a=a.substr(0,a.length-2);if(this.query[a]===undefined||!(this.query[a] instanceof Array)){this.query[a]=[]}this.query[a].push(j)}else{this.query[a]=j}}}if(c.keep!==undefined&&c.keep instanceof Array){var h={};for(var f=0;f<c.keep.length;f++){if(this.query[c.keep[f]]!==undefined){h[c.keep[f]]=this.query[c.keep[f]]}}this.query=h}}RequestUrl.prototype.add=function(d,c){if(d instanceof Array){for(var b=0;b<d.length;b++){if(d[b].name!==undefined&&d[b].value!==undefined){this.query[d[b].name]=d[b].value}}}else{if(d instanceof Object){for(var b in d){this.query[b]=d[b]}}else{if(typeof d=="string"){if(c===undefined){var a=new RequestUrl("?"+d);for(var b in a.query){this.query[b]=a.query[b]}}else{this.query[d]=c}}}}return this};RequestUrl.prototype.removeAll=function(b){for(var a in this.query){if(b===undefined||jQuery.inArray(a,b)==-1){this.remove(a)}}return this};RequestUrl.prototype.remove=function(a){delete this.query[a];return this};RequestUrl.prototype.get=function(a){if(this.query[a]!==undefined){return this.query[a]}return null};RequestUrl.prototype.getUrl=function(){var c="";var a=true;for(var b in this.query){if(!a){c+="&"}else{a=false}if(this.query[b] instanceof Array){c+=b+"[]="+this.query[b].join("&"+b+"[]=")}else{c+=b+"="+this.query[b]}}return this.path+"?"+c};