/**
 *	@author:	Danny Ng (http://www.dannytalk.com)
 *	@date:		01/09/08
 *	@notes:		Free to use and distribute without altering this notice. Would appreciate a link back.
 */
 
/**
 *	@pre-condition: object must support events
 *	@usage: object.addEvent(event_type, function)
 *	@params: string, function
 */
function addEvent(e, func)
{
	var old_event = this[e];
	if (old_event)
	{
		this[e] = function(e) {
			old_event();
			func();
		};
	}
	else
		this[e] = func();
}
