// JavaScript Document
	
/***********************************************/
/* function    addLoadListener                 */
/*                                             */
/*             based on addLoadListener() by   */
/*             james edwards and cameron davis */
/*                                             */
/*             replaces the window object's    */
/*             load event handler in order to  */
/*             enable multiple instances of    */
/*             load events without conflicting */
/*             with other handlers             */
/*                                             */
/* called by   statement                       */
/*             ie addLoadListner( firstFn );   */
/*                addLoadListner( secondFn );  */
/*                addLoadListner( infiniteFn ) ;*/
/*                                             */
/* parameters:                                 */
/*   fn        function to load                */
/*                                             */
/* globals     -none-                          */
/*                                             */
/* locals      oldfn - function in load event  */		
/*                                             */
/* calls:      load events                     */
/***********************************************/

function addLoadListener( fn ) {
	/* check for w3c standard event listenter */
	if ( typeof window.addEventListener != 'undefined' ) {
		window.addEventListener( 'load', fn, false );
	}
	
	/* check for opera's use of document object */
	else if ( typeof document.addEventListener != 'undefined' ) {
		document.addEventListener( 'load', fn, false );
	}
	
	/* check for ie proprietary non-compliant event listener */
	else if ( typeof window.attachEvent != 'undefined' ) {
		window.attachEvent( 'onload', fn );
	}
	
	/* if antiquated, create anonymous function for chaining events */
	else {
		var oldfn = window.onload;
		if ( typeof window.onload != 'function' ) {
			window.onload = fn;
		}
		else {
			window.onload = function() {
				oldfn();
				fn();
			};
		}
	}
}
