function valaszto(panel, items, toReplace)
{
	var self = this;
	if (!sablon['választó']) alert('Választópanel sablonja nincs betöltve!');
	this.panel = panel;
	this.subpanel = document.createElement('div');
	this.subpanel.style.display = 'none';
	this.subpanel.style.position = 'absolute';
	this.reinit = function()
	{
		this.top = parseInt(globalOffsetTop(panel)) + parseInt(panel.offsetHeight);
		this.subpanel.style.top = this.top + 'px';
		this.subpanel.style.left = globalOffsetLeft(panel) + 'px';
	}
	this.reinit();
	document.body.appendChild(this.subpanel);
	Array_foreach(items, function(x) { self.subpanel.innerHTML += sablon['választó'].sablonReplaceEx(toReplace(x)); });
	this.open = function()  { this.reinit(); this.subpanel.style.display = 'block'; }
	this.close = function() { this.subpanel.style.display = 'none'; }
	this.guard = new gyujto(new Array(), function() {}, function() {}, function() { if (self.subpanel.style.display == 'none') self.open(); else self.close(); });
	this.guard.addrec(this.panel);
	this.guard.addrec(this.subpanel);
}