Thermostat in JScript