Code to allow panes to stack off the right or left side of the screen