There is such a condition for sound reproduction when changing the picture:
if ((id == 100) && (type == 'off') && (arrSound['v1'] != 1)) { ion.sound.play('off'); arrSound['v1'] = 1; } else if ((id == 100) && (type == 'on') && (arrSound['v1'] == 1)) { ion.sound.play('on'); arrSound['v1'] = 0; } How can you simplify this condition, or make it shorter?