function urlParser(a){a!=undefined&&this.parse(a)}urlParser.prototype.protocol=window.location.protocol;urlParser.prototype.host=window.location.host;urlParser.prototype.path=window.location.pathname;urlParser.prototype.parameters={};urlParser.prototype.anchor="";urlParser.prototype.setBaseUrl=function(a){this.baseUrl=new urlParser(a);this.parse();return this};urlParser.prototype.resetBaseUrl=function(){this.baseUrl=undefined};
urlParser.prototype.reset=function(){if(this.baseUrl!=undefined){this.protocol=this.baseUrl.protocol;this.host=this.baseUrl.host;this.path=this.baseUrl.path}else{this.protocol=window.location.protocol;this.host=window.location.host;this.path=window.location.pathname}this.parameters={};this.anchor=""};
urlParser.prototype.parse=function(a){if(a==undefined)a="";this.reset();var b;if((b=a.search(/\:/))>=0){this.protocol=a.substring(0,b+1);a=a.substring(b+1)}if((b=a.search(/\#/))>=0){this.anchor=a.substring(b+1);a=a.substring(0,b)}if((b=a.search(/\?/))>=0){var c=a.substring(b+1)+"&";for(a=a.substring(0,b);(b=c.search(/\&/))>=0;){var d=c.substring(0,b);c=c.substring(b+1);if(d.length){b=d.search(/\=/);if(b<0)this.parameters[d]="";else this.parameters[d.substring(0,b)]=decodeURIComponent(d.substring(b+
1))}}}if(a.search(/\/\//)==0){a=a.substring(2);if((b=a.search(/\//))>=0){this.host=a.substring(0,b);this.path=a.substring(b)}else{this.host=a;this.path="/"}}else if(a.search(/\//)==0)this.path=a;else{c=this.path.lastIndexOf("/");if(c<0)this.path="/";else if(c<this.path.length-1)this.path=this.path.substring(0,c+1);for(;a.search(/\.\.\//)==0;){c=this.path.lastIndexOf("/",this.path.lastIndexOf("/")-1);if(c>=0)this.path=this.path.substring(0,c+1);a=a.substring(3)}this.path+=a}return this};
urlParser.prototype.assemble=function(){var a=this.protocol+"//"+this.host+this.path,b="?",c;for(c in this.parameters){a+=b+c+"="+encodeURIComponent(this.parameters[c]);b="&"}return a};jQuery.urlParser=new urlParser;

