function NameObjectCollection()
{
	this.keys  = new Array();
	this.items = new Array();
		
	this.count = function()
	{
		return this.keys.length;
	}

	this.getItem = function(vKey)
	{
		if(typeof vKey == "string")
			intIndex = this.indexOf(vKey);

		if(typeof vKey == "number")
			intIndex = vKey;

		if(intIndex > -1 && intIndex < this.keys.length)
			return this.items[intIndex];
	}

	this.setItem = function(vKey,vValue)
	{
		var intIndex = -1;
		if(typeof vKey == "string")
			intIndex = this.indexOf(vKey);

		if(typeof vKey == "number")
			intIndex = vKey;
			
		if(intIndex > -1 && intIndex < this.keys.length)
			this.items[intIndex] = vValue;

		if(intIndex == -1)
			void this.onsetundefined(vKey,vValue);

		return intIndex;
	}

	this.item = function()
	{
		if(arguments.length==1)
			return this.getItem(arguments[0]);

		if(arguments.length==2)
			return this.setItem(this.setItem(arguments[0],arguments[1]));
	}

	this.item_ = function()
	{
		if(arguments.length==1)
			return this.getItem(arguments[0]);

		if(arguments.length==2)
			return this.getItem(this.setItem(arguments[0],arguments[1]));
	}

	this.add = function(sKey,vValue)
	{
		void this.add_(sKey, vValue);
	}

	this.add_ = function(sKey,vValue)
	{
		var intIndex = this.indexOf(sKey);

		if(intIndex==-1)
		{
			void this.items.push(vValue);
			void this.keys.push(sKey);
		}
		else
		{
			void this.onaddexisting(sKey, vValue)
		}
	}
				
	this.remove = function(vKey)
	{
		var intIndex = -1;
					
		if(typeof vKey == "string")
			intIndex = this.indexOf(arguments[0]);

		if(typeof vKey == "number")
			intIndex = parseInt(arguments[0]);

		if(intIndex>-1 && intIndex<this.keys.length)
		{
			this.keys.splice(intIndex,1);
			return this.items.splice(intIndex,1);
		}
	}
				
	this.removeAll = function()
	{
		void this.items.splice(0,this.items.length);
		void this.keys.splice(0,this.keys.length);
	}

	this.indexOf = function(sKey)
	{
		for(var i=0;i<this.keys.length;i++)
			if(this.keys[i] == sKey)
				return i;

		return -1;
	}

	this.exists = function(sKey)
	{
		return (this.indexOf(sKey) != -1);
	}

	this.clone = function(iStart, iLength)
	{
		var intStart  = (iStart!=undefined && !isNaN(iStart) && iStart > -1)? parseInt(iStart): 0;
		var intLength = (iLength!=undefined && !isNaN(iLength) && iLength < this.keys.length)? parseInt(iLength): this.keys.length;

		var objRet = new NameObjectCollection();
		for(var i=intStart;i<intLength;i++)
			void objRet.add(this.keys[i],this.items[i]);

		return objRet;
	}

	this.onaddexisting  = function(){return;}
	this.onsetundefined = function(){return;}
}