Array.prototype.contains=function(element){for(var i=0;i<this.length;i++){if(this[i]==element){return true;}}return false;};if(typeof(addNamespace)=="undefined"){addNamespace=function(namespace){var o=window;var d=namespace.split(".");for(var j=0;j<d.length;j=j+1){o[d[j]]=o[d[j]]||{};o=o[d[j]];}};}addNamespace("accedo.querystring");accedo.querystring.excludes=null;accedo.querystring.keyValuePairs=null;accedo.querystring.init=function(){this.getAllParameters();};accedo.querystring.getAllParameters=function(){var url=null;var index=window.location.href.indexOf("?");if(index!==-1){if(index!==(window.location.href.length-1)){url=window.location.href.substring(index+1);}}if(url===null){this.keyValuePairs=[];}else{this.keyValuePairs=url.split("&");}};accedo.querystring.getValue=function(_key){var key,value;for(var param=0;param<this.keyValuePairs.length;param++){key=this.keyValuePairs[param].split("=")[0];if(key==_key){value=this.keyValuePairs[param].split("=")[1];this.lastIndex=param;return value;}}this.lastIndex=null;return null;};accedo.querystring.parameters=function(a){var params;if(this.keyValuePairs===null){params=[];}else{params=this.keyValuePairs.slice(0);}var excludes=[];var includes=[];if(a!=null){for(var j=0;j<a.length;j++){if(a[j].indexOf("=")==-1){excludes.push(a[j]);}else{if(this.getValue(a[j].split("=")[0])){params[this.lastIndex]=a[j];}else{params.push(a[j]);}}}}var additionalParams="";for(var i=0;i<params.length;i++){var key=params[i].split("=")[0];var value=params[i].split("=")[1];if(!excludes.contains(key)){additionalParams+=key+"="+value+"&";}}var lengthOfParams=additionalParams.length;if(lengthOfParams>0){additionalParams=additionalParams.substring(0,additionalParams.length-1);}return additionalParams;};accedo.querystring.useValue=function(key,scope){if(typeof(scope)==='undefined'){scope=window;}if(typeof(scope[key])==='undefined'){scope[key]=this.getValue(key);}return scope;};accedo.querystring.useValues=function(values,scope){if(typeof(scope)==='undefined'){scope=window;}for(var i=0;i<this.keyValuePairs.length;i++){var key=this.keyValuePairs[i].split("=")[0];var value=this.keyValuePairs[i].split("=")[1];if(typeof(scope[key])==='undefined'){if(typeof(values)==='undefined'||values===null||values.length===0||values.contains(key)){scope[key]=value;}}}return scope;};accedo.querystring.init();window.params = accedo.querystring.useValues(null, {});
