// "hook.js" v1.01, uScream (c) 2004

function hook()
{
	this.baits = new Array();			//collection of events

	this.hook = function(varEvent,varFunction)	//hooks function to event
	{
		//if(!this.baits)this.baits=new Array();
		if(!this.baits[varEvent])this.baits[varEvent]=new Array();
		this.baits[varEvent][this.baits[varEvent].length] = varFunction;
	}

	this.run_event = function(varEvent)		//execs all f. in event collection
	{
		if(this.baits[varEvent])
		{
			for(hc=0;hc<this.baits[varEvent].length;hc++)
			{
				eval(this.baits[varEvent][hc]);
			}
		}
	}

}

hook = new hook();

window.onload = function(){hook.run_event('window.onload')}
window.onresize = function(){hook.run_event('window.onresize')}
