
function Hashtable()
{
	this.Keys = new Array();
	this.Values = new Object();
	this.count = 0;
	this.put = put;
	this.get = get;
	this.keys = keys;
	this.values = values;
	this.clear = clear;
	 
	this.containsKey = containsKey;
	this.containsValue = containsValue;
	this.size = size;
}
//----------------------------------------------------------------------------------------
	function put(key,value)
	{
		try	{
				if(typeof(this.Values[key]) == 'undefined') 
				{
					this.Keys[this.count] = key;
					++this.count;
				} 
				this.Values[key] = value;
				return true;
			}
		catch(e) {	return false; }
	}
	function get(key)
	{
		if(typeof(this.Values[key]) != 'undefined') return this.Values[key];
		return (arguments.length==2) ? arguments[1] : null;
	}

	function keys()
	{
		var n = 0;
		for(var i=0; i<this.Keys.length; i++) if(typeof(this.Keys[i]) != 'undefined') { this.Keys[n] = this.Keys[i]; n++; }
		this.Keys.length = n;
		return this.Keys;
	}
	function values()
	{
		var values = new Array();
		var n = 0;
		for(var i=0; i<this.Keys.length; i++) 
		if(typeof(this.Keys[i]) != 'undefined') {	values[n] = this.Values[this.Keys[i]]; n++;  }
		return values;
	}
	function clear()
	{
		for(var i=0; i<this.Keys.length; i++) delete this.Values[this.Keys[i]];
		this.Keys.length = 0;
		this.count = 0;
	}	function containsKey(key)
	{
		if(typeof(this.Values[key]) != 'undefined') return true;
		return false;
	}
	function containsValue(value)
	{
		for(var i=0; i<this.Keys.length; i++) if(this.Values[this.Keys[i]] == value) return true;
		return false;
	}
	function size()
	{
		return this.count;
	}
