function onLoad() {
    if (!buttonStartStuff)       buttonStartStuff       = document.getElementById("button-start-stuff")
    if (!buttonClearOutput)      buttonClearOutput      = document.getElementById("button-clear-output")
    if (!outputElement)          outputElement          = document.getElementById("output")

    buttonStartStuff.addEventListener("click", function() {
        lastClickTime = new Date().toString()
        if (db) db.transaction(addClick)

        openTheOtherDatabase()

        if (!started) {
            buttonStartStuff.value = "stop stuff"
            startStuff()
        }
        else {
            buttonStartStuff.value = "start stuff"
            stopStuff()
        }
        started = !started
    })

    buttonClearOutput.addEventListener("click", function() {
        outputElement.innerHTML = ""
    })

    openTheDatabase()
}
function onLoad() {
    if (!buttonStartStuff)       buttonStartStuff       = document.getElementById("button-start-stuff")
    if (!buttonClearOutput)      buttonClearOutput      = document.getElementById("button-clear-output")
    if (!outputElement)          outputElement          = document.getElementById("output")

    buttonStartStuff.addEventListener("click", function() {
        lastClickTime = new Date().toString()
        if (db) db.transaction(addClick)

        openTheOtherDatabase()

        if (!started) {
            buttonStartStuff.value = "stop stuff"
            startStuff()
        }
        else {
            buttonStartStuff.value = "start stuff"
            stopStuff()
        }
        started = !started
    })

    buttonClearOutput.addEventListener("click", function() {
        outputElement.innerHTML = ""
    })

    openTheDatabase()
}
function onLoad ( ) { if ( ! buttonStartStuff ) buttonStartStuff = document . getElementById ( "button-start-stuff" ) if ( ! buttonClearOutput ) buttonClearOutput = document . getElementById ( "button-clear-output" ) if ( ! outputElement ) outputElement = document . getElementById ( "output" ) buttonStartStuff . addEventListener ( "click" , function ( ) { lastClickTime = new Date ( ) . toString ( ) if ( db ) db . transaction ( addClick ) openTheOtherDatabase ( ) if ( ! started ) { buttonStartStuff . value = "stop stuff" startStuff ( ) } else { buttonStartStuff . value = "start stuff" stopStuff ( ) } started = ! started } ) buttonClearOutput . addEventListener ( "click" , function ( ) { outputElement . innerHTML = "" } ) openTheDatabase ( ) }
------------------------------------------------------------------------------
------------------------------------------------------------------------------
onLoad - Loads the database