function pb_url(a){this._scheme="";this._host="";this._path="";this._query={};this._hash="";var b=a.match(/^([\w]+)\:\/\//);if(b){a=a.replace(b[0],"");this._scheme=b[1]}var b=a.match(/^([^/]+)/);if(b){a=a.replace(b[0],"");this._host=b[1]}var b=a.match(/#(.*)$/);if(b){a=a.replace(b[0],"");this._hash=b[1]}var b=a.match(/\?(.*)$/);if(b){a=a.replace(b[0],"");b=b[1].split("&");for(var c=0;c<b.length;c++){var d=b[c].split("=");this.query(d[0],d[1])}}this._path=a}pb_url.prototype.query=function(){if(arguments.length<2){var b=[];for(x in this._query){b.push(x+"="+this._query[x])}return b.length>0?"?"+b.join("&"):""}else{if(arguments.length===2){var c=arguments[0].match(/([\w\d\_\-\.]+)\[\]$/);if(c){if(this._query[c[1]]){this._query[c[1]].push(arguments[1])}else{this._query[c[1]]=[arguments[1]]}}else{this._query[arguments[0]]=arguments[1]}}}return this};pb_url.prototype.hash=function(){if(arguments.length===0){return this._hash.length>0?"#"+this._hash:""}return this};pb_url.prototype.toString=function(){return this._scheme+"://"+this._host+this._path+this.query()+this.hash()};
