code from https://github.com/dropbox/dropbox-js/tree/master/samples/checkbox.js