// "hook.js" v1.01, uScream (c) 2004

function wg_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]);
			}
		}
	}

}

if(window.hook==undefined) var hook = new wg_hook();

window.onload	= function(e){hook.run_event('window.onload');hook.run_event('load')}
window.onresize	= function(e){hook.run_event('window.onresize');hook.run_event('resize')}
window.onunload	= function(e){hook.run_event('unload')}
