Wrap fullscreen control in var 'fullscreenControl'
Refactor js code

Use local variables consistently, switch to better function syntax