This would write an object to the page that you can use to reference any element and set states or options.
It would also wrap the artboard navigation and scalling code into the application object.
As a developer you could use this object to add event listeners, get references to elements, change states or pages, set options and so on.
It would be something like this:
<script>
var application = {};
// creating references to relevant elements
application.totalSales = document.getElementById("TotalSales");
application.netSales = document.getElementById("Net_Sales");
application.getDataButton = document.getElementById("Get_Data_Button");
// change state support
application.artboards = ["Artboard1", "Artboard2", "Artboard3"];
application.setState = function(name) {
application.showState(name)
};
// create global reference
window.application = application;
// dispatching event to notify event listeners
window.dispatchEvent("applicationComplete");
</script>