//--------------------------------------------------------------------------------------------
var Translator = Class.create(
{
	initialize: function(itemArray)
	{
		try
		{
			this.items = $H([]);
			this.AddItems(itemArray);
		}
		catch (ex)
		{
			signal('Exception in constructor of Translator: ' + ex.message);
		}
	},
	keys: function()
	{
		return this.items.keys();
	},
	values: function()
	{
		return this.items.values();
	},
	inspect: function()
	{
		signal(this.items.inspect());
	},
	AddItem: function(id, value)
	{
		if (id != null && value != null)
		{
			var tmp = new Object();
			tmp[id] = value;
			this.items = this.items.merge(tmp);
		}
	},
	AddItems: function(itemArray)
	{
		if (itemArray != null)
		{
			var newItems = $H(itemArray);
			this.items = this.items.merge(newItems);
		}
	},
	GetItem: function(id)
	{
		var result = (!isNaN(id)) ? this.items[id] : null;
		result = (result == null) ? 'Translation not found' : result;
		return result;
	}
});
Translator.Instance = new Translator();

