Creating a simple Javascript thermostat