/* Copyright © 2008 Deep Web Technologies, Inc.  All rights reserved. */

function URLBuilder(A){this._base=A;this._params=[];this._anchor=null;this._paramCount=0;}URLBuilder.prototype.addParam=function(A,B){if(typeof (B)!="undefined"){this._params[A]=encodeURIComponent(B);this._paramCount++;}};URLBuilder.prototype.setAnchor=function(A){if(typeof (A)!="undefined"){this._anchor=A;}};URLBuilder.prototype.toString=function(){var B=this._base;if(this._paramCount>0){if(B.indexOf("?")<0){B+="?";}else{B+="&";}var C=0;for(var A in this._params){B+=A+"="+this._params[A];if(C<this._paramCount-1){B+="&";}++C;}}if(this._anchor!==null){B+="#"+this._anchor;}return B;};