{
////////////////////////////////////////////////////////////////////////////////
// function Collection()													  //
//																			  //
//	Constructor of Collection												  //
////////////////////////////////////////////////////////////////////////////////

	function CollectionAdd(value)
	{
		this.List[this.List.length] = value;
	}

	function CollectionRemove(index)
	{
		// This function recreates the array excluding the undesired element
		var arTemp,iTempIndex=0;
		
		arTemp=new Array();
		for (var i=0; i < this.List.length; i++)
		  if (i!=index){
		   arTemp[iTempIndex]=this.List[i];
		   iTempIndex++;
		  }
		this.List=arTemp;
		arTemp=null;

	}

	function CollectionItem(index, value)
	{
		this.List[index] = value;
	}

	function CollectionItem(index)
	{
		return this.List[index];
	}

	function CollectionCount()
	{
		return this.List.length;
	}

	function CollectionExists(value)
	{
		var index;
		for (index=0;index<this.Count();index++)
		{
			if (this.Item(index)==value)
				return true;
		}
		return false;
	}
	
	function Collection()
	{
	    this.List = new Array();
		this.Add = CollectionAdd;
		this.Remove = CollectionRemove;
		this.Item = CollectionItem;
		this.Exists = CollectionExists;
		this.Count = CollectionCount;
	}
}