/*
 * Copyright (C) 1995-2011 by 4system Polska Sp. z o.o.
 * All Rights Reserved. v4
 */
 
componentDictionaryGroups = function(name)
{
	this.__componentText = __componentText;
	this.__componentText(name);
	
	this.groups = "";
};

componentDictionaryGroups.prototype = new __componentText;
componentDictionaryGroups.prototype.type = "componentDictionaryGroups";

componentDictionaryGroups.prototype.onBaseCreate = function(obj)
{
	this.captureMouseEvents();
};

componentDictionaryGroups.prototype.componentDictionaryGroupsBaseOnCreate = componentDictionaryGroups.prototype.onCreate;
componentDictionaryGroups.prototype.onCreate = function(obj)
{
	this.componentDictionaryGroupsBaseOnCreate();
	
	if (this.scrollable) {
		this.scrollOffset = 14;
		this.stopPropagation = true;
	};
	
	this.groups = this.text;
};

componentDictionaryGroups.prototype.onPaint = function(obj)
{
	this.text = "";
	for (var i=0; i<dictionary.groups.length; i++) {
		var group = dictionary.groups[i];
		this.text += '<a href="javascript:void(0);" title="' + group.caption + '" onclick="pc.' + this.id + '.doClick(\'' + group.id + '\');">' + group.caption + '</a> ';
	}
	this.setValue(this.text);
};

componentDictionaryGroups.prototype.doClick = function(value)
{
	dictionary.setFilter(value);
};
