addLoadEvent explanation

Can someone explain the addLoadEvent by Simon Willison? I read over the explanation at but didn’t really get it.

A line by line explanation would be helpful.

What is the purpose of var oldonload = window.onload; Why do I need test typeof window.onload? Isn’t it always a function?

What is if(oldonload){ oldonload(); }?

function addLoadEvent(func){
	var oldonload = window.onload;  
	if (typeof window.onload != 'function'){
		window.onload = func; 
	} else {
		window.onload = function(){