﻿function shutdownPage() {
    //alert('Start of shutdownPage in initializePage.js');
    if (window.addEventListener) // W3C standard approach
    {
        window.detachEvent('load', initializePage, false); // Note that this event name is 'load' not 'onload'
    }
    else if (window.attachEvent) // Microsoft approach
    {
        window.detachEvent('onload', initializePage);
    }
    //alert('End of shutdownPage in initializePage.js');
    return true;
}


function installListeners() {
    //alert('Start of installListeners in initializePage.js');

    if (window.addEventListener) // W3C standard approach
    {    
        window.addEventListener('load', initializePage, false); // Note that this event name is 'load' not 'onload'
        window.addEventListener('unload', shutdownPage, false); // Note that this event name is 'unload' not 'onunload'
        return true;
    }
    else if (window.attachEvent) // Microsoft approach
    {
        return window.attachEvent('onload', initializePage);
        window.detachEvent('onunload', shutdownPage);
    }
    //alert('End of installListeners in initializePage.js');

}


