Javascript practise - building a thermostat interface