Changes to javascript to facilitate using with CheckboxSetField