Can someone explain the addLoadEvent by Simon Willison? I read over the explanation at http://simonwillison.net/2004/May/26/addLoadEvent/ 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(); }?

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