var StringUtils =
{
	IsNullOrEmpty: function(value)
	{
		return (value == null || value.length == 0);
	}
}

var Utils =
{
	IsNumeric: function(input)
	{
		if( input == null )
			return false;

		if( input.length > 0 )
		{
			var ValidChars = "0123456789";
			for( index = 0; index < input.length; index++ )
			{
		      		if( ValidChars.indexOf(input.charAt(index)) == -1 )
						return false;
			}
			
			return true;
		}
	},
	
	RemoveChildNodes: function(node)
	{
		while( node.childNodes.length > 0 )
			node.removeChild(node.childNodes[0]);
	}
}

function NameValueCollection()
{
	this.length = 0;
	this.items = new Array();
	
	/*
	for (var i = 0; i < arguments.length; i += 2) {
		if (typeof(arguments[i + 1]) != 'undefined') {
			this.items[arguments[i]] = arguments[i + 1];
			this.length++;
		}
	}
	*/
}

NameValueCollection.prototype.containsKey = function(key)
{
	return (this.items[key] != null);
}

NameValueCollection.prototype.get = function(key)
{
	return this.items[key];
}

NameValueCollection.prototype.remove = function(key)
{
	if( this.items[key] != null )
	{
		this.length--;
		delete this.items[key];
	}
}

NameValueCollection.prototype.set = function(key, value)
{
	if( key != null )
	{
		if( this.items[key] == null )
			this.length++;
		this.items[key] = value;
	}
}

NameValueCollection.prototype.toString = function()
{
	var returnString = "";
	for( key in this.items )
		returnString += (key + "=" + encodeURI(this.items[key]) + "&");
	
	return (returnString.substr(0, returnString.length-1));
}

