function Mediator()
{
	this._controls = new Array();
	this._stop = false;
	this._frm = null;
	
	this.getForm = function()
	{
		return this._frm;
	}
	
	this.setForm = function(frm)
	{
		this._frm = frm;
	}
	
	this.stop = function()
	{
		this._stop = true;	
	}
	
	this.register = function(source, eventName, funct)
	{
		var o = new Object();
		o.source = source;
		o.eventName = eventName;
		o.funct = funct;
		this._controls[this._controls.length] = o;
	}
	
	this.notify = function(source, eventName)
	{
		this._stop = false;
		for(var i = 0; i < this._controls.length; i++)
		{
			if(this._stop)
				break;
			if(this._controls[i].source == source
				&& this._controls[i].eventName == eventName)
			{
				this._controls[i].funct(this, this._frm);
			}
		}
	}
}
	  


