var lastField = null;
var currentFillColor = '';   // ???
var changeCounter = 0;       // ???

function setField(element) {
    // element contains the current html element
    if (element.style.backgroundColor !== currentFillColor) {
        element.style.backgroundColor = currentFillColor;
    } else {
        element.style.backgroundColor = '#eee';
    }
}

function setFillColor(color) {
    // color should be a string
    currentFillColor = color;
}

var lastField = null;
var currentFillColor = '';   // ???
var changeCounter = 0;       // ???

function setField(element) {
    // element contains the current html element
    if (element.style.backgroundColor !== currentFillColor) {
        element.style.backgroundColor = currentFillColor;
    } else {
        element.style.backgroundColor = '#eee';
    }
}

function setFillColor(color) {
    // color should be a string
    currentFillColor = color;
    var logEntry = document.createElement('p');
    logEntry.appendChild(document.createTextNode('Color changed'));
    logEntry.style.color = currentFillColor;
    document.getElementById('Log').appendChild(logEntry);
}

Implement tut2 step 4