// EventHandler JavaScripts
// project
// Author: ker
// Copyright: 2001-2002, alva & phoenix GmbH, Zug

eventHandler.instanceCount = 0;
var resizeHandler = new eventHandler("window.onresize");

function eventHandler(evt)
{
	this.handle = evt;
	this.subscriptions = new Array();
	this.subscriptionCount = 0;
	
	this.add = ehAdd;
	this.name = "EventHandler" + eventHandler.instanceCount++;
	eval("var " + this.name + "=this");
	
	this.fn = 'new Function("' + this.subscriptions.join(";") + '");';
	eval(this.handle + " = " + this.fn);
}

function ehAdd(what)
{
	this.subscriptions[this.subscriptionCount] = what;
	this.subscriptionCount++;
	
	this.fn = 'new Function("' + this.subscriptions.join(";") + '");';
	eval(this.handle + " = " + this.fn);
}