function addLoadListener(fn){
    /*
     * AUTHOR: http://www.sitepoint.com/article/javascript-from-scratch/2
     * LAST MODIFIED: Mon Jun 30 2008 10:34:12 GMT-0500 (CDT)
     * PURPOSE: this function will allow us to assign any number of onload event
     * handlers, without any of them conflicting with other handlers.
     * INPUT: the name of the function to run.
     * OUTPUT: none.
     * RESTRICTIONS: none.
     */
    try {
        if (typeof window.addEventListener != 'undefined') {
            window.addEventListener('load', fn, false);
        } // end if
        else {
            if (typeof document.addEventListener != 'undefined') {
                document.addEventListener('load', fn, false);
            } // end else if
            else {
                if (typeof window.attachEvent != 'undefined') {
                    window.attachEvent('onload', fn);
                } // end else if
                else {
                    var oldfn = window.onload;
                    if (typeof window.onload != 'function') {
                        window.onload = fn;
                    } // end if
                    else {
                        window.onload = function(){
                            oldfn();
                            fn();
                        }; // end function
                    } // end else
                } // end else
            } // end else
        } // end else
    } // end try
    catch (e) {
        alert("Error in function addLoadListener:\n" + e);
    } // end catch
} // end addLoadListener
