tidy up js: widget1 is now a global variable