Change unfullscreen to dblclick, move fullscreen code to function