{ IMG_SELECTED_ALPHAMASK,   "graphics.IMG_SELECTED_ALPHAMASK" },
   { IMG_TAB_SEL,              "graphics.IMG_TAB_SEL" },
   { IMG_TAB_SEL_L,            "graphics.IMG_TAB_SEL_L" },
+  { IMG_TAB_SEL_R,            "graphics.IMG_TAB_SEL_R" },
   { IMG_TAB_UNSEL,            "graphics.IMG_TAB_UNSEL" },
   { IMG_TAB_UNSEL_L,          "graphics.IMG_TAB_UNSEL_L" },
+  { IMG_TAB_UNSEL_R,          "graphics.IMG_TAB_UNSEL_R" },
   { IMG_TAB_LINE,             "graphics.IMG_TAB_LINE" },
   { IMG_TAB_LINEL,            "graphics.IMG_TAB_LINEL" },
   { IMG_TAB_LINER,            "graphics.IMG_TAB_LINER" },
          s = g_imagecache [ IMG_TAB_UNSEL_L ].i;
        }
 
+      } else if ( col == maxtab - 1 ) {
+       // rightmost tab, special case
+
+       if ( col == ui_category ) {
+         s = g_imagecache [ IMG_TAB_SEL_R ].i;
+       } else {
+         s = g_imagecache [ IMG_TAB_UNSEL_R ].i;
+       }
+
       } else {
        // normal (not leftmost) tab
 
 
 IMG_DETAIL_BG            detailpanebg.png
 IMG_SELECTED_ALPHAMASK   select.png
 IMG_SELECTED_HILITE     hilite.png
-IMG_TAB_SEL              tab_sel_tall.png      # tab to be used, when not far left
+IMG_TAB_SEL              tab_sel_tall.png      # tab to be used, when not far left/right
 IMG_TAB_SEL_L            tab_sel_tall.png      # tab to be used for far left tab, selected
-IMG_TAB_UNSEL            tab_unsel.png         # tab to be used when not far left
+IMG_TAB_SEL_R            tab_sel_tall.png      # tab to be used for far right tab, selected
+IMG_TAB_UNSEL            tab_unsel.png         # tab to be used when not far left/right
 IMG_TAB_UNSEL_L          tab_unsel.png # tab to be used for far left tab, unselected
+IMG_TAB_UNSEL_R          tab_unsel.png # tab to be used for far right tab, unselected
 IMG_TAB_LINE            tabline.png    # line under the unselected tab, but not left/right corners
 IMG_TAB_LINEL           tablinel.png   # line under unselected tab on far left
 IMG_TAB_LINER           tabliner.png   # line under unselected tab on far right