// Copyright 2004 AppDepot Web Services Inc. All Rights Reserved. This is a licensed product
///
/// An object for manipulating the querystring
///
///Class
function QueryString()
{
this.Attributes = null;
this.Count = 0;
this.Init = function()
{
var search = top.location.search.substring(1);
var pairs = search.split("&");
this.Count = pairs.length;
this.Attributes = new Object();
for (var i = 0; i < pairs.length; ++i)
{
var pair = pairs[i].split("=");
this.Attributes[pair[0]] = pair[1];
}
}
this.Init();
///
/// Retrieves all of the keys for each of the available querystring options
///
this.Keys = function()
{
var RetVal = new Array();
for(var Name in this.Attributes)
{
RetVal[RetVal.length] = Name;
}
return RetVal;
}
this.Get = function(name)
{
return unescape(this.Attributes[name]);
}
this.Set = function(name, value)
{
this.Attributes[name] = escape(value);
}
this.Remove = function(name)
{
this.Attributes[name] = null;
}
this.ToString = function()
{
var pairs = new Array();
for (var key in this.Attributes)
{
if (this.Attributes[key] != null)
{
pairs.push(key + '=' + this.Attributes[key]);
}
}
return pairs.join('&');
}
this.ToScriptNameString = function ()
{
return location.pathname + '?' + this.ToString();
}
}