/* installed file=/include/addLoadEvent.js
 *
 *	Copyright © 2010 by FKE Internet.  All rights reserved.
 *
 *	$Id: /include/addLoadEvent.js,v $
 */
/**
*	Function used for chaining window onload event handlers
*
*	Derived from code written by Simon Willison described on
*		http://www.webreference.com/programming/javascript/onloads/
*
*	Author:			Fred Koschara
*	Creation Date:	July twenty-ninth, 2010
*	Last Modified:	July 29, 2010 @ 10:34 pm
*
*	Revision History:
*	   Date		  by		Description
*	2010/07/29	wfredk	original development
*/

/**
* If window.onload has not already been assigned a function, the
* function passed to addLoadEvent is simply assigned to window.onload.
* If window.onload has already been set, a brand new function is
* created which first calls the original onload handler, then calls
* the new handler afterwards.
*
*/
function addLoadEvent(func)
{
	var oldonload=window.onload;
	if (typeof window.onload!='function')
		window.onload=func;
	else
	{
		window.onload=function()
		{
			oldonload();
			func();
		}
	}
}
//
// EOF: addLoadEvent.js
