Implements Apple's UISwitch in Javascript