function HashTable()
{
	var obj = new Object();	
	obj.m_map = new Object();
	
	obj.put = HashTable_Put;
	obj.get = HashTable_Get;
	
	return obj;
}
		
function HashTable_Put(key, obj)
{
	eval("this.m_map." + key + " = obj;");			
}

function HashTable_Get(key)
{
	var result = eval("this.m_map." + key + ";");
	return (typeof(result) != 'undefined')? result : null;
}

function ArrayList()
{
	var obj = new Object();
	obj.m_List = new Array();
	obj.add = ArrayList_Add;
	obj.remove = ArrayList_Remove;
	obj.indexOf = ArrayList_IndexOf;
	obj.contains = ArrayList_Contains;
	obj.getEnumerator = ArrayList_GetEnumerator;
	obj.elementAt = ArrayList_ElementAt;
	obj.clear = ArrayList_Clear;
	obj.removeElementAt = ArrayList_RemoveElementAt;
	obj.getCount = ArrayList_Count;
	obj.toString = ArrayList_ToString;
	
	return obj;
}

function ArrayList_RemoveElementAt(index)
{
	this.m_List.splice(index, 1);	
}

function ArrayList_Clear()
{
	this.m_List.splice(0, this.m_List.length);
}

function ArrayList_Add(obj)
{				
	this.m_List[this.m_List.length] = obj;
}

function ArrayList_Remove(obj)
{
	var idx = 0;
	while (idx < this.m_List.length)
	{
		if (this.m_List[idx] == obj)
		{
			this.m_List.splice(idx, 1);	
		}
		else
		{
			idx++;	
		}
	}
}


function ArrayList_IndexOf(obj)
{
	for (var i = 0; i < this.m_List.length; i++)
	{
		if (this.m_List[i] == obj)
		{			
			return i;
		}
	}
	return -1;
}

function ArrayList_Contains(obj)
{
	return this.indexOf(obj) != -1;	
}


function ArrayList_ElementAt(index)
{
	return this.m_List[index];	
}


function ArrayList_GetEnumerator()
{
	return this.m_List;	
}

function ArrayList_Count()
{
	return this.m_List.length;
}

function ArrayList_ToString()
{
	var result = "";
	for (var i = 0; i < this.m_List.length; i++)
	{
		if (i != this.m_List.length - 1)
		{
			result += this.m_List[i] + ", ";
		}
		else
		{
			result += this.m_List[i];		
		}				
	}
	return result;
}


function HashTableArray()
{
	var obj = new Object();	
	obj.m_map = new Object();
	
	obj.put = HashTableArray_Put;
	obj.get = HashTableArray_Get;
	
	return obj;
}

function HashTableArray_Put(key, obj)
{
	var oldObj = this.get(key);			
	
	if (oldObj != null)
	{				
		oldObj.add(obj);		
	}
	else
	{			
		var a = new ArrayList();			
		a.add(obj);
		eval("this.m_map." + key + " = a;");				
	}
}

function HashTableArray_Get(key)
{
	var result = eval("this.m_map." + key + ";");	
	return (typeof(result) != 'undefined')? result : null;
}