function addEvent(object, event, func) {
	if(typeof object[event] != "function"){
		object[event] = func;
	} else {
		var funcOld = object[event];
		object[event] = function(){
			var returnOld = funcOld.call(object); // Need to store these in variables as && will not evaluate the second expression if the first is false
			var returnNew = func.call(object); 
			return returnOld && returnNew;// Need to return a boolean for events such as onclick
		}
	}
}

function addLoadEvent(func) {
	addEvent(window, "onload", func)
}

function addDomLoadEvent(func)
{
	if (document.addEventListener && !/WebKit/i.test(navigator.userAgent))
	{
		document.addEventListener("DOMContentLoaded", func, false);
	}
	else
	{
		addLoadEvent(func);
	}
}