/*
	addEvent attaches a function to a particular event. Use this
	instead of inline or statement handlers, because it will simply
	add the handler to the existing list, rather than overwriting it.
	
	example:
	addEvent(window, 'load', activateField, false);
	this attaches the activateField function to the window load event.
	
*/
function addEvent( elm, evType, fn, useCapture)
{
	if (elm.addEventListener)
	{
		elm.addEventListener(evType, fn, useCapture);
		return true;
	}
	else if (elm.attachEvent) {
		var r = elm.attachEvent('on' + evType, fn);
		return r
	}
	else
	{
		elm['on' + evType] = fn;
		return false;
	}
}
