Added some more code from https://github.com/mauricelam/DockToRight to fix issue with resources tab when not docked and add in some more goodness (see comments in the file).