// Satisfy JSLint.
/*global alert, document */

// Singleton pattern.
var MyHomePage = function () {
    //
    // Private variables
    //

    //
    // Private functions
    //

    function showStats() {
        alert('Min elevation: 646.351090879265\n' +
                'Max elevation: 775.356743279406\n' +
                'Total elevation gain: 328.476923344\n' +
                'Total elevation loss: 319.792179298');
    }

    // Return publicly accessible variables and functions.
    return {
        //
        // Public variables
        //

        //
        // Public functions
        // (These access private variables and functions through "closure".)
        //

        init: function () {
            // Hook up elevation show stats button click listener.
            var elt = document.getElementById('elevationStats');
            elt.onclick = showStats;
        }
    };
}();
// End singleton pattern.

// Run this script.
MyHomePage.init();

