/****************************************************************************
 * NCSA Mosaic for the X Window System                                      *
 * Software Development Group                                               *
 * National Center for Supercomputing Applications                          *
 * University of Illinois at Urbana-Champaign                               *
 * 605 E. Springfield, Champaign IL 61820                                   *
 * mosaic@ncsa.uiuc.edu                                                     *
 *                                                                          *
 * Copyright (C) 1993, Board of Trustees of the University of Illinois      *
 *                                                                          *
 * NCSA Mosaic software, both binary and source (hereafter, Software) is    *
 * copyrighted by The Board of Trustees of the University of Illinois       *
 * (UI), and ownership remains with the UI.                                 *
 *                                                                          *
 * The UI grants you (hereafter, Licensee) a license to use the Software    *
 * for academic, research and internal business purposes only, without a    *
 * fee.  Licensee may distribute the binary and source code (if released)   *
 * to third parties provided that the copyright notice and this statement   *
 * appears on all copies and that no charge is associated with such         *
 * copies.                                                                  *
 *                                                                          *
 * Licensee may make derivative works.  However, if Licensee distributes    *
 * any derivative work based on or derived from the Software, then          *
 * Licensee will (1) notify NCSA regarding its distribution of the          *
 * derivative work, and (2) clearly notify users that such derivative       *
 * work is a modified version and not the original NCSA Mosaic              *
 * distributed by the UI.                                                   *
 *                                                                          *
 * Any Licensee wishing to make commercial use of the Software should       *
 * contact the UI, c/o NCSA, to negotiate an appropriate license for such   *
 * commercial use.  Commercial use includes (1) integration of all or       *
 * part of the source code into a product for sale or license by or on      *
 * behalf of Licensee to third parties, or (2) distribution of the binary   *
 * code or source code to third parties that need it to utilize a           *
 * commercial product sold or licensed by or on behalf of Licensee.         *
 *                                                                          *
 * UI MAKES NO REPRESENTATIONS ABOUT THE SUITABILITY OF THIS SOFTWARE FOR   *
 * ANY PURPOSE.  IT IS PROVIDED "AS IS" WITHOUT EXPRESS OR IMPLIED          *
 * WARRANTY.  THE UI SHALL NOT BE LIABLE FOR ANY DAMAGES SUFFERED BY THE    *
 * USERS OF THIS SOFTWARE.                                                  *
 *                                                                          *
 * By using or copying this Software, Licensee agrees to abide by the       *
 * copyright law and all other applicable laws of the U.S. including, but   *
 * not limited to, export control laws, and the terms of this license.      *
 * UI shall have the right to terminate this license immediately by         *
 * written notice upon Licensee's breach of, or non-compliance with, any    *
 * of its terms.  Licensee may be held legally responsible for any          *
 * copyright infringement that is caused or encouraged by Licensee's        *
 * failure to abide by the terms of this license.                           *
 *                                                                          *
 * Comments and questions are welcome and can be sent to                    *
 * mosaic-x@ncsa.uiuc.edu.                                                  *
 ****************************************************************************/

#include "mosaic.h"
#include "libhtmlw/HTML.h"
#include <sys/types.h>
#include <sys/stat.h>

extern char *home_document;
extern Widget toplevel;
extern char do_comment;
static Widget exitbox = NULL;

#define MAX_DOCUMENTS_MENU_ITEMS 120
#define DOCUMENTS_MENU_COUNT_OFFSET 5000
#ifdef DOCMENU_EXTENDER
#define EX_DOCUMENTS_MENU_COUNT_OFFSET 7000
#endif /* DOCMENU_EXTENDER */
/* List of URL's matching items in documents menu. */
static char *urllist[MAX_DOCUMENTS_MENU_ITEMS];

#ifdef L10N

/* ------------------------- font cache table ------------------------- */
#define FONT_CACHE_TABLE_SIZE 200

typedef struct font_cache_entry
{
  char *fontname;
  XFontStruct *fontstruct;
} font_cache_entry;

typedef struct font_cache
{
  int count;
  font_cache_entry table[FONT_CACHE_TABLE_SIZE];
} font_cache;

static font_cache	font_cache_table;

InitFontCache()
{
  int i;

  font_cache_table.count = 0;
  for (i=0; i<FONT_CACHE_TABLE_SIZE; i++) {
    font_cache_table.table[i].fontname = (char *)NULL;
    font_cache_table.table[i].fontstruct = (XFontStruct *)NULL;
  }
}

static XFontStruct *
CachedLoadQueryFont(Display *dpy, char *name)
{
  int i;

  for (i=0; i<font_cache_table.count; i++) {
    if (!strcmp(name, font_cache_table.table[i].fontname)) {
      return(font_cache_table.table[i].fontstruct);
    }
  }
  /* not found */
  if (font_cache_table.count++ >= FONT_CACHE_TABLE_SIZE) {
    fprintf(stderr, "Font Cache Overflow\n");
    mo_exit();
  }
  font_cache_table.table[i].fontname = name;
#ifdef IXIMOTIF1_2
  if (strchr(name, ':') != NULL) {
    int n;
    char *p, **q, *fs = strdup(name);
    XFontSet fontset;
    for (p = fs; *p && (p = strchr(p, ';')) != NULL; p++) *p = ',';
    if ((p = strchr(fs, ':')) != NULL) *p = '\0';
    if ((fontset = XCreateFontSet(dpy, fs, &q, &n, NULL)) == NULL)
      fprintf(stderr, "FontSet \"%s\" Can not Create.\n", name);
    while (n > 0) fprintf(stderr,
			  "XCreateFontSet: missing charset \"%s\".\n", q[--n]);
    free(fs);
    return(font_cache_table.table[i].fontstruct = (XFontStruct *)fontset);
  }
  else
#endif /* IXIMOTIF1_2 */
  return(font_cache_table.table[i].fontstruct = XLoadQueryFont(dpy, name));
}

CloseFontCache()
{
  int i;

  for (i=0; i<font_cache_table.count; i++) {
    if (font_cache_table.table[i].fontstruct != (XFontStruct *)NULL) {
#ifdef IXIMOTIF1_2
      if (strchr(font_cache_table.table[i].fontname, ':') != NULL)
      XFreeFontSet(dsp, (XFontSet)font_cache_table.table[i].fontstruct);
      else
#endif /* IXIMOTIF1_2 */
      XFreeFont(dsp, font_cache_table.table[i].fontstruct);
    }
  }
}

/* ------------------------- fontset search ------------------------- */
extern char **ParseCommaList();

char *
strcasestr(char *str, char *key)
{
  char *begin;

  if ((str == NULL) || (key == NULL) || (*key == '\0'))
    return(str);

  for (begin = str; begin != NULL; begin++) {
    char *b = begin;
    char *k = key;
    while ((*b != '\0') && (*k != '\0')) {
      if (toupper(*b++) != toupper(*k++)) goto next;
    }
    if (*begin == '\0') {
      return(NULL);
    } else {
      return(begin);
    }
  next:;
  }
  return(NULL);
}

char *
GetFontName(char *fontSet, char *key)
{
  char **vlist;
  int vlist_cnt;
  int i;
  char *c;

  vlist = ParseCommaList(fontSet, &vlist_cnt);

  for (i=0; i<vlist_cnt; i++) {
    if (strcasestr(vlist[i], key) != NULL) {
      c = vlist[i];
      while ((*c != '\0') && isspace(*c)) c++;
      return(c);
    }
  }
  /* not found */
  fprintf(stderr, "%s font is not specified in the FontSet: %s\nUsing fixed (latin-1) font.\n",
         key, fontSet);
  return("fixed");
}
#endif /* L10N */

/* --------------------------- mo_post_exitbox ---------------------------- */

static XmxCallback (exit_confirm_cb)
{
  if (XmxExtractToken ((int)client_data))
    mo_exit ();
  else
    XtUnmanageChild (w);
  
  return;
}

void mo_post_exitbox (void)
{
  if (Rdata.confirm_exit)
    {
      if (exitbox == NULL)
        {
          exitbox = XmxMakeQuestionDialog
            (toplevel, "Are you sure you want to exit NCSA Mosaic?",
             "NCSA Mosaic: Exit Confirmation", exit_confirm_cb, 1, 0);
          XtManageChild (exitbox);
        }
      else
        {
          XmxManageRemanage (exitbox);
        }
    }
  else
    {
      /* Don't confirm exit; just zap it. */
      mo_exit ();
    }

  return;
}

/* -------------------- mo_set_fancy_selections_toggle -------------------- */

mo_status mo_set_fancy_selections_toggle (mo_window *win)
{
  XmxRSetToggleState (win->menubar, mo_fancy_selections,
                      win->pretty ? XmxSet : XmxNotSet);
  return mo_succeed;
}

#ifdef DISABLE_TABLE
/* -------------------- mo_set_disable_table_toggle -------------------- */

mo_status mo_set_disable_table_toggle (mo_window *win)
{
  XmxRSetToggleState (win->menubar, mo_disable_table,
                      win->disable_table ? XmxSet : XmxNotSet);
  return mo_succeed;
}
#endif /* DISABLE_TABLE */

/* ---------------------------- mo_set_fonts ---------------------------- */

static long wrapFont (char *name)
{
#ifdef L10N
  XFontStruct *font = CachedLoadQueryFont (dsp, name);
#else /* L10N */
  XFontStruct *font = XLoadQueryFont (dsp, name);
#endif /* L10N */
  if (font == NULL)
    {
      fprintf (stderr, "Could not open font '%s'\n", name);
#ifdef L10N
      font = CachedLoadQueryFont (dsp, "fixed");
#else /* L10N */
      font = XLoadQueryFont (dsp, "fixed");
#endif /* L10N */
    }
  return ((long)font);
}

mo_status mo_set_fonts (mo_window *win, int size)
{
#ifdef L10N
  mo_set_font_list(win, size);
  XmxSetArg (XmNfontList, (XtArgVal)win->font_list);
#endif /* L10N */
  switch (size)
    {
    case mo_large_fonts:
      XmxSetArg (XtNfont, wrapFont("-adobe-times-medium-r-normal-*-20-*-*-*-*-*-*-*"));
      XmxSetArg (WbNitalicFont, wrapFont("-adobe-times-medium-i-normal-*-20-*-*-*-*-*-*-*"));
      XmxSetArg (WbNboldFont, wrapFont("-adobe-times-bold-r-normal-*-20-*-*-*-*-*-*-*"));
      XmxSetArg (WbNfixedFont, wrapFont("-adobe-courier-medium-r-normal-*-20-*-*-*-*-*-*-*"));
      XmxSetArg (WbNfixedboldFont, wrapFont("-adobe-courier-bold-r-normal-*-20-*-*-*-*-*-*-*"));
      XmxSetArg (WbNfixeditalicFont, wrapFont("-adobe-courier-medium-o-normal-*-20-*-*-*-*-*-*-*"));
      XmxSetArg (WbNheader1Font, wrapFont("-adobe-times-bold-r-normal-*-25-*-*-*-*-*-*-*"));
      XmxSetArg (WbNheader2Font, wrapFont("-adobe-times-bold-r-normal-*-24-*-*-*-*-*-*-*"));
      XmxSetArg (WbNheader3Font, wrapFont("-adobe-times-bold-r-normal-*-20-*-*-*-*-*-*-*"));
      XmxSetArg (WbNheader4Font, wrapFont("-adobe-times-bold-r-normal-*-18-*-*-*-*-*-*-*"));
      XmxSetArg (WbNheader5Font, wrapFont("-adobe-times-bold-r-normal-*-17-*-*-*-*-*-*-*"));
      XmxSetArg (WbNheader6Font, wrapFont("-adobe-times-bold-r-normal-*-14-*-*-*-*-*-*-*"));
      XmxSetArg (WbNaddressFont, wrapFont("-adobe-times-medium-i-normal-*-20-*-*-*-*-*-*-*"));
      XmxSetArg (WbNplainFont, wrapFont("-adobe-courier-medium-r-normal-*-18-*-*-*-*-*-*-*"));
      XmxSetArg (WbNplainboldFont, wrapFont("-adobe-courier-bold-r-normal-*-18-*-*-*-*-*-*-*"));
      XmxSetArg (WbNplainitalicFont, wrapFont("-adobe-courier-medium-o-normal-*-18-*-*-*-*-*-*-*"));
      XmxSetArg (WbNsupSubFont, wrapFont("-adobe-times-medium-r-normal-*-14-*-*-*-*-*-*-*"));
#ifdef L10N
      XmxSetArg (WbNWCfont, wrapFont("-adobe-times-medium-r-normal-*-20-*-*-*-*-*-*-*"));
      XmxSetArg (WbNitalicWCFont, wrapFont("-adobe-times-medium-i-normal-*-20-*-*-*-*-*-*-*"));
      XmxSetArg (WbNboldWCFont, wrapFont("-adobe-times-bold-r-normal-*-20-*-*-*-*-*-*-*"));
      XmxSetArg (WbNfixedWCFont, wrapFont("-adobe-courier-medium-r-normal-*-20-*-*-*-*-*-*-*"));
      XmxSetArg (WbNfixedboldWCFont, wrapFont("-adobe-courier-bold-r-normal-*-20-*-*-*-*-*-*-*"));
      XmxSetArg (WbNfixeditalicWCFont, wrapFont("-adobe-courier-medium-o-normal-*-20-*-*-*-*-*-*-*"));
      XmxSetArg (WbNheader1WCFont, wrapFont("-adobe-times-bold-r-normal-*-25-*-*-*-*-*-*-*"));
      XmxSetArg (WbNheader2WCFont, wrapFont("-adobe-times-bold-r-normal-*-24-*-*-*-*-*-*-*"));
      XmxSetArg (WbNheader3WCFont, wrapFont("-adobe-times-bold-r-normal-*-20-*-*-*-*-*-*-*"));
      XmxSetArg (WbNheader4WCFont, wrapFont("-adobe-times-bold-r-normal-*-18-*-*-*-*-*-*-*"));
      XmxSetArg (WbNheader5WCFont, wrapFont("-adobe-times-bold-r-normal-*-17-*-*-*-*-*-*-*"));
      XmxSetArg (WbNheader6WCFont, wrapFont("-adobe-times-bold-r-normal-*-14-*-*-*-*-*-*-*"));
      XmxSetArg (WbNaddressWCFont, wrapFont("-adobe-times-medium-i-normal-*-20-*-*-*-*-*-*-*"));
      XmxSetArg (WbNplainWCFont, wrapFont("-adobe-courier-medium-r-normal-*-18-*-*-*-*-*-*-*"));
      XmxSetArg (WbNplainboldWCFont, wrapFont("-adobe-courier-bold-r-normal-*-18-*-*-*-*-*-*-*"));
      XmxSetArg (WbNplainitalicWCFont, wrapFont("-adobe-courier-medium-o-normal-*-18-*-*-*-*-*-*-*"));
      XmxSetArg (WbNsupSubWCFont, wrapFont("-adobe-times-medium-r-normal-*-14-*-*-*-*-*-*-*"));
      XmxSetArg (WbNcharsetInfo, CS_ISO_8859_1);
#endif /* L10N */

      XmxSetValues (win->scrolled_win);
      win->font_family = 0;
      break;
    case mo_regular_fonts:
      XmxSetArg (XtNfont, wrapFont("-adobe-times-medium-r-normal-*-17-*-*-*-*-*-*-*"));
      XmxSetArg (WbNitalicFont, wrapFont("-adobe-times-medium-i-normal-*-17-*-*-*-*-*-*-*"));
      XmxSetArg (WbNboldFont, wrapFont("-adobe-times-bold-r-normal-*-17-*-*-*-*-*-*-*"));
      XmxSetArg (WbNfixedFont, wrapFont("-adobe-courier-medium-r-normal-*-17-*-*-*-*-*-*-*"));
      XmxSetArg (WbNfixedboldFont, wrapFont("-adobe-courier-bold-r-normal-*-17-*-*-*-*-*-*-*"));
      XmxSetArg (WbNfixeditalicFont, wrapFont("-adobe-courier-medium-o-normal-*-17-*-*-*-*-*-*-*"));
      XmxSetArg (WbNheader1Font, wrapFont("-adobe-times-bold-r-normal-*-24-*-*-*-*-*-*-*"));
      XmxSetArg (WbNheader2Font, wrapFont("-adobe-times-bold-r-normal-*-18-*-*-*-*-*-*-*"));
      XmxSetArg (WbNheader3Font, wrapFont("-adobe-times-bold-r-normal-*-17-*-*-*-*-*-*-*"));
      XmxSetArg (WbNheader4Font, wrapFont("-adobe-times-bold-r-normal-*-14-*-*-*-*-*-*-*"));
      XmxSetArg (WbNheader5Font, wrapFont("-adobe-times-bold-r-normal-*-12-*-*-*-*-*-*-*"));
      XmxSetArg (WbNheader6Font, wrapFont("-adobe-times-bold-r-normal-*-10-*-*-*-*-*-*-*"));
      XmxSetArg (WbNaddressFont, wrapFont("-adobe-times-medium-i-normal-*-17-*-*-*-*-*-*-*"));
      XmxSetArg (WbNplainFont, wrapFont("-adobe-courier-medium-r-normal-*-14-*-*-*-*-*-*-*"));
      XmxSetArg (WbNplainboldFont, wrapFont("-adobe-courier-bold-r-normal-*-14-*-*-*-*-*-*-*"));
      XmxSetArg (WbNplainitalicFont, wrapFont("-adobe-courier-medium-o-normal-*-14-*-*-*-*-*-*-*"));
      XmxSetArg (WbNsupSubFont, wrapFont("-adobe-times-medium-r-normal-*-10-*-*-*-*-*-*-*"));
#ifdef L10N
      XmxSetArg (WbNWCfont, wrapFont("-adobe-times-medium-r-normal-*-17-*-*-*-*-*-*-*"));
      XmxSetArg (WbNitalicWCFont, wrapFont("-adobe-times-medium-i-normal-*-17-*-*-*-*-*-*-*"));
      XmxSetArg (WbNboldWCFont, wrapFont("-adobe-times-bold-r-normal-*-17-*-*-*-*-*-*-*"));
      XmxSetArg (WbNfixedWCFont, wrapFont("-adobe-courier-medium-r-normal-*-17-*-*-*-*-*-*-*"));
      XmxSetArg (WbNfixedboldWCFont, wrapFont("-adobe-courier-bold-r-normal-*-17-*-*-*-*-*-*-*"));
      XmxSetArg (WbNfixeditalicWCFont, wrapFont("-adobe-courier-medium-o-normal-*-17-*-*-*-*-*-*-*"));
      XmxSetArg (WbNheader1WCFont, wrapFont("-adobe-times-bold-r-normal-*-24-*-*-*-*-*-*-*"));
      XmxSetArg (WbNheader2WCFont, wrapFont("-adobe-times-bold-r-normal-*-18-*-*-*-*-*-*-*"));
      XmxSetArg (WbNheader3WCFont, wrapFont("-adobe-times-bold-r-normal-*-17-*-*-*-*-*-*-*"));
      XmxSetArg (WbNheader4WCFont, wrapFont("-adobe-times-bold-r-normal-*-14-*-*-*-*-*-*-*"));
      XmxSetArg (WbNheader5WCFont, wrapFont("-adobe-times-bold-r-normal-*-12-*-*-*-*-*-*-*"));
      XmxSetArg (WbNheader6WCFont, wrapFont("-adobe-times-bold-r-normal-*-10-*-*-*-*-*-*-*"));
      XmxSetArg (WbNaddressWCFont, wrapFont("-adobe-times-medium-i-normal-*-17-*-*-*-*-*-*-*"));
      XmxSetArg (WbNplainWCFont, wrapFont("-adobe-courier-medium-r-normal-*-14-*-*-*-*-*-*-*"));
      XmxSetArg (WbNplainboldWCFont, wrapFont("-adobe-courier-bold-r-normal-*-14-*-*-*-*-*-*-*"));
      XmxSetArg (WbNplainitalicWCFont, wrapFont("-adobe-courier-medium-o-normal-*-14-*-*-*-*-*-*-*"));
      XmxSetArg (WbNsupSubWCFont, wrapFont("-adobe-times-medium-r-normal-*-10-*-*-*-*-*-*-*"));
      XmxSetArg (WbNcharsetInfo, CS_ISO_8859_1);
#endif /* L10N */
      XmxSetValues (win->scrolled_win);
      win->font_family = 0;
      break;
    case mo_small_fonts:
      XmxSetArg (XtNfont, wrapFont("-adobe-times-medium-r-normal-*-14-*-*-*-*-*-*-*"));
      XmxSetArg (WbNitalicFont, wrapFont("-adobe-times-medium-i-normal-*-14-*-*-*-*-*-*-*"));
      XmxSetArg (WbNboldFont, wrapFont("-adobe-times-bold-r-normal-*-14-*-*-*-*-*-*-*"));
      XmxSetArg (WbNfixedFont, wrapFont("-adobe-courier-medium-r-normal-*-14-*-*-*-*-*-*-*"));
      XmxSetArg (WbNfixedboldFont, wrapFont("-adobe-courier-bold-r-normal-*-14-*-*-*-*-*-*-*"));
      XmxSetArg (WbNfixeditalicFont, wrapFont("-adobe-courier-medium-o-normal-*-14-*-*-*-*-*-*-*"));
      XmxSetArg (WbNheader1Font, wrapFont("-adobe-times-bold-r-normal-*-18-*-*-*-*-*-*-*"));
      XmxSetArg (WbNheader2Font, wrapFont("-adobe-times-bold-r-normal-*-17-*-*-*-*-*-*-*"));
      XmxSetArg (WbNheader3Font, wrapFont("-adobe-times-bold-r-normal-*-14-*-*-*-*-*-*-*"));
      XmxSetArg (WbNheader4Font, wrapFont("-adobe-times-bold-r-normal-*-12-*-*-*-*-*-*-*"));
      XmxSetArg (WbNheader5Font, wrapFont("-adobe-times-bold-r-normal-*-10-*-*-*-*-*-*-*"));
      XmxSetArg (WbNheader6Font, wrapFont("-adobe-times-bold-r-normal-*-8-*-*-*-*-*-*-*"));
      XmxSetArg (WbNaddressFont, wrapFont("-adobe-times-medium-i-normal-*-14-*-*-*-*-*-*-*"));
      XmxSetArg (WbNplainFont, wrapFont("-adobe-courier-medium-r-normal-*-12-*-*-*-*-*-*-*"));
      XmxSetArg (WbNplainboldFont, wrapFont("-adobe-courier-bold-r-normal-*-12-*-*-*-*-*-*-*"));
      XmxSetArg (WbNplainitalicFont, wrapFont("-adobe-courier-medium-o-normal-*-12-*-*-*-*-*-*-*"));
      XmxSetArg (WbNsupSubFont, wrapFont("-adobe-times-medium-r-normal-*-8-*-*-*-*-*-*-*"));
#ifdef L10N
      XmxSetArg (WbNWCfont, wrapFont("-adobe-times-medium-r-normal-*-14-*-*-*-*-*-*-*"));
      XmxSetArg (WbNitalicWCFont, wrapFont("-adobe-times-medium-i-normal-*-14-*-*-*-*-*-*-*"));
      XmxSetArg (WbNboldWCFont, wrapFont("-adobe-times-bold-r-normal-*-14-*-*-*-*-*-*-*"));
      XmxSetArg (WbNfixedWCFont, wrapFont("-adobe-courier-medium-r-normal-*-14-*-*-*-*-*-*-*"));
      XmxSetArg (WbNfixedboldWCFont, wrapFont("-adobe-courier-bold-r-normal-*-14-*-*-*-*-*-*-*"));
      XmxSetArg (WbNfixeditalicWCFont, wrapFont("-adobe-courier-medium-o-normal-*-14-*-*-*-*-*-*-*"));
      XmxSetArg (WbNheader1WCFont, wrapFont("-adobe-times-bold-r-normal-*-18-*-*-*-*-*-*-*"));
      XmxSetArg (WbNheader2WCFont, wrapFont("-adobe-times-bold-r-normal-*-17-*-*-*-*-*-*-*"));
      XmxSetArg (WbNheader3WCFont, wrapFont("-adobe-times-bold-r-normal-*-14-*-*-*-*-*-*-*"));
      XmxSetArg (WbNheader4WCFont, wrapFont("-adobe-times-bold-r-normal-*-12-*-*-*-*-*-*-*"));
      XmxSetArg (WbNheader5WCFont, wrapFont("-adobe-times-bold-r-normal-*-10-*-*-*-*-*-*-*"));
      XmxSetArg (WbNheader6WCFont, wrapFont("-adobe-times-bold-r-normal-*-8-*-*-*-*-*-*-*"));
      XmxSetArg (WbNaddressWCFont, wrapFont("-adobe-times-medium-i-normal-*-14-*-*-*-*-*-*-*"));
      XmxSetArg (WbNplainWCFont, wrapFont("-adobe-courier-medium-r-normal-*-12-*-*-*-*-*-*-*"));
      XmxSetArg (WbNplainboldWCFont, wrapFont("-adobe-courier-bold-r-normal-*-12-*-*-*-*-*-*-*"));
      XmxSetArg (WbNplainitalicWCFont, wrapFont("-adobe-courier-medium-o-normal-*-12-*-*-*-*-*-*-*"));
      XmxSetArg (WbNsupSubWCFont, wrapFont("-adobe-times-medium-r-normal-*-8-*-*-*-*-*-*-*"));
      XmxSetArg (WbNcharsetInfo, CS_ISO_8859_1);
#endif /* L10N */

      XmxSetValues (win->scrolled_win);
      win->font_family = 0;
      break;
    case mo_large_helvetica:
      XmxSetArg (XtNfont, wrapFont("-adobe-helvetica-medium-r-normal-*-20-*-*-*-*-*-*-*"));
      XmxSetArg (WbNitalicFont, wrapFont("-adobe-helvetica-medium-o-normal-*-20-*-*-*-*-*-*-*"));
      XmxSetArg (WbNboldFont, wrapFont("-adobe-helvetica-bold-r-normal-*-20-*-*-*-*-*-*-*"));
      XmxSetArg (WbNfixedFont, wrapFont("-adobe-courier-medium-r-normal-*-20-*-*-*-*-*-*-*"));
      XmxSetArg (WbNfixedboldFont, wrapFont("-adobe-courier-bold-r-normal-*-20-*-*-*-*-*-*-*"));
      XmxSetArg (WbNfixeditalicFont, wrapFont("-adobe-courier-medium-o-normal-*-20-*-*-*-*-*-*-*"));
      XmxSetArg (WbNheader1Font, wrapFont("-adobe-helvetica-bold-r-normal-*-25-*-*-*-*-*-*-*"));
      XmxSetArg (WbNheader2Font, wrapFont("-adobe-helvetica-bold-r-normal-*-24-*-*-*-*-*-*-*"));
      XmxSetArg (WbNheader3Font, wrapFont("-adobe-helvetica-bold-r-normal-*-20-*-*-*-*-*-*-*"));
      XmxSetArg (WbNheader4Font, wrapFont("-adobe-helvetica-bold-r-normal-*-18-*-*-*-*-*-*-*"));
      XmxSetArg (WbNheader5Font, wrapFont("-adobe-helvetica-bold-r-normal-*-17-*-*-*-*-*-*-*"));
      XmxSetArg (WbNheader6Font, wrapFont("-adobe-helvetica-bold-r-normal-*-14-*-*-*-*-*-*-*"));
      XmxSetArg (WbNaddressFont, wrapFont("-adobe-helvetica-medium-o-normal-*-20-*-*-*-*-*-*-*"));
      XmxSetArg (WbNplainFont, wrapFont("-adobe-courier-medium-r-normal-*-18-*-*-*-*-*-*-*"));
      XmxSetArg (WbNplainboldFont, wrapFont("-adobe-courier-bold-r-normal-*-18-*-*-*-*-*-*-*"));
      XmxSetArg (WbNplainitalicFont, wrapFont("-adobe-courier-medium-o-normal-*-18-*-*-*-*-*-*-*"));
      XmxSetArg (WbNsupSubFont, wrapFont("-adobe-helvetica-medium-r-normal-*-14-*-*-*-*-*-*-*"));
#ifdef L10N
      XmxSetArg (WbNWCfont, wrapFont("-adobe-helvetica-medium-r-normal-*-20-*-*-*-*-*-*-*"));
      XmxSetArg (WbNitalicWCFont, wrapFont("-adobe-helvetica-medium-o-normal-*-20-*-*-*-*-*-*-*"));
      XmxSetArg (WbNboldWCFont, wrapFont("-adobe-helvetica-bold-r-normal-*-20-*-*-*-*-*-*-*"));
      XmxSetArg (WbNfixedWCFont, wrapFont("-adobe-courier-medium-r-normal-*-20-*-*-*-*-*-*-*"));
      XmxSetArg (WbNfixedboldWCFont, wrapFont("-adobe-courier-bold-r-normal-*-20-*-*-*-*-*-*-*"));
      XmxSetArg (WbNfixeditalicWCFont, wrapFont("-adobe-courier-medium-o-normal-*-20-*-*-*-*-*-*-*"));
      XmxSetArg (WbNheader1WCFont, wrapFont("-adobe-helvetica-bold-r-normal-*-25-*-*-*-*-*-*-*"));
      XmxSetArg (WbNheader2WCFont, wrapFont("-adobe-helvetica-bold-r-normal-*-24-*-*-*-*-*-*-*"));
      XmxSetArg (WbNheader3WCFont, wrapFont("-adobe-helvetica-bold-r-normal-*-20-*-*-*-*-*-*-*"));
      XmxSetArg (WbNheader4WCFont, wrapFont("-adobe-helvetica-bold-r-normal-*-18-*-*-*-*-*-*-*"));
      XmxSetArg (WbNheader5WCFont, wrapFont("-adobe-helvetica-bold-r-normal-*-17-*-*-*-*-*-*-*"));
      XmxSetArg (WbNheader6WCFont, wrapFont("-adobe-helvetica-bold-r-normal-*-14-*-*-*-*-*-*-*"));
      XmxSetArg (WbNaddressWCFont, wrapFont("-adobe-helvetica-medium-o-normal-*-20-*-*-*-*-*-*-*"));
      XmxSetArg (WbNplainWCFont, wrapFont("-adobe-courier-medium-r-normal-*-18-*-*-*-*-*-*-*"));
      XmxSetArg (WbNplainboldWCFont, wrapFont("-adobe-courier-bold-r-normal-*-18-*-*-*-*-*-*-*"));
      XmxSetArg (WbNplainitalicWCFont, wrapFont("-adobe-courier-medium-o-normal-*-18-*-*-*-*-*-*-*"));
      XmxSetArg (WbNsupSubWCFont, wrapFont("-adobe-helvetica-medium-r-normal-*-14-*-*-*-*-*-*-*"));
      XmxSetArg (WbNcharsetInfo, CS_ISO_8859_1);
#endif /* L10N */
      XmxSetValues (win->scrolled_win);
      win->font_family = 1;
      break;
    case mo_regular_helvetica:
      XmxSetArg (XtNfont, wrapFont("-adobe-helvetica-medium-r-normal-*-17-*-*-*-*-*-*-*"));
      XmxSetArg (WbNitalicFont, wrapFont("-adobe-helvetica-medium-o-normal-*-17-*-*-*-*-*-*-*"));
      XmxSetArg (WbNboldFont, wrapFont("-adobe-helvetica-bold-r-normal-*-17-*-*-*-*-*-*-*"));
      XmxSetArg (WbNfixedFont, wrapFont("-adobe-courier-medium-r-normal-*-17-*-*-*-*-*-*-*"));
      XmxSetArg (WbNfixedboldFont, wrapFont("-adobe-courier-bold-r-normal-*-17-*-*-*-*-*-*-*"));
      XmxSetArg (WbNfixeditalicFont, wrapFont("-adobe-courier-medium-o-normal-*-17-*-*-*-*-*-*-*"));
      XmxSetArg (WbNheader1Font, wrapFont("-adobe-helvetica-bold-r-normal-*-24-*-*-*-*-*-*-*"));
      XmxSetArg (WbNheader2Font, wrapFont("-adobe-helvetica-bold-r-normal-*-18-*-*-*-*-*-*-*"));
      XmxSetArg (WbNheader3Font, wrapFont("-adobe-helvetica-bold-r-normal-*-17-*-*-*-*-*-*-*"));
      XmxSetArg (WbNheader4Font, wrapFont("-adobe-helvetica-bold-r-normal-*-14-*-*-*-*-*-*-*"));
      XmxSetArg (WbNheader5Font, wrapFont("-adobe-helvetica-bold-r-normal-*-12-*-*-*-*-*-*-*"));
      XmxSetArg (WbNheader6Font, wrapFont("-adobe-helvetica-bold-r-normal-*-10-*-*-*-*-*-*-*"));
      XmxSetArg (WbNaddressFont, wrapFont("-adobe-helvetica-medium-o-normal-*-17-*-*-*-*-*-*-*"));
      XmxSetArg (WbNplainFont, wrapFont("-adobe-courier-medium-r-normal-*-14-*-*-*-*-*-*-*"));
      XmxSetArg (WbNplainboldFont, wrapFont("-adobe-courier-bold-r-normal-*-14-*-*-*-*-*-*-*"));
      XmxSetArg (WbNplainitalicFont, wrapFont("-adobe-courier-medium-o-normal-*-14-*-*-*-*-*-*-*"));
      XmxSetArg (WbNsupSubFont, wrapFont("-adobe-helvetica-medium-r-normal-*-10-*-*-*-*-*-*-*"));
#ifdef L10N
      XmxSetArg (WbNWCfont, wrapFont("-adobe-helvetica-medium-r-normal-*-17-*-*-*-*-*-*-*"));
      XmxSetArg (WbNitalicWCFont, wrapFont("-adobe-helvetica-medium-o-normal-*-17-*-*-*-*-*-*-*"));
      XmxSetArg (WbNboldWCFont, wrapFont("-adobe-helvetica-bold-r-normal-*-17-*-*-*-*-*-*-*"));
      XmxSetArg (WbNfixedWCFont, wrapFont("-adobe-courier-medium-r-normal-*-17-*-*-*-*-*-*-*"));
      XmxSetArg (WbNfixedboldWCFont, wrapFont("-adobe-courier-bold-r-normal-*-17-*-*-*-*-*-*-*"));
      XmxSetArg (WbNfixeditalicWCFont, wrapFont("-adobe-courier-medium-o-normal-*-17-*-*-*-*-*-*-*"));
      XmxSetArg (WbNheader1WCFont, wrapFont("-adobe-helvetica-bold-r-normal-*-24-*-*-*-*-*-*-*"));
      XmxSetArg (WbNheader2WCFont, wrapFont("-adobe-helvetica-bold-r-normal-*-18-*-*-*-*-*-*-*"));
      XmxSetArg (WbNheader3WCFont, wrapFont("-adobe-helvetica-bold-r-normal-*-17-*-*-*-*-*-*-*"));
      XmxSetArg (WbNheader4WCFont, wrapFont("-adobe-helvetica-bold-r-normal-*-14-*-*-*-*-*-*-*"));
      XmxSetArg (WbNheader5WCFont, wrapFont("-adobe-helvetica-bold-r-normal-*-12-*-*-*-*-*-*-*"));
      XmxSetArg (WbNheader6WCFont, wrapFont("-adobe-helvetica-bold-r-normal-*-10-*-*-*-*-*-*-*"));
      XmxSetArg (WbNaddressWCFont, wrapFont("-adobe-helvetica-medium-o-normal-*-17-*-*-*-*-*-*-*"));
      XmxSetArg (WbNplainWCFont, wrapFont("-adobe-courier-medium-r-normal-*-14-*-*-*-*-*-*-*"));
      XmxSetArg (WbNplainboldWCFont, wrapFont("-adobe-courier-bold-r-normal-*-14-*-*-*-*-*-*-*"));
      XmxSetArg (WbNplainitalicWCFont, wrapFont("-adobe-courier-medium-o-normal-*-14-*-*-*-*-*-*-*"));
      XmxSetArg (WbNsupSubWCFont, wrapFont("-adobe-helvetica-medium-r-normal-*-10-*-*-*-*-*-*-*"));
      XmxSetArg (WbNcharsetInfo, CS_ISO_8859_1);
#endif /* L10N */
      XmxSetValues (win->scrolled_win);
      win->font_family = 1;
      break;
    case mo_small_helvetica:
      XmxSetArg (XtNfont, wrapFont("-adobe-helvetica-medium-r-normal-*-14-*-*-*-*-*-*-*"));
      XmxSetArg (WbNitalicFont, wrapFont("-adobe-helvetica-medium-o-normal-*-14-*-*-*-*-*-*-*"));
      XmxSetArg (WbNboldFont, wrapFont("-adobe-helvetica-bold-r-normal-*-14-*-*-*-*-*-*-*"));
      XmxSetArg (WbNfixedFont, wrapFont("-adobe-courier-medium-r-normal-*-14-*-*-*-*-*-*-*"));
      XmxSetArg (WbNfixedboldFont, wrapFont("-adobe-courier-bold-r-normal-*-14-*-*-*-*-*-*-*"));
      XmxSetArg (WbNfixeditalicFont, wrapFont("-adobe-courier-medium-o-normal-*-14-*-*-*-*-*-*-*"));
      XmxSetArg (WbNheader1Font, wrapFont("-adobe-helvetica-bold-r-normal-*-18-*-*-*-*-*-*-*"));
      XmxSetArg (WbNheader2Font, wrapFont("-adobe-helvetica-bold-r-normal-*-17-*-*-*-*-*-*-*"));
      XmxSetArg (WbNheader3Font, wrapFont("-adobe-helvetica-bold-r-normal-*-14-*-*-*-*-*-*-*"));
      XmxSetArg (WbNheader4Font, wrapFont("-adobe-helvetica-bold-r-normal-*-12-*-*-*-*-*-*-*"));
      XmxSetArg (WbNheader5Font, wrapFont("-adobe-helvetica-bold-r-normal-*-10-*-*-*-*-*-*-*"));
      XmxSetArg (WbNheader6Font, wrapFont("-adobe-helvetica-bold-r-normal-*-8-*-*-*-*-*-*-*"));
      XmxSetArg (WbNaddressFont, wrapFont("-adobe-helvetica-medium-o-normal-*-14-*-*-*-*-*-*-*"));
      XmxSetArg (WbNplainFont, wrapFont("-adobe-courier-medium-r-normal-*-12-*-*-*-*-*-*-*"));
      XmxSetArg (WbNplainboldFont, wrapFont("-adobe-courier-bold-r-normal-*-12-*-*-*-*-*-*-*"));
      XmxSetArg (WbNplainitalicFont, wrapFont("-adobe-courier-medium-o-normal-*-12-*-*-*-*-*-*-*"));
      XmxSetArg (WbNsupSubFont, wrapFont("-adobe-helvetica-medium-r-normal-*-8-*-*-*-*-*-*-*"));
#ifdef L10N
      XmxSetArg (WbNWCfont, wrapFont("-adobe-helvetica-medium-r-normal-*-14-*-*-*-*-*-*-*"));
      XmxSetArg (WbNitalicWCFont, wrapFont("-adobe-helvetica-medium-o-normal-*-14-*-*-*-*-*-*-*"));
      XmxSetArg (WbNboldWCFont, wrapFont("-adobe-helvetica-bold-r-normal-*-14-*-*-*-*-*-*-*"));
      XmxSetArg (WbNfixedWCFont, wrapFont("-adobe-courier-medium-r-normal-*-14-*-*-*-*-*-*-*"));
      XmxSetArg (WbNfixedboldWCFont, wrapFont("-adobe-courier-bold-r-normal-*-14-*-*-*-*-*-*-*"));
      XmxSetArg (WbNfixeditalicWCFont, wrapFont("-adobe-courier-medium-o-normal-*-14-*-*-*-*-*-*-*"));
      XmxSetArg (WbNheader1WCFont, wrapFont("-adobe-helvetica-bold-r-normal-*-18-*-*-*-*-*-*-*"));
      XmxSetArg (WbNheader2WCFont, wrapFont("-adobe-helvetica-bold-r-normal-*-17-*-*-*-*-*-*-*"));
      XmxSetArg (WbNheader3WCFont, wrapFont("-adobe-helvetica-bold-r-normal-*-14-*-*-*-*-*-*-*"));
      XmxSetArg (WbNheader4WCFont, wrapFont("-adobe-helvetica-bold-r-normal-*-12-*-*-*-*-*-*-*"));
      XmxSetArg (WbNheader5WCFont, wrapFont("-adobe-helvetica-bold-r-normal-*-10-*-*-*-*-*-*-*"));
      XmxSetArg (WbNheader6WCFont, wrapFont("-adobe-helvetica-bold-r-normal-*-8-*-*-*-*-*-*-*"));
      XmxSetArg (WbNaddressWCFont, wrapFont("-adobe-helvetica-medium-o-normal-*-14-*-*-*-*-*-*-*"));
      XmxSetArg (WbNplainWCFont, wrapFont("-adobe-courier-medium-r-normal-*-12-*-*-*-*-*-*-*"));
      XmxSetArg (WbNplainboldWCFont, wrapFont("-adobe-courier-bold-r-normal-*-12-*-*-*-*-*-*-*"));
      XmxSetArg (WbNplainitalicWCFont, wrapFont("-adobe-courier-medium-o-normal-*-12-*-*-*-*-*-*-*"));
      XmxSetArg (WbNsupSubWCFont, wrapFont("-adobe-helvetica-medium-r-normal-*-8-*-*-*-*-*-*-*"));
      XmxSetArg (WbNcharsetInfo, CS_ISO_8859_1);
#endif /* L10N */

      XmxSetValues (win->scrolled_win);
      win->font_family = 1;
      break;
    case mo_large_newcentury:
      XmxSetArg (XtNfont, wrapFont("-adobe-new century schoolbook-medium-r-normal-*-20-*-*-*-*-*-*-*"));
      XmxSetArg (WbNitalicFont, wrapFont("-adobe-new century schoolbook-medium-i-normal-*-20-*-*-*-*-*-*-*"));
      XmxSetArg (WbNboldFont, wrapFont("-adobe-new century schoolbook-bold-r-normal-*-20-*-*-*-*-*-*-*"));
      XmxSetArg (WbNfixedFont, wrapFont("-adobe-courier-medium-r-normal-*-20-*-*-*-*-*-*-*"));
      XmxSetArg (WbNfixedboldFont, wrapFont("-adobe-courier-bold-r-normal-*-20-*-*-*-*-*-*-*"));
      XmxSetArg (WbNfixeditalicFont, wrapFont("-adobe-courier-medium-o-normal-*-20-*-*-*-*-*-*-*"));
      XmxSetArg (WbNheader1Font, wrapFont("-adobe-new century schoolbook-bold-r-normal-*-25-*-*-*-*-*-*-*"));
      XmxSetArg (WbNheader2Font, wrapFont("-adobe-new century schoolbook-bold-r-normal-*-24-*-*-*-*-*-*-*"));
      XmxSetArg (WbNheader3Font, wrapFont("-adobe-new century schoolbook-bold-r-normal-*-20-*-*-*-*-*-*-*"));
      XmxSetArg (WbNheader4Font, wrapFont("-adobe-new century schoolbook-bold-r-normal-*-18-*-*-*-*-*-*-*"));
      XmxSetArg (WbNheader5Font, wrapFont("-adobe-new century schoolbook-bold-r-normal-*-17-*-*-*-*-*-*-*"));
      XmxSetArg (WbNheader6Font, wrapFont("-adobe-new century schoolbook-bold-r-normal-*-14-*-*-*-*-*-*-*"));
      XmxSetArg (WbNaddressFont, wrapFont("-adobe-new century schoolbook-medium-i-normal-*-20-*-*-*-*-*-*-*"));
      XmxSetArg (WbNplainFont, wrapFont("-adobe-courier-medium-r-normal-*-18-*-*-*-*-*-*-*"));
      XmxSetArg (WbNplainboldFont, wrapFont("-adobe-courier-bold-r-normal-*-18-*-*-*-*-*-*-*"));
      XmxSetArg (WbNplainitalicFont, wrapFont("-adobe-courier-medium-o-normal-*-18-*-*-*-*-*-*-*"));
      XmxSetArg (WbNsupSubFont, wrapFont("-adobe-new century schoolbook-medium-r-normal-*-14-*-*-*-*-*-*-*"));
#ifdef L10N
      XmxSetArg (WbNWCfont, wrapFont("-adobe-new century schoolbook-medium-r-normal-*-20-*-*-*-*-*-*-*"));
      XmxSetArg (WbNitalicWCFont, wrapFont("-adobe-new century schoolbook-medium-i-normal-*-20-*-*-*-*-*-*-*"));
      XmxSetArg (WbNboldWCFont, wrapFont("-adobe-new century schoolbook-bold-r-normal-*-20-*-*-*-*-*-*-*"));
      XmxSetArg (WbNfixedWCFont, wrapFont("-adobe-courier-medium-r-normal-*-20-*-*-*-*-*-*-*"));
      XmxSetArg (WbNfixedboldWCFont, wrapFont("-adobe-courier-bold-r-normal-*-20-*-*-*-*-*-*-*"));
      XmxSetArg (WbNfixeditalicWCFont, wrapFont("-adobe-courier-medium-o-normal-*-20-*-*-*-*-*-*-*"));
      XmxSetArg (WbNheader1WCFont, wrapFont("-adobe-new century schoolbook-bold-r-normal-*-25-*-*-*-*-*-*-*"));
      XmxSetArg (WbNheader2WCFont, wrapFont("-adobe-new century schoolbook-bold-r-normal-*-24-*-*-*-*-*-*-*"));
      XmxSetArg (WbNheader3WCFont, wrapFont("-adobe-new century schoolbook-bold-r-normal-*-20-*-*-*-*-*-*-*"));
      XmxSetArg (WbNheader4WCFont, wrapFont("-adobe-new century schoolbook-bold-r-normal-*-18-*-*-*-*-*-*-*"));
      XmxSetArg (WbNheader5WCFont, wrapFont("-adobe-new century schoolbook-bold-r-normal-*-17-*-*-*-*-*-*-*"));
      XmxSetArg (WbNheader6WCFont, wrapFont("-adobe-new century schoolbook-bold-r-normal-*-14-*-*-*-*-*-*-*"));
      XmxSetArg (WbNaddressWCFont, wrapFont("-adobe-new century schoolbook-medium-i-normal-*-20-*-*-*-*-*-*-*"));
      XmxSetArg (WbNplainWCFont, wrapFont("-adobe-courier-medium-r-normal-*-18-*-*-*-*-*-*-*"));
      XmxSetArg (WbNplainboldWCFont, wrapFont("-adobe-courier-bold-r-normal-*-18-*-*-*-*-*-*-*"));
      XmxSetArg (WbNplainitalicWCFont, wrapFont("-adobe-courier-medium-o-normal-*-18-*-*-*-*-*-*-*"));
      XmxSetArg (WbNsupSubWCFont, wrapFont("-adobe-new century schoolbook-medium-r-normal-*-14-*-*-*-*-*-*-*"));
      XmxSetArg (WbNcharsetInfo, CS_ISO_8859_1);
#endif /* L10N */
      XmxSetValues (win->scrolled_win);
      win->font_family = 2;
      break;
    case mo_small_newcentury:
      XmxSetArg (XtNfont, wrapFont("-adobe-new century schoolbook-medium-r-normal-*-14-*-*-*-*-*-*-*"));
      XmxSetArg (WbNitalicFont, wrapFont("-adobe-new century schoolbook-medium-i-normal-*-14-*-*-*-*-*-*-*"));
      XmxSetArg (WbNboldFont, wrapFont("-adobe-new century schoolbook-bold-r-normal-*-14-*-*-*-*-*-*-*"));
      XmxSetArg (WbNfixedFont, wrapFont("-adobe-courier-medium-r-normal-*-14-*-*-*-*-*-*-*"));
      XmxSetArg (WbNfixedboldFont, wrapFont("-adobe-courier-bold-r-normal-*-14-*-*-*-*-*-*-*"));
      XmxSetArg (WbNfixeditalicFont, wrapFont("-adobe-courier-medium-o-normal-*-14-*-*-*-*-*-*-*"));
      XmxSetArg (WbNheader1Font, wrapFont("-adobe-new century schoolbook-bold-r-normal-*-18-*-*-*-*-*-*-*"));
      XmxSetArg (WbNheader2Font, wrapFont("-adobe-new century schoolbook-bold-r-normal-*-17-*-*-*-*-*-*-*"));
      XmxSetArg (WbNheader3Font, wrapFont("-adobe-new century schoolbook-bold-r-normal-*-14-*-*-*-*-*-*-*"));
      XmxSetArg (WbNheader4Font, wrapFont("-adobe-new century schoolbook-bold-r-normal-*-12-*-*-*-*-*-*-*"));
      XmxSetArg (WbNheader5Font, wrapFont("-adobe-new century schoolbook-bold-r-normal-*-10-*-*-*-*-*-*-*"));
      XmxSetArg (WbNheader6Font, wrapFont("-adobe-new century schoolbook-bold-r-normal-*-8-*-*-*-*-*-*-*"));
      XmxSetArg (WbNaddressFont, wrapFont("-adobe-new century schoolbook-medium-i-normal-*-14-*-*-*-*-*-*-*"));
      XmxSetArg (WbNplainFont, wrapFont("-adobe-courier-medium-r-normal-*-12-*-*-*-*-*-*-*"));
      XmxSetArg (WbNplainboldFont, wrapFont("-adobe-courier-bold-r-normal-*-12-*-*-*-*-*-*-*"));
      XmxSetArg (WbNplainitalicFont, wrapFont("-adobe-courier-medium-o-normal-*-12-*-*-*-*-*-*-*"));
      XmxSetArg (WbNsupSubFont, wrapFont("-adobe-new century schoolbook-medium-r-normal-*-8-*-*-*-*-*-*-*"));
#ifdef L10N
      XmxSetArg (WbNWCfont, wrapFont("-adobe-new century schoolbook-medium-r-normal-*-14-*-*-*-*-*-*-*"));
      XmxSetArg (WbNitalicWCFont, wrapFont("-adobe-new century schoolbook-medium-i-normal-*-14-*-*-*-*-*-*-*"));
      XmxSetArg (WbNboldWCFont, wrapFont("-adobe-new century schoolbook-bold-r-normal-*-14-*-*-*-*-*-*-*"));
      XmxSetArg (WbNfixedWCFont, wrapFont("-adobe-courier-medium-r-normal-*-14-*-*-*-*-*-*-*"));
      XmxSetArg (WbNfixedboldWCFont, wrapFont("-adobe-courier-bold-r-normal-*-14-*-*-*-*-*-*-*"));
      XmxSetArg (WbNfixeditalicWCFont, wrapFont("-adobe-courier-medium-o-normal-*-14-*-*-*-*-*-*-*"));
      XmxSetArg (WbNheader1WCFont, wrapFont("-adobe-new century schoolbook-bold-r-normal-*-18-*-*-*-*-*-*-*"));
      XmxSetArg (WbNheader2WCFont, wrapFont("-adobe-new century schoolbook-bold-r-normal-*-17-*-*-*-*-*-*-*"));
      XmxSetArg (WbNheader3WCFont, wrapFont("-adobe-new century schoolbook-bold-r-normal-*-14-*-*-*-*-*-*-*"));
      XmxSetArg (WbNheader4WCFont, wrapFont("-adobe-new century schoolbook-bold-r-normal-*-12-*-*-*-*-*-*-*"));
      XmxSetArg (WbNheader5WCFont, wrapFont("-adobe-new century schoolbook-bold-r-normal-*-10-*-*-*-*-*-*-*"));
      XmxSetArg (WbNheader6WCFont, wrapFont("-adobe-new century schoolbook-bold-r-normal-*-8-*-*-*-*-*-*-*"));
      XmxSetArg (WbNaddressWCFont, wrapFont("-adobe-new century schoolbook-medium-i-normal-*-14-*-*-*-*-*-*-*"));
      XmxSetArg (WbNplainWCFont, wrapFont("-adobe-courier-medium-r-normal-*-12-*-*-*-*-*-*-*"));
      XmxSetArg (WbNplainboldWCFont, wrapFont("-adobe-courier-bold-r-normal-*-12-*-*-*-*-*-*-*"));
      XmxSetArg (WbNplainitalicWCFont, wrapFont("-adobe-courier-medium-o-normal-*-12-*-*-*-*-*-*-*"));
      XmxSetArg (WbNsupSubWCFont, wrapFont("-adobe-new century schoolbook-medium-r-normal-*-8-*-*-*-*-*-*-*"));
      XmxSetArg (WbNcharsetInfo, CS_ISO_8859_1);
#endif /* L10N */
      XmxSetValues (win->scrolled_win);
      win->font_family = 2;
      break;
    case mo_regular_newcentury:
      XmxSetArg (XtNfont, wrapFont("-adobe-new century schoolbook-medium-r-normal-*-18-*-*-*-*-*-*-*"));
      XmxSetArg (WbNitalicFont, wrapFont("-adobe-new century schoolbook-medium-i-normal-*-18-*-*-*-*-*-*-*"));
      XmxSetArg (WbNboldFont, wrapFont("-adobe-new century schoolbook-bold-r-normal-*-18-*-*-*-*-*-*-*"));
      XmxSetArg (WbNfixedFont, wrapFont("-adobe-courier-medium-r-normal-*-18-*-*-*-*-*-*-*"));
      XmxSetArg (WbNfixedboldFont, wrapFont("-adobe-courier-bold-r-normal-*-18-*-*-*-*-*-*-*"));
      XmxSetArg (WbNfixeditalicFont, wrapFont("-adobe-courier-medium-o-normal-*-18-*-*-*-*-*-*-*"));
      XmxSetArg (WbNheader1Font, wrapFont("-adobe-new century schoolbook-bold-r-normal-*-24-*-*-*-*-*-*-*"));
      XmxSetArg (WbNheader2Font, wrapFont("-adobe-new century schoolbook-bold-r-normal-*-18-*-*-*-*-*-*-*"));
      XmxSetArg (WbNheader3Font, wrapFont("-adobe-new century schoolbook-bold-r-normal-*-17-*-*-*-*-*-*-*"));
      XmxSetArg (WbNheader4Font, wrapFont("-adobe-new century schoolbook-bold-r-normal-*-14-*-*-*-*-*-*-*"));
      XmxSetArg (WbNheader5Font, wrapFont("-adobe-new century schoolbook-bold-r-normal-*-12-*-*-*-*-*-*-*"));
      XmxSetArg (WbNheader6Font, wrapFont("-adobe-new century schoolbook-bold-r-normal-*-10-*-*-*-*-*-*-*"));
      XmxSetArg (WbNaddressFont, wrapFont("-adobe-new century schoolbook-medium-i-normal-*-18-*-*-*-*-*-*-*"));
      XmxSetArg (WbNplainFont, wrapFont("-adobe-courier-medium-r-normal-*-14-*-*-*-*-*-*-*"));
      XmxSetArg (WbNplainboldFont, wrapFont("-adobe-courier-bold-r-normal-*-14-*-*-*-*-*-*-*"));
      XmxSetArg (WbNplainitalicFont, wrapFont("-adobe-courier-medium-o-normal-*-14-*-*-*-*-*-*-*"));
      XmxSetArg (WbNsupSubFont, wrapFont("-adobe-new century schoolbook-medium-r-normal-*-10-*-*-*-*-*-*-*"));
#ifdef L10N
      XmxSetArg (WbNWCfont, wrapFont("-adobe-new century schoolbook-medium-r-normal-*-18-*-*-*-*-*-*-*"));
      XmxSetArg (WbNitalicWCFont, wrapFont("-adobe-new century schoolbook-medium-i-normal-*-18-*-*-*-*-*-*-*"));
      XmxSetArg (WbNboldWCFont, wrapFont("-adobe-new century schoolbook-bold-r-normal-*-18-*-*-*-*-*-*-*"));
      XmxSetArg (WbNfixedWCFont, wrapFont("-adobe-courier-medium-r-normal-*-18-*-*-*-*-*-*-*"));
      XmxSetArg (WbNfixedboldWCFont, wrapFont("-adobe-courier-bold-r-normal-*-18-*-*-*-*-*-*-*"));
      XmxSetArg (WbNfixeditalicWCFont, wrapFont("-adobe-courier-medium-o-normal-*-18-*-*-*-*-*-*-*"));
      XmxSetArg (WbNheader1WCFont, wrapFont("-adobe-new century schoolbook-bold-r-normal-*-24-*-*-*-*-*-*-*"));
      XmxSetArg (WbNheader2WCFont, wrapFont("-adobe-new century schoolbook-bold-r-normal-*-18-*-*-*-*-*-*-*"));
      XmxSetArg (WbNheader3WCFont, wrapFont("-adobe-new century schoolbook-bold-r-normal-*-17-*-*-*-*-*-*-*"));
      XmxSetArg (WbNheader4WCFont, wrapFont("-adobe-new century schoolbook-bold-r-normal-*-14-*-*-*-*-*-*-*"));
      XmxSetArg (WbNheader5WCFont, wrapFont("-adobe-new century schoolbook-bold-r-normal-*-12-*-*-*-*-*-*-*"));
      XmxSetArg (WbNheader6WCFont, wrapFont("-adobe-new century schoolbook-bold-r-normal-*-10-*-*-*-*-*-*-*"));
      XmxSetArg (WbNaddressWCFont, wrapFont("-adobe-new century schoolbook-medium-i-normal-*-18-*-*-*-*-*-*-*"));
      XmxSetArg (WbNplainWCFont, wrapFont("-adobe-courier-medium-r-normal-*-14-*-*-*-*-*-*-*"));
      XmxSetArg (WbNplainboldWCFont, wrapFont("-adobe-courier-bold-r-normal-*-14-*-*-*-*-*-*-*"));
      XmxSetArg (WbNplainitalicWCFont, wrapFont("-adobe-courier-medium-o-normal-*-14-*-*-*-*-*-*-*"));
      XmxSetArg (WbNsupSubWCFont, wrapFont("-adobe-new century schoolbook-medium-r-normal-*-10-*-*-*-*-*-*-*"));
      XmxSetArg (WbNcharsetInfo, CS_ISO_8859_1);
#endif /* L10N */

      XmxSetValues (win->scrolled_win);
      win->font_family = 2;
      break;
    case mo_large_lucidabright:
      XmxSetArg (XtNfont, wrapFont("-b&h-lucidabright-medium-r-normal-*-20-*-*-*-*-*-*-*"));
      XmxSetArg (WbNitalicFont, wrapFont("-b&h-lucidabright-medium-i-normal-*-20-*-*-*-*-*-*-*"));
      XmxSetArg (WbNboldFont, wrapFont("-b&h-lucidabright-demibold-r-normal-*-20-*-*-*-*-*-*-*"));
      XmxSetArg (WbNfixedFont, wrapFont("-b&h-lucidatypewriter-medium-r-normal-*-20-*-*-*-*-*-*-*"));
      XmxSetArg (WbNfixedboldFont, wrapFont("-b&h-lucidatypewriter-bold-r-normal-*-20-*-*-*-*-*-*-*"));
      XmxSetArg (WbNfixeditalicFont, wrapFont("-adobe-courier-medium-o-normal-*-20-*-*-*-*-*-*-*"));
      XmxSetArg (WbNheader1Font, wrapFont("-b&h-lucidabright-demibold-r-normal-*-25-*-*-*-*-*-*-*"));
      XmxSetArg (WbNheader2Font, wrapFont("-b&h-lucidabright-demibold-r-normal-*-24-*-*-*-*-*-*-*"));
      XmxSetArg (WbNheader3Font, wrapFont("-b&h-lucidabright-demibold-r-normal-*-20-*-*-*-*-*-*-*"));
      XmxSetArg (WbNheader4Font, wrapFont("-b&h-lucidabright-demibold-r-normal-*-18-*-*-*-*-*-*-*"));
      XmxSetArg (WbNheader5Font, wrapFont("-b&h-lucidabright-demibold-r-normal-*-17-*-*-*-*-*-*-*"));
      XmxSetArg (WbNheader6Font, wrapFont("-b&h-lucidabright-demibold-r-normal-*-14-*-*-*-*-*-*-*"));
      XmxSetArg (WbNaddressFont, wrapFont("-b&h-lucidabright-medium-i-normal-*-20-*-*-*-*-*-*-*"));
      XmxSetArg (WbNplainFont, wrapFont("-b&h-lucidatypewriter-medium-r-normal-*-18-*-*-*-*-*-*-*"));
      XmxSetArg (WbNplainboldFont, wrapFont("-b&h-lucidatypewriter-bold-r-normal-*-18-*-*-*-*-*-*-*"));
      XmxSetArg (WbNplainitalicFont, wrapFont("-adobe-courier-medium-o-normal-*-18-*-*-*-*-*-*-*"));
      XmxSetArg (WbNsupSubFont, wrapFont("-b&h-lucidabright-medium-r-normal-*-14-*-*-*-*-*-*-*"));
#ifdef L10N
      XmxSetArg (WbNWCfont, wrapFont("-b&h-lucidabright-medium-r-normal-*-20-*-*-*-*-*-*-*"));
      XmxSetArg (WbNitalicWCFont, wrapFont("-b&h-lucidabright-medium-i-normal-*-20-*-*-*-*-*-*-*"));
      XmxSetArg (WbNboldWCFont, wrapFont("-b&h-lucidabright-demibold-r-normal-*-20-*-*-*-*-*-*-*"));
      XmxSetArg (WbNfixedWCFont, wrapFont("-b&h-lucidatypewriter-medium-r-normal-*-20-*-*-*-*-*-*-*"));
      XmxSetArg (WbNfixedboldWCFont, wrapFont("-b&h-lucidatypewriter-bold-r-normal-*-20-*-*-*-*-*-*-*"));
      XmxSetArg (WbNfixeditalicWCFont, wrapFont("-adobe-courier-medium-o-normal-*-20-*-*-*-*-*-*-*"));
      XmxSetArg (WbNheader1WCFont, wrapFont("-b&h-lucidabright-demibold-r-normal-*-25-*-*-*-*-*-*-*"));
      XmxSetArg (WbNheader2WCFont, wrapFont("-b&h-lucidabright-demibold-r-normal-*-24-*-*-*-*-*-*-*"));
      XmxSetArg (WbNheader3WCFont, wrapFont("-b&h-lucidabright-demibold-r-normal-*-20-*-*-*-*-*-*-*"));
      XmxSetArg (WbNheader4WCFont, wrapFont("-b&h-lucidabright-demibold-r-normal-*-18-*-*-*-*-*-*-*"));
      XmxSetArg (WbNheader5WCFont, wrapFont("-b&h-lucidabright-demibold-r-normal-*-17-*-*-*-*-*-*-*"));
      XmxSetArg (WbNheader6WCFont, wrapFont("-b&h-lucidabright-demibold-r-normal-*-14-*-*-*-*-*-*-*"));
      XmxSetArg (WbNaddressWCFont, wrapFont("-b&h-lucidabright-medium-i-normal-*-20-*-*-*-*-*-*-*"));
      XmxSetArg (WbNplainWCFont, wrapFont("-b&h-lucidatypewriter-medium-r-normal-*-18-*-*-*-*-*-*-*"));
      XmxSetArg (WbNplainboldWCFont, wrapFont("-b&h-lucidatypewriter-bold-r-normal-*-18-*-*-*-*-*-*-*"));
      XmxSetArg (WbNplainitalicWCFont, wrapFont("-adobe-courier-medium-o-normal-*-18-*-*-*-*-*-*-*"));
      XmxSetArg (WbNsupSubWCFont, wrapFont("-b&h-lucidabright-medium-r-normal-*-14-*-*-*-*-*-*-*"));
      XmxSetArg (WbNcharsetInfo, CS_ISO_8859_1);
#endif /* L10N */

      XmxSetValues (win->scrolled_win);
      win->font_family = 3;
      break;
    case mo_regular_lucidabright:
      XmxSetArg (XtNfont, wrapFont("-b&h-lucidabright-medium-r-normal-*-17-*-*-*-*-*-*-*"));
      XmxSetArg (WbNitalicFont, wrapFont("-b&h-lucidabright-medium-i-normal-*-17-*-*-*-*-*-*-*"));
      XmxSetArg (WbNboldFont, wrapFont("-b&h-lucidabright-demibold-r-normal-*-17-*-*-*-*-*-*-*"));
      XmxSetArg (WbNfixedFont, wrapFont("-b&h-lucidatypewriter-medium-r-normal-*-17-*-*-*-*-*-*-*"));
      XmxSetArg (WbNfixedboldFont, wrapFont("-b&h-lucidatypewriter-bold-r-normal-*-17-*-*-*-*-*-*-*"));
      XmxSetArg (WbNfixeditalicFont, wrapFont("-adobe-courier-medium-o-normal-*-18-*-*-*-*-*-*-*"));
      XmxSetArg (WbNheader1Font, wrapFont("-b&h-lucidabright-demibold-r-normal-*-24-*-*-*-*-*-*-*"));
      XmxSetArg (WbNheader2Font, wrapFont("-b&h-lucidabright-demibold-r-normal-*-18-*-*-*-*-*-*-*"));
      XmxSetArg (WbNheader3Font, wrapFont("-b&h-lucidabright-demibold-r-normal-*-17-*-*-*-*-*-*-*"));
      XmxSetArg (WbNheader4Font, wrapFont("-b&h-lucidabright-demibold-r-normal-*-14-*-*-*-*-*-*-*"));
      XmxSetArg (WbNheader5Font, wrapFont("-b&h-lucidabright-demibold-r-normal-*-12-*-*-*-*-*-*-*"));
      XmxSetArg (WbNheader6Font, wrapFont("-b&h-lucidabright-demibold-r-normal-*-10-*-*-*-*-*-*-*"));
      XmxSetArg (WbNaddressFont, wrapFont("-b&h-lucidabright-medium-i-normal-*-17-*-*-*-*-*-*-*"));
      XmxSetArg (WbNplainFont, wrapFont("-b&h-lucidatypewriter-medium-r-normal-*-14-*-*-*-*-*-*-*"));
      XmxSetArg (WbNplainboldFont, wrapFont("-b&h-lucidatypewriter-bold-r-normal-*-14-*-*-*-*-*-*-*"));
      XmxSetArg (WbNplainitalicFont, wrapFont("-adobe-courier-medium-o-normal-*-14-*-*-*-*-*-*-*"));
      XmxSetArg (WbNsupSubFont, wrapFont("-b&h-lucidabright-medium-r-normal-*-10-*-*-*-*-*-*-*"));
#ifdef L10N
      XmxSetArg (WbNWCfont, wrapFont("-b&h-lucidabright-medium-r-normal-*-17-*-*-*-*-*-*-*"));
      XmxSetArg (WbNitalicWCFont, wrapFont("-b&h-lucidabright-medium-i-normal-*-17-*-*-*-*-*-*-*"));
      XmxSetArg (WbNboldWCFont, wrapFont("-b&h-lucidabright-demibold-r-normal-*-17-*-*-*-*-*-*-*"));
      XmxSetArg (WbNfixedWCFont, wrapFont("-b&h-lucidatypewriter-medium-r-normal-*-17-*-*-*-*-*-*-*"));
      XmxSetArg (WbNfixedboldWCFont, wrapFont("-b&h-lucidatypewriter-bold-r-normal-*-17-*-*-*-*-*-*-*"));
      XmxSetArg (WbNfixeditalicWCFont, wrapFont("-adobe-courier-medium-o-normal-*-18-*-*-*-*-*-*-*"));
      XmxSetArg (WbNheader1WCFont, wrapFont("-b&h-lucidabright-demibold-r-normal-*-24-*-*-*-*-*-*-*"));
      XmxSetArg (WbNheader2WCFont, wrapFont("-b&h-lucidabright-demibold-r-normal-*-18-*-*-*-*-*-*-*"));
      XmxSetArg (WbNheader3WCFont, wrapFont("-b&h-lucidabright-demibold-r-normal-*-17-*-*-*-*-*-*-*"));
      XmxSetArg (WbNheader4WCFont, wrapFont("-b&h-lucidabright-demibold-r-normal-*-14-*-*-*-*-*-*-*"));
      XmxSetArg (WbNheader5WCFont, wrapFont("-b&h-lucidabright-demibold-r-normal-*-12-*-*-*-*-*-*-*"));
      XmxSetArg (WbNheader6WCFont, wrapFont("-b&h-lucidabright-demibold-r-normal-*-10-*-*-*-*-*-*-*"));
      XmxSetArg (WbNaddressWCFont, wrapFont("-b&h-lucidabright-medium-i-normal-*-17-*-*-*-*-*-*-*"));
      XmxSetArg (WbNplainWCFont, wrapFont("-b&h-lucidatypewriter-medium-r-normal-*-14-*-*-*-*-*-*-*"));
      XmxSetArg (WbNplainboldWCFont, wrapFont("-b&h-lucidatypewriter-bold-r-normal-*-14-*-*-*-*-*-*-*"));
      XmxSetArg (WbNplainitalicWCFont, wrapFont("-adobe-courier-medium-o-normal-*-14-*-*-*-*-*-*-*"));
      XmxSetArg (WbNsupSubWCFont, wrapFont("-b&h-lucidabright-medium-r-normal-*-10-*-*-*-*-*-*-*"));
      XmxSetArg (WbNcharsetInfo, CS_ISO_8859_1);
#endif /* L10N */

      XmxSetValues (win->scrolled_win);
      win->font_family = 3;
      break;
    case mo_small_lucidabright:
      XmxSetArg (XtNfont, wrapFont("-b&h-lucidabright-medium-r-normal-*-14-*-*-*-*-*-*-*"));
      XmxSetArg (WbNitalicFont, wrapFont("-b&h-lucidabright-medium-i-normal-*-14-*-*-*-*-*-*-*"));
      XmxSetArg (WbNboldFont, wrapFont("-b&h-lucidabright-demibold-r-normal-*-14-*-*-*-*-*-*-*"));
      XmxSetArg (WbNfixedFont, wrapFont("-b&h-lucidatypewriter-medium-r-normal-*-14-*-*-*-*-*-*-*"));
      XmxSetArg (WbNfixedboldFont, wrapFont("-b&h-lucidatypewriter-bold-r-normal-*-14-*-*-*-*-*-*-*"));
      XmxSetArg (WbNfixeditalicFont, wrapFont("-adobe-courier-medium-o-normal-*-14-*-*-*-*-*-*-*"));
      XmxSetArg (WbNheader1Font, wrapFont("-b&h-lucidabright-demibold-r-normal-*-18-*-*-*-*-*-*-*"));
      XmxSetArg (WbNheader2Font, wrapFont("-b&h-lucidabright-demibold-r-normal-*-17-*-*-*-*-*-*-*"));
      XmxSetArg (WbNheader3Font, wrapFont("-b&h-lucidabright-demibold-r-normal-*-14-*-*-*-*-*-*-*"));
      XmxSetArg (WbNheader4Font, wrapFont("-b&h-lucidabright-demibold-r-normal-*-12-*-*-*-*-*-*-*"));
      XmxSetArg (WbNheader5Font, wrapFont("-b&h-lucidabright-demibold-r-normal-*-11-*-*-*-*-*-*-*"));
      XmxSetArg (WbNheader6Font, wrapFont("-b&h-lucidabright-demibold-r-normal-*-10-*-*-*-*-*-*-*"));
      XmxSetArg (WbNaddressFont, wrapFont("-b&h-lucidabright-medium-i-normal-*-14-*-*-*-*-*-*-*"));
      XmxSetArg (WbNplainFont, wrapFont("-b&h-lucidatypewriter-medium-r-normal-*-12-*-*-*-*-*-*-*"));
      XmxSetArg (WbNplainboldFont, wrapFont("-b&h-lucidatypewriter-bold-r-normal-*-12-*-*-*-*-*-*-*"));
      XmxSetArg (WbNplainitalicFont, wrapFont("-adobe-courier-medium-o-normal-*-12-*-*-*-*-*-*-*"));
      XmxSetArg (WbNsupSubFont, wrapFont("-b&h-lucidabright-medium-r-normal-*-8-*-*-*-*-*-*-*"));
#ifdef L10N
      XmxSetArg (WbNWCfont, wrapFont("-b&h-lucidabright-medium-r-normal-*-14-*-*-*-*-*-*-*"));
      XmxSetArg (WbNitalicWCFont, wrapFont("-b&h-lucidabright-medium-i-normal-*-14-*-*-*-*-*-*-*"));
      XmxSetArg (WbNboldWCFont, wrapFont("-b&h-lucidabright-demibold-r-normal-*-14-*-*-*-*-*-*-*"));
      XmxSetArg (WbNfixedWCFont, wrapFont("-b&h-lucidatypewriter-medium-r-normal-*-14-*-*-*-*-*-*-*"));
      XmxSetArg (WbNfixedboldWCFont, wrapFont("-b&h-lucidatypewriter-bold-r-normal-*-14-*-*-*-*-*-*-*"));
      XmxSetArg (WbNfixeditalicWCFont, wrapFont("-adobe-courier-medium-o-normal-*-14-*-*-*-*-*-*-*"));
      XmxSetArg (WbNheader1WCFont, wrapFont("-b&h-lucidabright-demibold-r-normal-*-18-*-*-*-*-*-*-*"));
      XmxSetArg (WbNheader2WCFont, wrapFont("-b&h-lucidabright-demibold-r-normal-*-17-*-*-*-*-*-*-*"));
      XmxSetArg (WbNheader3WCFont, wrapFont("-b&h-lucidabright-demibold-r-normal-*-14-*-*-*-*-*-*-*"));
      XmxSetArg (WbNheader4WCFont, wrapFont("-b&h-lucidabright-demibold-r-normal-*-12-*-*-*-*-*-*-*"));
      XmxSetArg (WbNheader5WCFont, wrapFont("-b&h-lucidabright-demibold-r-normal-*-11-*-*-*-*-*-*-*"));
      XmxSetArg (WbNheader6WCFont, wrapFont("-b&h-lucidabright-demibold-r-normal-*-10-*-*-*-*-*-*-*"));
      XmxSetArg (WbNaddressWCFont, wrapFont("-b&h-lucidabright-medium-i-normal-*-14-*-*-*-*-*-*-*"));
      XmxSetArg (WbNplainWCFont, wrapFont("-b&h-lucidatypewriter-medium-r-normal-*-12-*-*-*-*-*-*-*"));
      XmxSetArg (WbNplainboldWCFont, wrapFont("-b&h-lucidatypewriter-bold-r-normal-*-12-*-*-*-*-*-*-*"));
      XmxSetArg (WbNplainitalicWCFont, wrapFont("-adobe-courier-medium-o-normal-*-12-*-*-*-*-*-*-*"));
      XmxSetArg (WbNsupSubWCFont, wrapFont("-b&h-lucidabright-medium-r-normal-*-8-*-*-*-*-*-*-*"));
      XmxSetArg (WbNcharsetInfo, CS_ISO_8859_1);
#endif /* L10N */

      XmxSetValues (win->scrolled_win);
      win->font_family = 3;
      break;
#ifdef L10N
    case mo_charset_iso_8859_2:
      XmxSetArg (XtNfont, wrapFont(GetFontName(Rdata.FontSet, "iso8859-2")));
      XmxSetArg (WbNitalicFont, wrapFont(GetFontName(Rdata.italicFontSet, "iso8859-2")));
      XmxSetArg (WbNboldFont, wrapFont(GetFontName(Rdata.boldFontSet, "iso8859-2")));
      XmxSetArg (WbNfixedFont, wrapFont(GetFontName(Rdata.fixedFontSet, "iso8859-2")));
      XmxSetArg (WbNfixedboldFont, wrapFont(GetFontName(Rdata.fixedboldFontSet, "iso8859-2")));
      XmxSetArg (WbNfixeditalicFont, wrapFont(GetFontName(Rdata.fixeditalicFontSet, "iso8859-2")));
      XmxSetArg (WbNheader1Font, wrapFont(GetFontName(Rdata.header1FontSet, "iso8859-2")));
      XmxSetArg (WbNheader2Font, wrapFont(GetFontName(Rdata.header2FontSet, "iso8859-2")));
      XmxSetArg (WbNheader3Font, wrapFont(GetFontName(Rdata.header3FontSet, "iso8859-2")));
      XmxSetArg (WbNheader4Font, wrapFont(GetFontName(Rdata.header4FontSet, "iso8859-2")));
      XmxSetArg (WbNheader5Font, wrapFont(GetFontName(Rdata.header5FontSet, "iso8859-2")));
      XmxSetArg (WbNheader6Font, wrapFont(GetFontName(Rdata.header6FontSet, "iso8859-2")));
      XmxSetArg (WbNaddressFont, wrapFont(GetFontName(Rdata.addressFontSet, "iso8859-2")));
      XmxSetArg (WbNplainFont, wrapFont(GetFontName(Rdata.plainFontSet, "iso8859-2")));
      XmxSetArg (WbNplainboldFont, wrapFont(GetFontName(Rdata.plainboldFontSet, "iso8859-2")));
      XmxSetArg (WbNplainitalicFont, wrapFont(GetFontName(Rdata.plainitalicFontSet, "iso8859-2")));
      XmxSetArg (WbNsupSubFont, wrapFont(GetFontName(Rdata.supSubFontSet, "iso8859-2")));
      XmxSetArg (WbNWCfont, wrapFont(GetFontName(Rdata.FontSet, "iso8859-2")));
      XmxSetArg (WbNitalicWCFont, wrapFont(GetFontName(Rdata.italicFontSet, "iso8859-2")));
      XmxSetArg (WbNboldWCFont, wrapFont(GetFontName(Rdata.boldFontSet, "iso8859-2")));
      XmxSetArg (WbNfixedWCFont, wrapFont(GetFontName(Rdata.fixedFontSet, "iso8859-2")));
      XmxSetArg (WbNfixedboldWCFont, wrapFont(GetFontName(Rdata.fixedboldFontSet, "iso8859-2")));
      XmxSetArg (WbNfixeditalicWCFont, wrapFont(GetFontName(Rdata.fixeditalicFontSet, "iso8859-2")));
      XmxSetArg (WbNheader1WCFont, wrapFont(GetFontName(Rdata.header1FontSet, "iso8859-2")));
      XmxSetArg (WbNheader2WCFont, wrapFont(GetFontName(Rdata.header2FontSet, "iso8859-2")));
      XmxSetArg (WbNheader3WCFont, wrapFont(GetFontName(Rdata.header3FontSet, "iso8859-2")));
      XmxSetArg (WbNheader4WCFont, wrapFont(GetFontName(Rdata.header4FontSet, "iso8859-2")));
      XmxSetArg (WbNheader5WCFont, wrapFont(GetFontName(Rdata.header5FontSet, "iso8859-2")));
      XmxSetArg (WbNheader6WCFont, wrapFont(GetFontName(Rdata.header6FontSet, "iso8859-2")));
      XmxSetArg (WbNaddressWCFont, wrapFont(GetFontName(Rdata.addressFontSet, "iso8859-2")));
      XmxSetArg (WbNplainWCFont, wrapFont(GetFontName(Rdata.plainFontSet, "iso8859-2")));
      XmxSetArg (WbNplainboldWCFont, wrapFont(GetFontName(Rdata.plainboldFontSet, "iso8859-2")));
      XmxSetArg (WbNplainitalicWCFont, wrapFont(GetFontName(Rdata.plainitalicFontSet, "iso8859-2")));
      XmxSetArg (WbNsupSubWCFont, wrapFont(GetFontName(Rdata.supSubFontSet, "iso8859-2")));
      XmxSetArg (WbNcharsetInfo, CS_ISO_8859_2);
      XmxSetValues (win->scrolled_win);
      win->font_family = 0;
      break;
    case mo_charset_iso_8859_3:
      XmxSetArg (XtNfont, wrapFont(GetFontName(Rdata.FontSet, "iso8859-3")));
      XmxSetArg (WbNitalicFont, wrapFont(GetFontName(Rdata.italicFontSet, "iso8859-3")));
      XmxSetArg (WbNboldFont, wrapFont(GetFontName(Rdata.boldFontSet, "iso8859-3")));
      XmxSetArg (WbNfixedFont, wrapFont(GetFontName(Rdata.fixedFontSet, "iso8859-3")));
      XmxSetArg (WbNfixedboldFont, wrapFont(GetFontName(Rdata.fixedboldFontSet, "iso8859-3")));
      XmxSetArg (WbNfixeditalicFont, wrapFont(GetFontName(Rdata.fixeditalicFontSet, "iso8859-3")));
      XmxSetArg (WbNheader1Font, wrapFont(GetFontName(Rdata.header1FontSet, "iso8859-3")));
      XmxSetArg (WbNheader2Font, wrapFont(GetFontName(Rdata.header2FontSet, "iso8859-3")));
      XmxSetArg (WbNheader3Font, wrapFont(GetFontName(Rdata.header3FontSet, "iso8859-3")));
      XmxSetArg (WbNheader4Font, wrapFont(GetFontName(Rdata.header4FontSet, "iso8859-3")));
      XmxSetArg (WbNheader5Font, wrapFont(GetFontName(Rdata.header5FontSet, "iso8859-3")));
      XmxSetArg (WbNheader6Font, wrapFont(GetFontName(Rdata.header6FontSet, "iso8859-3")));
      XmxSetArg (WbNaddressFont, wrapFont(GetFontName(Rdata.addressFontSet, "iso8859-3")));
      XmxSetArg (WbNplainFont, wrapFont(GetFontName(Rdata.plainFontSet, "iso8859-3")));
      XmxSetArg (WbNplainboldFont, wrapFont(GetFontName(Rdata.plainboldFontSet, "iso8859-3")));
      XmxSetArg (WbNplainitalicFont, wrapFont(GetFontName(Rdata.plainitalicFontSet, "iso8859-3")));
      XmxSetArg (WbNsupSubFont, wrapFont(GetFontName(Rdata.supSubFontSet, "iso8859-3")));
      XmxSetArg (WbNWCfont, wrapFont(GetFontName(Rdata.FontSet, "iso8859-3")));
      XmxSetArg (WbNitalicWCFont, wrapFont(GetFontName(Rdata.italicFontSet, "iso8859-3")));
      XmxSetArg (WbNboldWCFont, wrapFont(GetFontName(Rdata.boldFontSet, "iso8859-3")));
      XmxSetArg (WbNfixedWCFont, wrapFont(GetFontName(Rdata.fixedFontSet, "iso8859-3")));
      XmxSetArg (WbNfixedboldWCFont, wrapFont(GetFontName(Rdata.fixedboldFontSet, "iso8859-3")));
      XmxSetArg (WbNfixeditalicWCFont, wrapFont(GetFontName(Rdata.fixeditalicFontSet, "iso8859-3")));
      XmxSetArg (WbNheader1WCFont, wrapFont(GetFontName(Rdata.header1FontSet, "iso8859-3")));
      XmxSetArg (WbNheader2WCFont, wrapFont(GetFontName(Rdata.header2FontSet, "iso8859-3")));
      XmxSetArg (WbNheader3WCFont, wrapFont(GetFontName(Rdata.header3FontSet, "iso8859-3")));
      XmxSetArg (WbNheader4WCFont, wrapFont(GetFontName(Rdata.header4FontSet, "iso8859-3")));
      XmxSetArg (WbNheader5WCFont, wrapFont(GetFontName(Rdata.header5FontSet, "iso8859-3")));
      XmxSetArg (WbNheader6WCFont, wrapFont(GetFontName(Rdata.header6FontSet, "iso8859-3")));
      XmxSetArg (WbNaddressWCFont, wrapFont(GetFontName(Rdata.addressFontSet, "iso8859-3")));
      XmxSetArg (WbNplainWCFont, wrapFont(GetFontName(Rdata.plainFontSet, "iso8859-3")));
      XmxSetArg (WbNplainboldWCFont, wrapFont(GetFontName(Rdata.plainboldFontSet, "iso8859-3")));
      XmxSetArg (WbNplainitalicWCFont, wrapFont(GetFontName(Rdata.plainitalicFontSet, "iso8859-3")));
      XmxSetArg (WbNsupSubWCFont, wrapFont(GetFontName(Rdata.supSubFontSet, "iso8859-3")));
      XmxSetArg (WbNcharsetInfo, CS_ISO_8859_3);
      XmxSetValues (win->scrolled_win);
      win->font_family = 0;
      break;
    case mo_charset_iso_8859_4:
      XmxSetArg (XtNfont, wrapFont(GetFontName(Rdata.FontSet, "iso8859-4")));
      XmxSetArg (WbNitalicFont, wrapFont(GetFontName(Rdata.italicFontSet, "iso8859-4")));
      XmxSetArg (WbNboldFont, wrapFont(GetFontName(Rdata.boldFontSet, "iso8859-4")));
      XmxSetArg (WbNfixedFont, wrapFont(GetFontName(Rdata.fixedFontSet, "iso8859-4")));
      XmxSetArg (WbNfixedboldFont, wrapFont(GetFontName(Rdata.fixedboldFontSet, "iso8859-4")));
      XmxSetArg (WbNfixeditalicFont, wrapFont(GetFontName(Rdata.fixeditalicFontSet, "iso8859-4")));
      XmxSetArg (WbNheader1Font, wrapFont(GetFontName(Rdata.header1FontSet, "iso8859-4")));
      XmxSetArg (WbNheader2Font, wrapFont(GetFontName(Rdata.header2FontSet, "iso8859-4")));
      XmxSetArg (WbNheader3Font, wrapFont(GetFontName(Rdata.header3FontSet, "iso8859-4")));
      XmxSetArg (WbNheader4Font, wrapFont(GetFontName(Rdata.header4FontSet, "iso8859-4")));
      XmxSetArg (WbNheader5Font, wrapFont(GetFontName(Rdata.header5FontSet, "iso8859-4")));
      XmxSetArg (WbNheader6Font, wrapFont(GetFontName(Rdata.header6FontSet, "iso8859-4")));
      XmxSetArg (WbNaddressFont, wrapFont(GetFontName(Rdata.addressFontSet, "iso8859-4")));
      XmxSetArg (WbNplainFont, wrapFont(GetFontName(Rdata.plainFontSet, "iso8859-4")));
      XmxSetArg (WbNplainboldFont, wrapFont(GetFontName(Rdata.plainboldFontSet, "iso8859-4")));
      XmxSetArg (WbNplainitalicFont, wrapFont(GetFontName(Rdata.plainitalicFontSet, "iso8859-4")));
      XmxSetArg (WbNsupSubFont, wrapFont(GetFontName(Rdata.supSubFontSet, "iso8859-4")));
      XmxSetArg (WbNWCfont, wrapFont(GetFontName(Rdata.FontSet, "iso8859-4")));
      XmxSetArg (WbNitalicWCFont, wrapFont(GetFontName(Rdata.italicFontSet, "iso8859-4")));
      XmxSetArg (WbNboldWCFont, wrapFont(GetFontName(Rdata.boldFontSet, "iso8859-4")));
      XmxSetArg (WbNfixedWCFont, wrapFont(GetFontName(Rdata.fixedFontSet, "iso8859-4")));
      XmxSetArg (WbNfixedboldWCFont, wrapFont(GetFontName(Rdata.fixedboldFontSet, "iso8859-4")));
      XmxSetArg (WbNfixeditalicWCFont, wrapFont(GetFontName(Rdata.fixeditalicFontSet, "iso8859-4")));
      XmxSetArg (WbNheader1WCFont, wrapFont(GetFontName(Rdata.header1FontSet, "iso8859-4")));
      XmxSetArg (WbNheader2WCFont, wrapFont(GetFontName(Rdata.header2FontSet, "iso8859-4")));
      XmxSetArg (WbNheader3WCFont, wrapFont(GetFontName(Rdata.header3FontSet, "iso8859-4")));
      XmxSetArg (WbNheader4WCFont, wrapFont(GetFontName(Rdata.header4FontSet, "iso8859-4")));
      XmxSetArg (WbNheader5WCFont, wrapFont(GetFontName(Rdata.header5FontSet, "iso8859-4")));
      XmxSetArg (WbNheader6WCFont, wrapFont(GetFontName(Rdata.header6FontSet, "iso8859-4")));
      XmxSetArg (WbNaddressWCFont, wrapFont(GetFontName(Rdata.addressFontSet, "iso8859-4")));
      XmxSetArg (WbNplainWCFont, wrapFont(GetFontName(Rdata.plainFontSet, "iso8859-4")));
      XmxSetArg (WbNplainboldWCFont, wrapFont(GetFontName(Rdata.plainboldFontSet, "iso8859-5")));
      XmxSetArg (WbNplainitalicWCFont, wrapFont(GetFontName(Rdata.plainitalicFontSet, "iso8859-5")));
      XmxSetArg (WbNsupSubWCFont, wrapFont(GetFontName(Rdata.supSubFontSet, "iso8859-4")));
      XmxSetArg (WbNcharsetInfo, CS_ISO_8859_4);
      XmxSetValues (win->scrolled_win);
      win->font_family = 0;
      break;
    case mo_charset_iso_8859_5:
      XmxSetArg (XtNfont, wrapFont(GetFontName(Rdata.FontSet, "iso8859-5")));
      XmxSetArg (WbNitalicFont, wrapFont(GetFontName(Rdata.italicFontSet, "iso8859-5")));
      XmxSetArg (WbNboldFont, wrapFont(GetFontName(Rdata.boldFontSet, "iso8859-5")));
      XmxSetArg (WbNfixedFont, wrapFont(GetFontName(Rdata.fixedFontSet, "iso8859-5")));
      XmxSetArg (WbNfixedboldFont, wrapFont(GetFontName(Rdata.fixedboldFontSet, "iso8859-5")));
      XmxSetArg (WbNfixeditalicFont, wrapFont(GetFontName(Rdata.fixeditalicFontSet, "iso8859-5")));
      XmxSetArg (WbNheader1Font, wrapFont(GetFontName(Rdata.header1FontSet, "iso8859-5")));
      XmxSetArg (WbNheader2Font, wrapFont(GetFontName(Rdata.header2FontSet, "iso8859-5")));
      XmxSetArg (WbNheader3Font, wrapFont(GetFontName(Rdata.header3FontSet, "iso8859-5")));
      XmxSetArg (WbNheader4Font, wrapFont(GetFontName(Rdata.header4FontSet, "iso8859-5")));
      XmxSetArg (WbNheader5Font, wrapFont(GetFontName(Rdata.header5FontSet, "iso8859-5")));
      XmxSetArg (WbNheader6Font, wrapFont(GetFontName(Rdata.header6FontSet, "iso8859-5")));
      XmxSetArg (WbNaddressFont, wrapFont(GetFontName(Rdata.addressFontSet, "iso8859-5")));
      XmxSetArg (WbNplainFont, wrapFont(GetFontName(Rdata.plainFontSet, "iso8859-5")));
      XmxSetArg (WbNplainboldFont, wrapFont(GetFontName(Rdata.plainboldFontSet, "iso8859-5")));
      XmxSetArg (WbNplainitalicFont, wrapFont(GetFontName(Rdata.plainitalicFontSet, "iso8859-5")));
      XmxSetArg (WbNsupSubFont, wrapFont(GetFontName(Rdata.supSubFontSet, "iso8859-5")));
      XmxSetArg (WbNWCfont, wrapFont(GetFontName(Rdata.FontSet, "iso8859-5")));
      XmxSetArg (WbNitalicWCFont, wrapFont(GetFontName(Rdata.italicFontSet, "iso8859-5")));
      XmxSetArg (WbNboldWCFont, wrapFont(GetFontName(Rdata.boldFontSet, "iso8859-5")));
      XmxSetArg (WbNfixedWCFont, wrapFont(GetFontName(Rdata.fixedFontSet, "iso8859-5")));
      XmxSetArg (WbNfixedboldWCFont, wrapFont(GetFontName(Rdata.fixedboldFontSet, "iso8859-5")));
      XmxSetArg (WbNfixeditalicWCFont, wrapFont(GetFontName(Rdata.fixeditalicFontSet, "iso8859-5")));
      XmxSetArg (WbNheader1WCFont, wrapFont(GetFontName(Rdata.header1FontSet, "iso8859-5")));
      XmxSetArg (WbNheader2WCFont, wrapFont(GetFontName(Rdata.header2FontSet, "iso8859-5")));
      XmxSetArg (WbNheader3WCFont, wrapFont(GetFontName(Rdata.header3FontSet, "iso8859-5")));
      XmxSetArg (WbNheader4WCFont, wrapFont(GetFontName(Rdata.header4FontSet, "iso8859-5")));
      XmxSetArg (WbNheader5WCFont, wrapFont(GetFontName(Rdata.header5FontSet, "iso8859-5")));
      XmxSetArg (WbNheader6WCFont, wrapFont(GetFontName(Rdata.header6FontSet, "iso8859-5")));
      XmxSetArg (WbNaddressWCFont, wrapFont(GetFontName(Rdata.addressFontSet, "iso8859-5")));
      XmxSetArg (WbNplainWCFont, wrapFont(GetFontName(Rdata.plainFontSet, "iso8859-5")));
      XmxSetArg (WbNplainboldWCFont, wrapFont(GetFontName(Rdata.plainboldFontSet, "iso8859-5")));
      XmxSetArg (WbNplainitalicWCFont, wrapFont(GetFontName(Rdata.plainitalicFontSet, "iso8859-5")));
      XmxSetArg (WbNsupSubWCFont, wrapFont(GetFontName(Rdata.supSubFontSet, "iso8859-5")));
      XmxSetArg (WbNcharsetInfo, CS_ISO_8859_5);
      XmxSetValues (win->scrolled_win);
      win->font_family = 0;
      break;
    case mo_charset_iso_8859_7:
      XmxSetArg (XtNfont, wrapFont(GetFontName(Rdata.FontSet, "iso8859-7")));
      XmxSetArg (WbNitalicFont, wrapFont(GetFontName(Rdata.italicFontSet, "iso8859-7")));
      XmxSetArg (WbNboldFont, wrapFont(GetFontName(Rdata.boldFontSet, "iso8859-7")));
      XmxSetArg (WbNfixedFont, wrapFont(GetFontName(Rdata.fixedFontSet, "iso8859-7")));
      XmxSetArg (WbNfixedboldFont, wrapFont(GetFontName(Rdata.fixedboldFontSet, "iso8859-7")));
      XmxSetArg (WbNfixeditalicFont, wrapFont(GetFontName(Rdata.fixeditalicFontSet, "iso8859-7")));
      XmxSetArg (WbNheader1Font, wrapFont(GetFontName(Rdata.header1FontSet, "iso8859-7")));
      XmxSetArg (WbNheader2Font, wrapFont(GetFontName(Rdata.header2FontSet, "iso8859-7")));
      XmxSetArg (WbNheader3Font, wrapFont(GetFontName(Rdata.header3FontSet, "iso8859-7")));
      XmxSetArg (WbNheader4Font, wrapFont(GetFontName(Rdata.header4FontSet, "iso8859-7")));
      XmxSetArg (WbNheader5Font, wrapFont(GetFontName(Rdata.header5FontSet, "iso8859-7")));
      XmxSetArg (WbNheader6Font, wrapFont(GetFontName(Rdata.header6FontSet, "iso8859-7")));
      XmxSetArg (WbNaddressFont, wrapFont(GetFontName(Rdata.addressFontSet, "iso8859-7")));
      XmxSetArg (WbNplainFont, wrapFont(GetFontName(Rdata.plainFontSet, "iso8859-7")));
      XmxSetArg (WbNplainboldFont, wrapFont(GetFontName(Rdata.plainboldFontSet, "iso8859-7")));
      XmxSetArg (WbNplainitalicFont, wrapFont(GetFontName(Rdata.plainitalicFontSet, "iso8859-7")));
      XmxSetArg (WbNsupSubFont, wrapFont(GetFontName(Rdata.supSubFontSet, "iso8859-7")));
      XmxSetArg (WbNWCfont, wrapFont(GetFontName(Rdata.FontSet, "iso8859-7")));
      XmxSetArg (WbNitalicWCFont, wrapFont(GetFontName(Rdata.italicFontSet, "iso8859-7")));
      XmxSetArg (WbNboldWCFont, wrapFont(GetFontName(Rdata.boldFontSet, "iso8859-7")));
      XmxSetArg (WbNfixedWCFont, wrapFont(GetFontName(Rdata.fixedFontSet, "iso8859-7")));
      XmxSetArg (WbNfixedboldWCFont, wrapFont(GetFontName(Rdata.fixedboldFontSet, "iso8859-7")));
      XmxSetArg (WbNfixeditalicWCFont, wrapFont(GetFontName(Rdata.fixeditalicFontSet, "iso8859-7")));
      XmxSetArg (WbNheader1WCFont, wrapFont(GetFontName(Rdata.header1FontSet, "iso8859-7")));
      XmxSetArg (WbNheader2WCFont, wrapFont(GetFontName(Rdata.header2FontSet, "iso8859-7")));
      XmxSetArg (WbNheader3WCFont, wrapFont(GetFontName(Rdata.header3FontSet, "iso8859-7")));
      XmxSetArg (WbNheader4WCFont, wrapFont(GetFontName(Rdata.header4FontSet, "iso8859-7")));
      XmxSetArg (WbNheader5WCFont, wrapFont(GetFontName(Rdata.header5FontSet, "iso8859-7")));
      XmxSetArg (WbNheader6WCFont, wrapFont(GetFontName(Rdata.header6FontSet, "iso8859-7")));
      XmxSetArg (WbNaddressWCFont, wrapFont(GetFontName(Rdata.addressFontSet, "iso8859-7")));
      XmxSetArg (WbNplainWCFont, wrapFont(GetFontName(Rdata.plainFontSet, "iso8859-7")));
      XmxSetArg (WbNplainboldWCFont, wrapFont(GetFontName(Rdata.plainboldFontSet, "iso8859-7")));
      XmxSetArg (WbNplainitalicWCFont, wrapFont(GetFontName(Rdata.plainitalicFontSet, "iso8859-7")));
      XmxSetArg (WbNsupSubWCFont, wrapFont(GetFontName(Rdata.supSubFontSet, "iso8859-7")));
      XmxSetArg (WbNcharsetInfo, CS_ISO_8859_7);
      XmxSetValues (win->scrolled_win);
      win->font_family = 0;
      break;
    case mo_charset_iso_8859_8:
      XmxSetArg (XtNfont, wrapFont(GetFontName(Rdata.FontSet, "iso8859-8")));
      XmxSetArg (WbNitalicFont, wrapFont(GetFontName(Rdata.italicFontSet, "iso8859-8")));
      XmxSetArg (WbNboldFont, wrapFont(GetFontName(Rdata.boldFontSet, "iso8859-8")));
      XmxSetArg (WbNfixedFont, wrapFont(GetFontName(Rdata.fixedFontSet, "iso8859-8")));
      XmxSetArg (WbNfixedboldFont, wrapFont(GetFontName(Rdata.fixedboldFontSet, "iso8859-8")));
      XmxSetArg (WbNfixeditalicFont, wrapFont(GetFontName(Rdata.fixeditalicFontSet, "iso8859-8")));
      XmxSetArg (WbNheader1Font, wrapFont(GetFontName(Rdata.header1FontSet, "iso8859-8")));
      XmxSetArg (WbNheader2Font, wrapFont(GetFontName(Rdata.header2FontSet, "iso8859-8")));
      XmxSetArg (WbNheader3Font, wrapFont(GetFontName(Rdata.header3FontSet, "iso8859-8")));
      XmxSetArg (WbNheader4Font, wrapFont(GetFontName(Rdata.header4FontSet, "iso8859-8")));
      XmxSetArg (WbNheader5Font, wrapFont(GetFontName(Rdata.header5FontSet, "iso8859-8")));
      XmxSetArg (WbNheader6Font, wrapFont(GetFontName(Rdata.header6FontSet, "iso8859-8")));
      XmxSetArg (WbNaddressFont, wrapFont(GetFontName(Rdata.addressFontSet, "iso8859-8")));
      XmxSetArg (WbNplainFont, wrapFont(GetFontName(Rdata.plainFontSet, "iso8859-8")));
      XmxSetArg (WbNplainboldFont, wrapFont(GetFontName(Rdata.plainboldFontSet, "iso8859-8")));
      XmxSetArg (WbNplainitalicFont, wrapFont(GetFontName(Rdata.plainitalicFontSet, "iso8859-8")));
      XmxSetArg (WbNsupSubFont, wrapFont(GetFontName(Rdata.supSubFontSet, "iso8859-8")));
      XmxSetArg (WbNWCfont, wrapFont(GetFontName(Rdata.FontSet, "iso8859-8")));
      XmxSetArg (WbNitalicWCFont, wrapFont(GetFontName(Rdata.italicFontSet, "iso8859-8")));
      XmxSetArg (WbNboldWCFont, wrapFont(GetFontName(Rdata.boldFontSet, "iso8859-8")));
      XmxSetArg (WbNfixedWCFont, wrapFont(GetFontName(Rdata.fixedFontSet, "iso8859-8")));
      XmxSetArg (WbNfixedboldWCFont, wrapFont(GetFontName(Rdata.fixedboldFontSet, "iso8859-8")));
      XmxSetArg (WbNfixeditalicWCFont, wrapFont(GetFontName(Rdata.fixeditalicFontSet, "iso8859-8")));
      XmxSetArg (WbNheader1WCFont, wrapFont(GetFontName(Rdata.header1FontSet, "iso8859-8")));
      XmxSetArg (WbNheader2WCFont, wrapFont(GetFontName(Rdata.header2FontSet, "iso8859-8")));
      XmxSetArg (WbNheader3WCFont, wrapFont(GetFontName(Rdata.header3FontSet, "iso8859-8")));
      XmxSetArg (WbNheader4WCFont, wrapFont(GetFontName(Rdata.header4FontSet, "iso8859-8")));
      XmxSetArg (WbNheader5WCFont, wrapFont(GetFontName(Rdata.header5FontSet, "iso8859-8")));
      XmxSetArg (WbNheader6WCFont, wrapFont(GetFontName(Rdata.header6FontSet, "iso8859-8")));
      XmxSetArg (WbNaddressWCFont, wrapFont(GetFontName(Rdata.addressFontSet, "iso8859-8")));
      XmxSetArg (WbNplainWCFont, wrapFont(GetFontName(Rdata.plainFontSet, "iso8859-8")));
      XmxSetArg (WbNplainboldWCFont, wrapFont(GetFontName(Rdata.plainboldFontSet, "iso8859-8")));
      XmxSetArg (WbNplainitalicWCFont, wrapFont(GetFontName(Rdata.plainitalicFontSet, "iso8859-8")));
      XmxSetArg (WbNsupSubWCFont, wrapFont(GetFontName(Rdata.supSubFontSet, "iso8859-8")));
      XmxSetArg (WbNcharsetInfo, CS_ISO_8859_8);
      XmxSetValues (win->scrolled_win);
      win->font_family = 0;
      break;
    case mo_charset_iso_8859_9:
      XmxSetArg (XtNfont, wrapFont(GetFontName(Rdata.FontSet, "iso8859-9")));
      XmxSetArg (WbNitalicFont, wrapFont(GetFontName(Rdata.italicFontSet, "iso8859-9")));
      XmxSetArg (WbNboldFont, wrapFont(GetFontName(Rdata.boldFontSet, "iso8859-9")));
      XmxSetArg (WbNfixedFont, wrapFont(GetFontName(Rdata.fixedFontSet, "iso8859-9")));
      XmxSetArg (WbNfixedboldFont, wrapFont(GetFontName(Rdata.fixedboldFontSet, "iso8859-9")));
      XmxSetArg (WbNfixeditalicFont, wrapFont(GetFontName(Rdata.fixeditalicFontSet, "iso8859-9")));
      XmxSetArg (WbNheader1Font, wrapFont(GetFontName(Rdata.header1FontSet, "iso8859-9")));
      XmxSetArg (WbNheader2Font, wrapFont(GetFontName(Rdata.header2FontSet, "iso8859-9")));
      XmxSetArg (WbNheader3Font, wrapFont(GetFontName(Rdata.header3FontSet, "iso8859-9")));
      XmxSetArg (WbNheader4Font, wrapFont(GetFontName(Rdata.header4FontSet, "iso8859-9")));
      XmxSetArg (WbNheader5Font, wrapFont(GetFontName(Rdata.header5FontSet, "iso8859-9")));
      XmxSetArg (WbNheader6Font, wrapFont(GetFontName(Rdata.header6FontSet, "iso8859-9")));
      XmxSetArg (WbNaddressFont, wrapFont(GetFontName(Rdata.addressFontSet, "iso8859-9")));
      XmxSetArg (WbNplainFont, wrapFont(GetFontName(Rdata.plainFontSet, "iso8859-9")));
      XmxSetArg (WbNplainboldFont, wrapFont(GetFontName(Rdata.plainboldFontSet, "iso8859-9")));
      XmxSetArg (WbNplainitalicFont, wrapFont(GetFontName(Rdata.plainitalicFontSet, "iso8859-9")));
      XmxSetArg (WbNsupSubFont, wrapFont(GetFontName(Rdata.supSubFontSet, "iso8859-9")));
      XmxSetArg (WbNWCfont, wrapFont(GetFontName(Rdata.FontSet, "iso8859-9")));
      XmxSetArg (WbNitalicWCFont, wrapFont(GetFontName(Rdata.italicFontSet, "is8859-9")));
      XmxSetArg (WbNboldWCFont, wrapFont(GetFontName(Rdata.boldFontSet, "iso8859-9")));
      XmxSetArg (WbNfixedWCFont, wrapFont(GetFontName(Rdata.fixedFontSet, "iso8859-9")));
      XmxSetArg (WbNfixedboldWCFont, wrapFont(GetFontName(Rdata.fixedboldFontSet, "iso8859-9")));
      XmxSetArg (WbNfixeditalicWCFont, wrapFont(GetFontName(Rdata.fixeditalicFontSet, "iso8859-9")));
      XmxSetArg (WbNheader1WCFont, wrapFont(GetFontName(Rdata.header1FontSet, "iso8859-9")));
      XmxSetArg (WbNheader2WCFont, wrapFont(GetFontName(Rdata.header2FontSet, "iso8859-9")));
      XmxSetArg (WbNheader3WCFont, wrapFont(GetFontName(Rdata.header3FontSet, "iso8859-9")));
      XmxSetArg (WbNheader4WCFont, wrapFont(GetFontName(Rdata.header4FontSet, "iso8859-9")));
      XmxSetArg (WbNheader5WCFont, wrapFont(GetFontName(Rdata.header5FontSet, "iso8859-9")));
      XmxSetArg (WbNheader6WCFont, wrapFont(GetFontName(Rdata.header6FontSet, "iso8859-9")));
      XmxSetArg (WbNaddressWCFont, wrapFont(GetFontName(Rdata.addressFontSet, "iso8859-9")));
      XmxSetArg (WbNplainWCFont, wrapFont(GetFontName(Rdata.plainFontSet, "iso8859-9")));
      XmxSetArg (WbNplainboldWCFont, wrapFont(GetFontName(Rdata.plainboldFontSet, "iso8859-9")));
      XmxSetArg (WbNplainitalicWCFont, wrapFont(GetFontName(Rdata.plainitalicFontSet, "iso8859-9")));
      XmxSetArg (WbNsupSubWCFont, wrapFont(GetFontName(Rdata.supSubFontSet, "iso8859-9")));
      XmxSetArg (WbNcharsetInfo, CS_ISO_8859_9);
      XmxSetValues (win->scrolled_win);
      win->font_family = 0;
      break;
    case mo_charset_koi8:
      XmxSetArg (XtNfont, wrapFont(GetFontName(Rdata.FontSet, "koi-1")));
      XmxSetArg (WbNitalicFont, wrapFont(GetFontName(Rdata.italicFontSet, "koi-1")));
      XmxSetArg (WbNboldFont, wrapFont(GetFontName(Rdata.boldFontSet, "koi-1")));
      XmxSetArg (WbNfixedFont, wrapFont(GetFontName(Rdata.fixedFontSet, "koi-1")));
      XmxSetArg (WbNfixedboldFont, wrapFont(GetFontName(Rdata.fixedboldFontSet, "koi-1")));
      XmxSetArg (WbNfixeditalicFont, wrapFont(GetFontName(Rdata.fixeditalicFontSet, "koi-1")));
      XmxSetArg (WbNheader1Font, wrapFont(GetFontName(Rdata.header1FontSet, "koi-1")));
      XmxSetArg (WbNheader2Font, wrapFont(GetFontName(Rdata.header2FontSet, "koi-1")));
      XmxSetArg (WbNheader3Font, wrapFont(GetFontName(Rdata.header3FontSet, "koi-1")));
      XmxSetArg (WbNheader4Font, wrapFont(GetFontName(Rdata.header4FontSet, "koi-1")));
      XmxSetArg (WbNheader5Font, wrapFont(GetFontName(Rdata.header5FontSet, "koi-1")));
      XmxSetArg (WbNheader6Font, wrapFont(GetFontName(Rdata.header6FontSet, "koi-1")));
      XmxSetArg (WbNaddressFont, wrapFont(GetFontName(Rdata.addressFontSet, "koi-1")));
      XmxSetArg (WbNplainFont, wrapFont(GetFontName(Rdata.plainFontSet, "koi-1")));
      XmxSetArg (WbNplainboldFont, wrapFont(GetFontName(Rdata.plainboldFontSet, "koi-1")));
      XmxSetArg (WbNplainitalicFont, wrapFont(GetFontName(Rdata.plainitalicFontSet, "koi-1")));
      XmxSetArg (WbNsupSubFont, wrapFont(GetFontName(Rdata.supSubFontSet, "koi-1")));
      XmxSetArg (WbNWCfont, wrapFont(GetFontName(Rdata.FontSet, "koi-1")));
      XmxSetArg (WbNitalicWCFont, wrapFont(GetFontName(Rdata.italicFontSet, "koi-1")));
      XmxSetArg (WbNboldWCFont, wrapFont(GetFontName(Rdata.boldFontSet, "koi-1")));
      XmxSetArg (WbNfixedWCFont, wrapFont(GetFontName(Rdata.fixedFontSet, "koi-1")));
      XmxSetArg (WbNfixedboldWCFont, wrapFont(GetFontName(Rdata.fixedboldFontSet, "koi-1")));
      XmxSetArg (WbNfixeditalicWCFont, wrapFont(GetFontName(Rdata.fixeditalicFontSet, "koi-1")));
      XmxSetArg (WbNheader1WCFont, wrapFont(GetFontName(Rdata.header1FontSet, "koi-1")));
      XmxSetArg (WbNheader2WCFont, wrapFont(GetFontName(Rdata.header2FontSet, "koi-1")));
      XmxSetArg (WbNheader3WCFont, wrapFont(GetFontName(Rdata.header3FontSet, "koi-1")));
      XmxSetArg (WbNheader4WCFont, wrapFont(GetFontName(Rdata.header4FontSet, "koi-1")));
      XmxSetArg (WbNheader5WCFont, wrapFont(GetFontName(Rdata.header5FontSet, "koi-1")));
      XmxSetArg (WbNheader6WCFont, wrapFont(GetFontName(Rdata.header6FontSet, "koi-1")));
      XmxSetArg (WbNaddressWCFont, wrapFont(GetFontName(Rdata.addressFontSet, "koi-1")));
      XmxSetArg (WbNplainWCFont, wrapFont(GetFontName(Rdata.plainFontSet, "koi-1")));
      XmxSetArg (WbNplainboldWCFont, wrapFont(GetFontName(Rdata.plainboldFontSet, "koi-1")));
      XmxSetArg (WbNplainitalicWCFont, wrapFont(GetFontName(Rdata.plainitalicFontSet, "koi-1")));
      XmxSetArg (WbNsupSubWCFont, wrapFont(GetFontName(Rdata.supSubFontSet, "koi-1")));
      XmxSetArg (WbNcharsetInfo, CS_KOI8);
      XmxSetValues (win->scrolled_win);
      win->font_family = 0;
      break;
    case mo_charset_jis:
      XmxSetArg (XtNfont, wrapFont(GetFontName(Rdata.FontSet, "iso8859-1")));
      XmxSetArg (WbNitalicFont, wrapFont(GetFontName(Rdata.italicFontSet, "iso8859-1")));
      XmxSetArg (WbNboldFont, wrapFont(GetFontName(Rdata.boldFontSet, "iso8859-1")));
      XmxSetArg (WbNfixedFont, wrapFont(GetFontName(Rdata.fixedFontSet, "iso8859-1")));
      XmxSetArg (WbNfixedboldFont, wrapFont(GetFontName(Rdata.fixedboldFontSet, "iso8859-1")));
      XmxSetArg (WbNfixeditalicFont, wrapFont(GetFontName(Rdata.fixeditalicFontSet, "iso8859-1")));
      XmxSetArg (WbNheader1Font, wrapFont(GetFontName(Rdata.header1FontSet, "iso8859-1")));
      XmxSetArg (WbNheader2Font, wrapFont(GetFontName(Rdata.header2FontSet, "iso8859-1")));
      XmxSetArg (WbNheader3Font, wrapFont(GetFontName(Rdata.header3FontSet, "iso8859-1")));
      XmxSetArg (WbNheader4Font, wrapFont(GetFontName(Rdata.header4FontSet, "iso8859-1")));
      XmxSetArg (WbNheader5Font, wrapFont(GetFontName(Rdata.header5FontSet, "iso8859-1")));
      XmxSetArg (WbNheader6Font, wrapFont(GetFontName(Rdata.header6FontSet, "iso8859-1")));
      XmxSetArg (WbNaddressFont, wrapFont(GetFontName(Rdata.addressFontSet, "iso8859-1")));
      XmxSetArg (WbNplainFont, wrapFont(GetFontName(Rdata.plainFontSet, "iso8859-1")));
      XmxSetArg (WbNplainboldFont, wrapFont(GetFontName(Rdata.plainboldFontSet, "iso8859-1")));
      XmxSetArg (WbNplainitalicFont, wrapFont(GetFontName(Rdata.plainitalicFontSet, "iso8859-1")));
      XmxSetArg (WbNsupSubFont, wrapFont(GetFontName(Rdata.supSubFontSet, "iso8859-1")));
      /* Wide Character will be treated as JIS X 0208 (Japanese) */
      XmxSetArg (WbNWCfont, wrapFont(GetFontName(Rdata.FontSet, "jisx0208")));
      XmxSetArg (WbNitalicWCFont, wrapFont(GetFontName(Rdata.italicFontSet, "jisx0208")));
      XmxSetArg (WbNboldWCFont, wrapFont(GetFontName(Rdata.boldFontSet, "jisx0208")));
      XmxSetArg (WbNfixedWCFont, wrapFont(GetFontName(Rdata.fixedFontSet, "jisx0208")));
      XmxSetArg (WbNfixedboldWCFont, wrapFont(GetFontName(Rdata.fixedboldFontSet, "jisx0208")));
      XmxSetArg (WbNfixeditalicWCFont, wrapFont(GetFontName(Rdata.fixeditalicFontSet, "jisx0208")));
      XmxSetArg (WbNheader1WCFont, wrapFont(GetFontName(Rdata.header1FontSet, "jisx0208")));
      XmxSetArg (WbNheader2WCFont, wrapFont(GetFontName(Rdata.header2FontSet, "jisx0208")));
      XmxSetArg (WbNheader3WCFont, wrapFont(GetFontName(Rdata.header3FontSet, "jisx0208")));
      XmxSetArg (WbNheader4WCFont, wrapFont(GetFontName(Rdata.header4FontSet, "jisx0208")));
      XmxSetArg (WbNheader5WCFont, wrapFont(GetFontName(Rdata.header5FontSet, "jisx0208")));
      XmxSetArg (WbNheader6WCFont, wrapFont(GetFontName(Rdata.header6FontSet, "jisx0208")));
      XmxSetArg (WbNaddressWCFont, wrapFont(GetFontName(Rdata.addressFontSet, "jisx0208")));
      XmxSetArg (WbNplainWCFont, wrapFont(GetFontName(Rdata.plainFontSet, "jisx0208")));
      XmxSetArg (WbNplainboldWCFont, wrapFont(GetFontName(Rdata.plainboldFontSet, "jisx0208")));
      XmxSetArg (WbNplainitalicWCFont, wrapFont(GetFontName(Rdata.plainitalicFontSet, "jisx0208")));
      XmxSetArg (WbNsupSubWCFont, wrapFont(GetFontName(Rdata.supSubFontSet, "jisx0208")));
      XmxSetArg (WbNcharsetInfo, CS_JIS);
      XmxSetValues (win->scrolled_win);
      win->font_family = 0;
      break;
    case mo_charset_gb:
    case mo_charset_hz:
      XmxSetArg (XtNfont, wrapFont(GetFontName(Rdata.FontSet, "iso8859-1")));
      XmxSetArg (WbNitalicFont, wrapFont(GetFontName(Rdata.italicFontSet, "iso8859-1")));
      XmxSetArg (WbNboldFont, wrapFont(GetFontName(Rdata.boldFontSet, "iso8859-1")));
      XmxSetArg (WbNfixedFont, wrapFont(GetFontName(Rdata.fixedFontSet, "iso8859-1")));
      XmxSetArg (WbNfixedboldFont, wrapFont(GetFontName(Rdata.fixedboldFontSet, "iso8859-1")));
      XmxSetArg (WbNfixeditalicFont, wrapFont(GetFontName(Rdata.fixeditalicFontSet, "iso8859-1")));
      XmxSetArg (WbNheader1Font, wrapFont(GetFontName(Rdata.header1FontSet, "iso8859-1")));
      XmxSetArg (WbNheader2Font, wrapFont(GetFontName(Rdata.header2FontSet, "iso8859-1")));
      XmxSetArg (WbNheader3Font, wrapFont(GetFontName(Rdata.header3FontSet, "iso8859-1")));
      XmxSetArg (WbNheader4Font, wrapFont(GetFontName(Rdata.header4FontSet, "iso8859-1")));
      XmxSetArg (WbNheader5Font, wrapFont(GetFontName(Rdata.header5FontSet, "iso8859-1")));
      XmxSetArg (WbNheader6Font, wrapFont(GetFontName(Rdata.header6FontSet, "iso8859-1")));
      XmxSetArg (WbNaddressFont, wrapFont(GetFontName(Rdata.addressFontSet, "iso8859-1")));
      XmxSetArg (WbNplainFont, wrapFont(GetFontName(Rdata.plainFontSet, "iso8859-1")));
      XmxSetArg (WbNplainboldFont, wrapFont(GetFontName(Rdata.plainboldFontSet, "iso8859-1")));
      XmxSetArg (WbNplainitalicFont, wrapFont(GetFontName(Rdata.plainitalicFontSet, "iso8859-1")));
      XmxSetArg (WbNsupSubFont, wrapFont(GetFontName(Rdata.supSubFontSet, "iso8859-1")));
      /* Wide Character will be treated as GB 2312/GB-encoding (Chinese) */
      XmxSetArg (WbNWCfont, wrapFont(GetFontName(Rdata.FontSet, "gb2312")));
      XmxSetArg (WbNitalicWCFont, wrapFont(GetFontName(Rdata.italicFontSet, "gb2312")));
      XmxSetArg (WbNboldWCFont, wrapFont(GetFontName(Rdata.boldFontSet, "gb2312")));
      XmxSetArg (WbNfixedWCFont, wrapFont(GetFontName(Rdata.fixedFontSet, "gb2312")));
      XmxSetArg (WbNfixedboldWCFont, wrapFont(GetFontName(Rdata.fixedboldFontSet, "gb2312")));
      XmxSetArg (WbNfixeditalicWCFont, wrapFont(GetFontName(Rdata.fixeditalicFontSet, "gb2312")));
      XmxSetArg (WbNheader1WCFont, wrapFont(GetFontName(Rdata.header1FontSet, "gb2312")));
      XmxSetArg (WbNheader2WCFont, wrapFont(GetFontName(Rdata.header2FontSet, "gb2312")));
      XmxSetArg (WbNheader3WCFont, wrapFont(GetFontName(Rdata.header3FontSet, "gb2312")));
      XmxSetArg (WbNheader4WCFont, wrapFont(GetFontName(Rdata.header4FontSet, "gb2312")));
      XmxSetArg (WbNheader5WCFont, wrapFont(GetFontName(Rdata.header5FontSet, "gb2312")));
      XmxSetArg (WbNheader6WCFont, wrapFont(GetFontName(Rdata.header6FontSet, "gb2312")));
      XmxSetArg (WbNaddressWCFont, wrapFont(GetFontName(Rdata.addressFontSet, "gb2312")));
      XmxSetArg (WbNplainWCFont, wrapFont(GetFontName(Rdata.plainFontSet, "gb2312")));
      XmxSetArg (WbNplainboldWCFont, wrapFont(GetFontName(Rdata.plainboldFontSet, "gb2312")));
      XmxSetArg (WbNplainitalicWCFont, wrapFont(GetFontName(Rdata.plainitalicFontSet, "gb2312")));
      XmxSetArg (WbNsupSubWCFont, wrapFont(GetFontName(Rdata.supSubFontSet, "gb2312")));
      if (size == mo_charset_gb)
       XmxSetArg (WbNcharsetInfo, CS_GB);
      else
       XmxSetArg (WbNcharsetInfo, CS_HZ);
      XmxSetValues (win->scrolled_win);
      win->font_family = 0;
      break;
    case mo_charset_big5:
      XmxSetArg (XtNfont, wrapFont(GetFontName(Rdata.FontSet, "iso8859-1")));
      XmxSetArg (WbNitalicFont, wrapFont(GetFontName(Rdata.italicFontSet, "iso8859-1")));
      XmxSetArg (WbNboldFont, wrapFont(GetFontName(Rdata.boldFontSet, "iso8859-1")));
      XmxSetArg (WbNfixedFont, wrapFont(GetFontName(Rdata.fixedFontSet, "iso8859-1")));
      XmxSetArg (WbNfixedboldFont, wrapFont(GetFontName(Rdata.fixedboldFontSet, "iso8859-1")));
      XmxSetArg (WbNfixeditalicFont, wrapFont(GetFontName(Rdata.fixeditalicFontSet, "iso8859-1")));
      XmxSetArg (WbNheader1Font, wrapFont(GetFontName(Rdata.header1FontSet, "iso8859-1")));
      XmxSetArg (WbNheader2Font, wrapFont(GetFontName(Rdata.header2FontSet, "iso8859-1")));
      XmxSetArg (WbNheader3Font, wrapFont(GetFontName(Rdata.header3FontSet, "iso8859-1")));
      XmxSetArg (WbNheader4Font, wrapFont(GetFontName(Rdata.header4FontSet, "iso8859-1")));
      XmxSetArg (WbNheader5Font, wrapFont(GetFontName(Rdata.header5FontSet, "iso8859-1")));
      XmxSetArg (WbNheader6Font, wrapFont(GetFontName(Rdata.header6FontSet, "iso8859-1")));
      XmxSetArg (WbNaddressFont, wrapFont(GetFontName(Rdata.addressFontSet, "iso8859-1")));
      XmxSetArg (WbNplainFont, wrapFont(GetFontName(Rdata.plainFontSet, "iso8859-1")));
      XmxSetArg (WbNplainboldFont, wrapFont(GetFontName(Rdata.plainboldFontSet, "iso8859-1")));
      XmxSetArg (WbNplainitalicFont, wrapFont(GetFontName(Rdata.plainitalicFontSet, "iso8859-1")));
      XmxSetArg (WbNsupSubFont, wrapFont(GetFontName(Rdata.supSubFontSet, "iso8859-1")));
      /* Wide Character will be treated as Big5 (Chinese) */
      XmxSetArg (WbNWCfont, wrapFont(GetFontName(Rdata.FontSet, "big5")));
      XmxSetArg (WbNitalicWCFont, wrapFont(GetFontName(Rdata.italicFontSet, "big5")));
      XmxSetArg (WbNboldWCFont, wrapFont(GetFontName(Rdata.boldFontSet, "big5")));
      XmxSetArg (WbNfixedWCFont, wrapFont(GetFontName(Rdata.fixedFontSet, "big5")));
      XmxSetArg (WbNfixedboldWCFont, wrapFont(GetFontName(Rdata.fixedboldFontSet, "big5")));
      XmxSetArg (WbNfixeditalicWCFont, wrapFont(GetFontName(Rdata.fixeditalicFontSet, "big5")));
      XmxSetArg (WbNheader1WCFont, wrapFont(GetFontName(Rdata.header1FontSet, "big5")));
      XmxSetArg (WbNheader2WCFont, wrapFont(GetFontName(Rdata.header2FontSet, "big5")));
      XmxSetArg (WbNheader3WCFont, wrapFont(GetFontName(Rdata.header3FontSet, "big5")));
      XmxSetArg (WbNheader4WCFont, wrapFont(GetFontName(Rdata.header4FontSet, "big5")));
      XmxSetArg (WbNheader5WCFont, wrapFont(GetFontName(Rdata.header5FontSet, "big5")));
      XmxSetArg (WbNheader6WCFont, wrapFont(GetFontName(Rdata.header6FontSet, "big5")));
      XmxSetArg (WbNaddressWCFont, wrapFont(GetFontName(Rdata.addressFontSet, "big5")));
      XmxSetArg (WbNplainWCFont, wrapFont(GetFontName(Rdata.plainFontSet, "big5")));
      XmxSetArg (WbNplainboldWCFont, wrapFont(GetFontName(Rdata.plainboldFontSet, "big5")));
      XmxSetArg (WbNplainitalicWCFont, wrapFont(GetFontName(Rdata.plainitalicFontSet, "big5")));
      XmxSetArg (WbNsupSubWCFont, wrapFont(GetFontName(Rdata.supSubFontSet, "big5")));
      XmxSetArg (WbNcharsetInfo, CS_Big5);
      XmxSetValues (win->scrolled_win);
      win->font_family = 0;
      break;
    case mo_charset_ksc:
      XmxSetArg (XtNfont, wrapFont(GetFontName(Rdata.FontSet, "iso8859-1")));
      XmxSetArg (WbNitalicFont, wrapFont(GetFontName(Rdata.italicFontSet, "iso8859-1")));
      XmxSetArg (WbNboldFont, wrapFont(GetFontName(Rdata.boldFontSet, "iso8859-1")));
      XmxSetArg (WbNfixedFont, wrapFont(GetFontName(Rdata.fixedFontSet, "iso8859-1")));
      XmxSetArg (WbNfixedboldFont, wrapFont(GetFontName(Rdata.fixedboldFontSet, "iso8859-1")));
      XmxSetArg (WbNfixeditalicFont, wrapFont(GetFontName(Rdata.fixeditalicFontSet, "iso8859-1")));
      XmxSetArg (WbNheader1Font, wrapFont(GetFontName(Rdata.header1FontSet, "iso8859-1")));
      XmxSetArg (WbNheader2Font, wrapFont(GetFontName(Rdata.header2FontSet, "iso8859-1")));
      XmxSetArg (WbNheader3Font, wrapFont(GetFontName(Rdata.header3FontSet, "iso8859-1")));
      XmxSetArg (WbNheader4Font, wrapFont(GetFontName(Rdata.header4FontSet, "iso8859-1")));
      XmxSetArg (WbNheader5Font, wrapFont(GetFontName(Rdata.header5FontSet, "iso8859-1")));
      XmxSetArg (WbNheader6Font, wrapFont(GetFontName(Rdata.header6FontSet, "iso8859-1")));
      XmxSetArg (WbNaddressFont, wrapFont(GetFontName(Rdata.addressFontSet, "iso8859-1")));
      XmxSetArg (WbNplainFont, wrapFont(GetFontName(Rdata.plainFontSet, "iso8859-1")));
      XmxSetArg (WbNplainboldFont, wrapFont(GetFontName(Rdata.plainboldFontSet, "iso8859-1")));
      XmxSetArg (WbNplainitalicFont, wrapFont(GetFontName(Rdata.plainitalicFontSet, "iso8859-1")));
      XmxSetArg (WbNsupSubFont, wrapFont(GetFontName(Rdata.supSubFontSet, "iso8859-1")));
      /* Wide Character will be treated as KSC 5601 (Korean) */
      XmxSetArg (WbNWCfont, wrapFont(GetFontName(Rdata.FontSet, "ksc5601")));
      XmxSetArg (WbNitalicWCFont, wrapFont(GetFontName(Rdata.italicFontSet, "ksc5601")));
      XmxSetArg (WbNboldWCFont, wrapFont(GetFontName(Rdata.boldFontSet, "ksc5601")));
      XmxSetArg (WbNfixedWCFont, wrapFont(GetFontName(Rdata.fixedFontSet, "ksc5601")));
      XmxSetArg (WbNfixedboldWCFont, wrapFont(GetFontName(Rdata.fixedboldFontSet, "ksc5601")));
      XmxSetArg (WbNfixeditalicWCFont, wrapFont(GetFontName(Rdata.fixeditalicFontSet, "ksc5601")));
      XmxSetArg (WbNheader1WCFont, wrapFont(GetFontName(Rdata.header1FontSet, "ksc5601")));
      XmxSetArg (WbNheader2WCFont, wrapFont(GetFontName(Rdata.header2FontSet, "ksc5601")));
      XmxSetArg (WbNheader3WCFont, wrapFont(GetFontName(Rdata.header3FontSet, "ksc5601")));
      XmxSetArg (WbNheader4WCFont, wrapFont(GetFontName(Rdata.header4FontSet, "ksc5601")));
      XmxSetArg (WbNheader5WCFont, wrapFont(GetFontName(Rdata.header5FontSet, "ksc5601")));
      XmxSetArg (WbNheader6WCFont, wrapFont(GetFontName(Rdata.header6FontSet, "ksc5601")));
      XmxSetArg (WbNaddressWCFont, wrapFont(GetFontName(Rdata.addressFontSet, "ksc5601")));
      XmxSetArg (WbNplainWCFont, wrapFont(GetFontName(Rdata.plainFontSet, "ksc5601")));
      XmxSetArg (WbNplainboldWCFont, wrapFont(GetFontName(Rdata.plainboldFontSet, "ksc5601")));
      XmxSetArg (WbNplainitalicWCFont, wrapFont(GetFontName(Rdata.plainitalicFontSet, "ksc5601")));
      XmxSetArg (WbNsupSubWCFont, wrapFont(GetFontName(Rdata.supSubFontSet, "ksc5601")));
      XmxSetArg (WbNcharsetInfo, CS_KSC);
      XmxSetValues (win->scrolled_win);
      win->font_family = 0;
      break;
#endif /* L10N */
    }

  XmxRSetToggleState (win->menubar, win->font_size, XmxNotSet);
  XmxRSetToggleState (win->menubar, size, XmxSet);

  win->font_size = size;

  return mo_succeed;
}

#ifdef L10N

XmFontList
wrapFontList(int size)
{
  char *charset1, *charset2;
  char *fname1, *fname2;
  XFontStruct *fstruct1, *fstruct2;
#ifdef OPENWARE
  XFontStruct *fstruct3;
#endif /* OPENWARE */
#ifdef IXIMOTIF1_2
  XmFontType type;
  XmFontListEntry fle;
#endif /* IXIMOTIF1_2 */

  XmFontList flist;

  /* choose  font list */
  switch (size) {
  case mo_charset_iso_8859_2:
    charset1 = charset2 = "ISO8859-2";
    fname1 = fname2 = GetFontName(Rdata.textfieldFontSet, "iso8859-2");
    break;
  case mo_charset_iso_8859_3:
    charset1 = charset2 = "ISO8859-3";
    fname1 = fname2 = GetFontName(Rdata.textfieldFontSet, "iso8859-3");
    break;
  case mo_charset_iso_8859_4:
    charset1 = charset2 = "ISO8859-4";
    fname1 = fname2 = GetFontName(Rdata.textfieldFontSet, "iso8859-4");
    break;
  case mo_charset_iso_8859_5:
    charset1 = charset2 = "ISO8859-5";
    fname1 = fname2 = GetFontName(Rdata.textfieldFontSet, "iso8859-5");
    break;
  case mo_charset_iso_8859_7:
    charset1 = charset2 = "ISO8859-7";
    fname1 = fname2 = GetFontName(Rdata.textfieldFontSet, "iso8859-7");
    break;
  case mo_charset_iso_8859_8:
    charset1 = charset2 = "ISO8859-8";
    fname1 = fname2 = GetFontName(Rdata.textfieldFontSet, "iso8859-8");
    break;
  case mo_charset_iso_8859_9:
    charset1 = charset2 = "ISO8859-9";
    fname1 = fname2 = GetFontName(Rdata.textfieldFontSet, "iso8859-9");
    break;
  case mo_charset_koi8:
    charset1 = charset2 = "KOI-1";
    fname1 = fname2 = GetFontName(Rdata.textfieldFontSet, "koi-1");
    break;
  case mo_charset_jis:
    charset1 = "ISO8859-1";
#ifdef JDEC
    charset2 = "JISX0208.1983-1";
#else /* JDEC */
    charset2 = "JISX0208.1983-0";
#endif /* JDEC */
    fname1 = GetFontName(Rdata.textfieldFontSet, "iso8859-1");
    fname2 = GetFontName(Rdata.textfieldFontSet, "jisx0208");
    break;
  case mo_charset_gb:
  case mo_charset_hz:
    charset1 = "ISO8859-1";
    charset2 = "GB2312.1980-0";
    fname1 = GetFontName(Rdata.textfieldFontSet, "iso8859-1");
    fname2 = GetFontName(Rdata.textfieldFontSet, "gb2312");
    break;
  case mo_charset_big5:
    charset1 = "ISO8859-1";
    charset2 = "BIG5-0";
    fname1 = GetFontName(Rdata.textfieldFontSet, "iso8859-1");
    fname2 = GetFontName(Rdata.textfieldFontSet, "big5");
    break;
  case mo_charset_ksc:
    charset1 = "ISO8859-1";
    charset2 = "KSC5601.1987-0";
    fname1 = GetFontName(Rdata.textfieldFontSet, "iso8859-1");
    fname2 = GetFontName(Rdata.textfieldFontSet, "ksc5601");
    break;
  case mo_large_fonts:
  case mo_regular_fonts:
  case mo_small_fonts:
  case mo_large_helvetica:
  case mo_regular_helvetica:
  case mo_small_helvetica:
  case mo_large_newcentury:
  case mo_regular_newcentury:
  case mo_small_newcentury:
  case mo_large_lucidabright:
  case mo_regular_lucidabright:
  case mo_small_lucidabright:
  default:
    charset1 = charset2 = "ISO8859-1";
    fname1 = fname2 = GetFontName(Rdata.textfieldFontSet, "iso8859-1");
    break;
  }

  /* and create XmFontList */
#ifndef IXIMOTIF1_2
  if ((fstruct1 = CachedLoadQueryFont(dsp, fname1)) == (XFontStruct *)NULL) {
      fprintf(stderr, "Could not open font: '%s'\n", fname1);
      fstruct1 = CachedLoadQueryFont(dsp, "fixed");
  }
#endif /* !IXIMOTIF1_2 */
#ifdef OPENWARE
  flist = XmFontListCreate(fstruct1, (XmStringCharSet)"codeset0");
#endif /* OPENWARE */
#ifdef J_IRIX
  flist = XmFontListCreate(fstruct1, XmSTRING_DEFAULT_CHARSET);
#endif /* J_IRIX */
#if !defined(OPENWARE) && !defined(J_IRIX) && !defined(IXIMOTIF1_2)
  flist = XmFontListCreate(fstruct1, charset1);
#endif /* !OPENWARE && !J_IRIX && !IXIMOTIF1_2 */
  if ((fstruct2 = CachedLoadQueryFont(dsp, fname2)) == (XFontStruct *)NULL) {
      fprintf(stderr, "Could not open font: '%s'\n", fname2);
      fstruct2 = CachedLoadQueryFont(dsp, "fixed");
  }
#ifdef IXIMOTIF1_2
  if (strchr(fname2, ':') != NULL) type = XmFONT_IS_FONTSET;
  else type = XmFONT_IS_FONT;
  fle = XmFontListEntryCreate(XmFONTLIST_DEFAULT_TAG, type, (XtPointer)fstruct2);
  flist = XmFontListAppendEntry(NULL, fle);
  XmFontListEntryFree(&fle);
#endif /* IXIMOTIF1_2 */
#ifdef OPENWARE
  flist = XmFontListAdd(flist, fstruct2, (XmStringCharSet)"codeset1");
#endif /* OPENWARE */
#ifdef J_IRIX
  flist = XmFontListAdd(flist, fstruct2, XmSTRING_DEFAULT_CHARSET);
#endif /* J_IRIX */
#if !defined(OPENWARE) && !defined(J_IRIX) && !defined(IXIMOTIF1_2)
  flist = XmFontListAdd(flist, fstruct2, charset2);
#endif /* !OPENWARE && !J_IRIX && !IXIMOTIF1_2 */

#ifdef OPENWARE
  if ((fstruct3 = CachedLoadQueryFont(dsp, fname1)) == (XFontStruct *)NULL) {
      fprintf(stderr, "Could not open font: '%s'\n", fname1);
      fstruct3 = CachedLoadQueryFont(dsp, "fixed");
  }
  flist = XmFontListAdd(flist, fstruct3, (XmStringCharSet)"codeset2");
#endif /* OPENWARE */
#ifdef J_IRIX
  flist = XmFontListAdd(flist, fstruct1, charset1);
  flist = XmFontListAdd(flist, fstruct2, charset2);
#endif /* J_IRIX */

  return(flist);
}

mo_set_font_list(mo_window *win, int size)
{
  Arg wargs[1];

  win->font_list = wrapFontList(size);
  XtSetArg(wargs[0], XmNfontList, (XtArgVal)win->font_list);
  if (win->title_text)     XtSetValues(win->title_text, wargs, 1);
  if (win->url_text)       XtSetValues(win->url_text, wargs, 1);
  if (win->search_win_text) XtSetValues(win->search_win_text, wargs, 1);
 /* if (win->edithot_text)    XtSetValues(win->edithot_text, wargs, 1); */
  if (win->annotate_author) XtSetValues(win->annotate_author, wargs, 1);
  if (win->annotate_title)  XtSetValues(win->annotate_title, wargs, 1);
  if (win->history_list)    XtSetValues(win->history_list, wargs, 1);
  if (win->hotlist_list)    XtSetValues(win->hotlist_list, wargs, 1);
  if (win->source_text)            XtSetValues(win->source_text, wargs, 1);
  if (win->annotate_text)   XtSetValues(win->annotate_text, wargs, 1);
  /* Taninaka */
  if (win->news_win && win->news_text)      XtSetValues(win->news_text, wargs, 1);
  if (win->mailto_win && win->mailto_text)  XtSetValues(win->mailto_text, wargs, 1);
  /* Taninaka */
}

/* ----------------------- mo_set_bidirectionality ----------------------- */

mo_status mo_set_bidirectionality (mo_window *win, int choice)
{
  switch (choice)
    {
    case mo_bidir_visual:
      XmxSetArg (WbNbidirInfo, BIDIR_VISUAL);
      XmxSetValues (win->scrolled_win);
      break;
    case mo_bidir_implicit:
      XmxSetArg (WbNbidirInfo, BIDIR_IMPLICIT);
      XmxSetValues (win->scrolled_win);
      break;
/* Not yet supported:
    case mo_bidir_explicit:
      XmxSetArg (WbNbidirInfo, BIDIR_EXPLICIT);
      XmxSetValues (win->scrolled_win);
      break;
*/
    }

  XmxRSetToggleState (win->menubar, win->bidirectionality, XmxNotSet);
  XmxRSetToggleState (win->menubar, choice, XmxSet);
  win->bidirectionality = choice;

  return mo_succeed;
}

/* -------------------------- mo_force_font_change -------------------------- */

mo_status mo_force_font_change(mo_window *win, int size)
{
  void *to_free = NULL;

  if (win->current_node) {
    to_free = win->current_node->cached_stuff;
    win->current_node->cached_stuff = NULL;
    win->current_node->font_size = size;
  }
  XmxSetArg(WbNforceReparse, (XtArgVal)True);
  mo_set_fonts(win, size);
  if (to_free) {
    HTMLFreeWidgetInfo(to_free);
  }
}

#endif /* l10n */

/* -------------------------- mo_set_underlines --------------------------- */

mo_status mo_set_underlines (mo_window *win, int choice)
{
  if (!win->underlines_snarfed)
    {
      XtVaGetValues (win->scrolled_win,
                     WbNanchorUnderlines, &(win->underlines),
                     WbNvisitedAnchorUnderlines, &(win->visited_underlines),
                     WbNdashedAnchorUnderlines, &(win->dashed_underlines),
                     WbNdashedVisitedAnchorUnderlines, 
                     &(win->dashed_visited_underlines),
                     NULL);
      win->underlines_snarfed = 1;
    }

  switch (choice)
    {
    case mo_default_underlines:
      XmxSetArg (WbNanchorUnderlines, win->underlines);
      XmxSetArg (WbNvisitedAnchorUnderlines, win->visited_underlines);
      XmxSetArg (WbNdashedAnchorUnderlines, win->dashed_underlines);
      XmxSetArg (WbNdashedVisitedAnchorUnderlines, 
                 win->dashed_visited_underlines);
      XmxSetValues (win->scrolled_win);
      break;
    case mo_l1_underlines:
      XmxSetArg (WbNanchorUnderlines, 1);
      XmxSetArg (WbNvisitedAnchorUnderlines, 1);
      XmxSetArg (WbNdashedAnchorUnderlines, False);
      XmxSetArg (WbNdashedVisitedAnchorUnderlines, True);
      XmxSetValues (win->scrolled_win);
      break;
    case mo_l2_underlines:
      XmxSetArg (WbNanchorUnderlines, 1);
      XmxSetArg (WbNvisitedAnchorUnderlines, 1);
      XmxSetArg (WbNdashedAnchorUnderlines, False);
      XmxSetArg (WbNdashedVisitedAnchorUnderlines, False);
      XmxSetValues (win->scrolled_win);
      break;
    case mo_l3_underlines:
      XmxSetArg (WbNanchorUnderlines, 2);
      XmxSetArg (WbNvisitedAnchorUnderlines, 1);
      XmxSetArg (WbNdashedAnchorUnderlines, False);
      XmxSetArg (WbNdashedVisitedAnchorUnderlines, False);
      XmxSetValues (win->scrolled_win);
      break;
    case mo_no_underlines:
      XmxSetArg (WbNanchorUnderlines, 0);
      XmxSetArg (WbNvisitedAnchorUnderlines, 0);
      XmxSetArg (WbNdashedAnchorUnderlines, False);
      XmxSetArg (WbNdashedVisitedAnchorUnderlines, False);
      XmxSetValues (win->scrolled_win);
      break;
    }

  XmxRSetToggleState (win->menubar, win->underlines_state, XmxNotSet);
  XmxRSetToggleState (win->menubar, choice, XmxSet);
  win->underlines_state = choice;
  
  return mo_succeed;
}

/* --------------------------- exit_confirm_cb ---------------------------- */

static XmxCallback (clear_history_confirm_cb)
{
  mo_window *win = mo_fetch_window_by_id (XmxExtractUniqid ((int)client_data));

  if (XmxExtractToken ((int)client_data))
    {
      mo_window *w = NULL;
      mo_wipe_global_history (win);

      while (w = mo_next_window (w))
        mo_redisplay_window (w);
    }
  else
    XtUnmanageChild (w);
  
  return;
}

/* ----------------------- mo_do_delete_annotation ------------------------ */

/* Presumably we're on an annotation. */
static mo_status mo_do_delete_annotation (mo_window *win)
{
  char *author, *title, *text, *fname;
  int id;

  if (!win->current_node)
    return mo_fail;

  if (win->current_node->annotation_type == mo_annotation_private)
    {
      mo_grok_pan_pieces (win->current_node->url,
                          win->current_node->text,
                          &title, &author, &text, 
                          &id, &fname);
      
      mo_delete_annotation (win, id);
    }
  else if (win->current_node->annotation_type == mo_annotation_workgroup)
    {
      mo_delete_group_annotation (win, win->current_node->url);
    }

  return mo_succeed;
}

static XmxCallback (delete_annotation_confirm_cb)
{
  mo_window *win = mo_fetch_window_by_id (XmxExtractUniqid ((int)client_data));

  if (!win->current_node)
    return;

  if (!mo_is_editable_annotation (win, win->current_node->text))
    return;
  
  if (XmxExtractToken ((int)client_data))
    mo_do_delete_annotation (win);
  
  return;
}
  
/* ------------------------------ menubar_cb ------------------------------ */

extern void NNTPconfig(int viewtype);
#ifdef NEWS_SELECT
extern void NEWSconfig(int viewtype);
extern void NEWSHEADERconfig(int viewtype);
#endif /* NEWS_SELECT */

XmxCallback (menubar_cb)
{
  mo_window *win = mo_fetch_window_by_id (XmxExtractUniqid ((int)client_data));
  int i = XmxExtractToken ((int)client_data);

  switch (i)
    {
    case mo_reload_document:
      mo_reload_window_text (win, 0);
      break;
    case mo_reload_document_and_images:
      mo_reload_window_text (win, 1);
      break;
    case mo_refresh_document:
      mo_refresh_window_text (win);
      break;
    case mo_re_init:
      mo_re_init_formats ();
      break;
    case mo_clear_image_cache:
      mo_flush_image_cache (win);
      break;
    case mo_cci:
      MoDisplayCCIWindow(win);
      break;
    case mo_document_source:
      mo_post_source_window (win);
      break;
    case mo_document_edit:
      mo_edit_source(win);
      break;
    case mo_search:
      mo_post_search_window (win);
      break;
    case mo_open_document:
      mo_post_open_window (win);
      break;
    case mo_open_local_document:
      mo_post_open_local_window (win);
      break;
    case mo_save_document:
      mo_post_save_window (win);
      break;
    case mo_mail_document:
      mo_post_mail_window (win);
      break;
    case mo_print_document:
      mo_post_print_window (win);
      break;
    case mo_new_window:
      mo_open_another_window (win, home_document, NULL, NULL);
      break;
    case mo_clone_window:
      mo_duplicate_window (win);
      break;
    case mo_close_window:
      mo_delete_window (win);
      break;
    case mo_exit_program:
      mo_post_exitbox ();
      break;
#ifdef HAVE_DTM
    case mo_dtm_open_outport:
      mo_post_dtmout_window (win);
      break;
    case mo_dtm_send_document:
      mo_send_document_over_dtm (win);
      break;
#endif
    case mo_home_document:
      mo_access_document (win, home_document);
      break;
    case mo_network_starting_points:
      mo_access_document (win, NETWORK_STARTING_POINTS_DEFAULT);
      break;
    case mo_internet_metaindex:
      mo_access_document (win, INTERNET_METAINDEX_DEFAULT);
      break;
    case mo_mosaic_demopage:
      mo_open_another_window
        (win, DEMO_PAGE_DEFAULT,
         NULL, NULL);
      break;
    case mo_mosaic_manual:
      mo_open_another_window
        (win, mo_assemble_help_url ("mosaic-docs.html"),
         NULL, NULL);
      break;

    case mo_back:
      mo_back_node (win);
      break;
    case mo_forward:
      mo_forward_node (win);
      break;
    case mo_history_list:
      mo_post_history_win (win);
      break;
    case mo_clear_global_history:
      XmxSetUniqid (win->id);
      XmxMakeQuestionDialog
        (win->base, "Are you sure you want to clear the global history?",
         "NCSA Mosaic: Clear Global History", clear_history_confirm_cb, 1, 0);
      XtManageChild (Xmx_w);
      break;
    case mo_hotlist_postit:
      mo_post_hotlist_win (win);
      break;
    case mo_register_node_in_default_hotlist:
      if (win->current_node)
        {
          mo_add_node_to_current_hotlist (win);
          mo_write_default_hotlist ();
        }
      break;
    case mo_fancy_selections:
      win->pretty = 1 - win->pretty;
      mo_set_fancy_selections_toggle (win);
      HTMLClearSelection (win->scrolled_win);
      XmxSetArg (WbNfancySelections, win->pretty ? True : False);
      XmxSetValues (win->scrolled_win);
      break;
    case mo_binary_transfer:
      win->binary_transfer =
        (win->binary_transfer ? 0 : 1);
      break;
    case mo_delay_image_loads:
      win->delay_image_loads =
        (win->delay_image_loads ? 0 : 1);
      XmxSetArg (WbNdelayImageLoads, win->delay_image_loads ? True : False);
      XmxSetValues (win->scrolled_win);
      XmxRSetSensitive (win->menubar, mo_expand_images_current,
                        win->delay_image_loads ? XmxSensitive : XmxNotSensitive);
      break;
    case mo_expand_images_current:
      XmxSetArg (WbNdelayImageLoads, False);
      XmxSetValues (win->scrolled_win);
      mo_refresh_window_text (win);
      XmxSetArg (WbNdelayImageLoads, win->delay_image_loads ? True : False);
      XmxSetValues (win->scrolled_win);
      break;
    case mo_large_fonts:
    case mo_regular_fonts:
    case mo_small_fonts:
    case mo_large_helvetica:
    case mo_regular_helvetica:
    case mo_small_helvetica:
    case mo_large_newcentury:
    case mo_regular_newcentury:
    case mo_small_newcentury:
    case mo_large_lucidabright:
    case mo_regular_lucidabright:
    case mo_small_lucidabright:
#ifdef L10N
    case mo_charset_iso_8859_2:
    case mo_charset_iso_8859_3:
    case mo_charset_iso_8859_4:
    case mo_charset_iso_8859_5:
    case mo_charset_iso_8859_7:
    case mo_charset_iso_8859_8:
    case mo_charset_iso_8859_9:
    case mo_charset_koi8:
    case mo_charset_gb:
    case mo_charset_hz:
    case mo_charset_jis:
    case mo_charset_ksc:
    case mo_charset_big5:
#endif /* L10N */
#ifdef L10N
      mo_force_font_change (win, i);
#else /* L10N */
      mo_set_fonts (win, i);
#endif /* L10N */
      break;
#ifdef L10N
    case mo_bidir_visual:
    case mo_bidir_implicit:
/*  case mo_bidir_explicit: */ /* Not yet supported: */
      mo_set_bidirectionality (win, i);
      break;
    case mo_set_accept_languages:
      mo_post_accept_languages (win);
      break;
#endif /* L10N */
    case mo_default_underlines:
    case mo_l1_underlines:
    case mo_l2_underlines:
    case mo_l3_underlines:
    case mo_no_underlines:
      mo_set_underlines (win, i);
      break;
    case mo_help_about:
      mo_open_another_window
        (win, mo_assemble_help_url ("help-about.html"),
         NULL, NULL);
      break;
    case mo_help_onwindow:
      mo_open_another_window
        (win, mo_assemble_help_url ("help-on-docview-window.html"),
         NULL, NULL);
      break;
    case mo_whats_new:
      mo_open_another_window
        (win, WHATSNEW_PAGE_DEFAULT,
         NULL, NULL);
      break;
    case mo_help_onversion:
      mo_open_another_window
        (win, MO_HELP_ON_VERSION_DOCUMENT,
         NULL, NULL);
      break;
    case mo_help_faq:
      mo_open_another_window (win, mo_assemble_help_url ("mosaic-faq.html"), 
                              NULL, NULL);
      break;
    case mo_help_html:
      mo_open_another_window (win, HTMLPRIMER_PAGE_DEFAULT, 
                              NULL, NULL);
      break;
    case mo_help_url:
      mo_open_another_window (win, URLPRIMER_PAGE_DEFAULT, 
                              NULL, NULL);
      break;
    case mo_cc:
	do_comment=1;
	CommentCard(win);
      break;
    case mo_whine:
      mo_post_whine_win (win);
      break;
    case mo_annotate:
      mo_post_annotate_win (win, 0, 0, NULL, NULL, NULL, NULL);
      break;
    case mo_news_prev:
      gui_news_prev(win);
      break;
    case mo_news_next:
      gui_news_next(win);
      break;
    case mo_news_prevt:
      gui_news_prevt(win);
      break;
    case mo_news_nextt:
      gui_news_nextt(win);
      break;
    case mo_news_index:
      gui_news_index(win);
      break;
    case mo_news_list:
      gui_news_list(win);
      break;
    case mo_news_fmt0:
      NNTPconfig(0);
      XmxRSetToggleState (win->menubar, mo_news_fmt1, XmxNotSet);
      XmxRSetToggleState (win->menubar, mo_news_fmt0, XmxSet);
      break;
    case mo_news_fmt1:
      NNTPconfig(1);
      XmxRSetToggleState (win->menubar, mo_news_fmt0, XmxNotSet);
      XmxRSetToggleState (win->menubar, mo_news_fmt1, XmxSet);
      break;
#ifdef NEWS_SELECT
    case mo_news_body_fmt0:
      NEWSconfig(0);
      XmxRSetToggleState (win->menubar, mo_news_body_fmt1, XmxNotSet);
      XmxRSetToggleState (win->menubar, mo_news_body_fmt0, XmxSet);
      if ((strlen(win->current_node->url) > 5) && ! strncmp("news:", win->current_node->url , 5))
        mo_reload_window_text (win, 0);
      break;
    case mo_news_body_fmt1:
      NEWSconfig(1);
      XmxRSetToggleState (win->menubar, mo_news_body_fmt0, XmxNotSet);
      XmxRSetToggleState (win->menubar, mo_news_body_fmt1, XmxSet);
      if ((strlen(win->current_node->url) > 5) && ! strncmp("news:", win->current_node->url , 5))
        mo_reload_window_text (win, 0);
      break;
    case mo_news_header_fmt0:
      NEWSHEADERconfig(0);
      XmxRSetToggleState (win->menubar, mo_news_header_fmt1, XmxNotSet);
      XmxRSetToggleState (win->menubar, mo_news_header_fmt0, XmxSet);
      if ((strlen(win->current_node->url) > 5) && ! strncmp("news:", win->current_node->url , 5))
        mo_reload_window_text (win, 0);
      break;
    case mo_news_header_fmt1:
      NEWSHEADERconfig(1);
      XmxRSetToggleState (win->menubar, mo_news_header_fmt0, XmxNotSet);
      XmxRSetToggleState (win->menubar, mo_news_header_fmt1, XmxSet);
      if ((strlen(win->current_node->url) > 5) && ! strncmp("news:", win->current_node->url , 5))
        mo_reload_window_text (win, 0);
      break;
#endif /* NEWS_SELECT */
    case mo_news_post:
      mo_post_news_win(win);
      break;
    case mo_news_cancel:
      break;
    case mo_news_reply:
      break;
    case mo_news_follow:
      mo_post_follow_win(win);
      break;

#ifdef HAVE_AUDIO_ANNOTATIONS
    case mo_audio_annotate:
      mo_post_audio_annotate_win (win);
      break;
#endif
    case mo_annotate_edit:
      /* OK, let's be smart.
         If we get here, we know we're viewing an editable
         annotation.
         We also know the filename (just strip the leading
         file: off the URL).
         We also know the ID, by virtue of the filename
         (just look for PAN-#.html. */
      if (win->current_node)
        {
          char *author, *title, *text, *fname;
          int id;
          
          if (win->current_node->annotation_type == mo_annotation_private)
            {
              mo_grok_pan_pieces (win->current_node->url,
                                  win->current_node->text,
                                  &title, &author, &text, 
                                  &id, &fname);
              
              mo_post_annotate_win (win, 1, id, title, author, text, fname);
            }
          else if (win->current_node->annotation_type == mo_annotation_workgroup)
            {
              mo_grok_grpan_pieces (win->current_node->url,
                                    win->current_node->text,
                                    &title, &author, &text, 
                                    &id, &fname);
              mo_post_annotate_win (win, 1, id, title, author, text, fname);
            }
        }
      break;
    case mo_annotate_delete:
      if (Rdata.confirm_delete_annotation)
        {
          XmxSetUniqid (win->id);
          XmxMakeQuestionDialog
            (win->base, "Are you sure you want to delete this annotation?",
             "NCSA Mosaic: Delete Annotation", delete_annotation_confirm_cb, 1, 0);
          XtManageChild (Xmx_w);
        }
      else
        mo_do_delete_annotation (win);
      break;
#ifdef DISABLE_TABLE
    case mo_disable_table:
      win->disable_table = 1 - win->disable_table;
      mo_set_disable_table_toggle (win);
      XmxSetArg (WbNdisableTable, win->disable_table ? True : False);
      XmxSetValues (win->scrolled_win);
      break;
#endif /* DISABLE_TABLE */
    default:
#ifdef DOCMENU_EXTENDER
      if (i >= EX_DOCUMENTS_MENU_COUNT_OFFSET) {
        char dynamic_doc_menu[MO_LINE_LENGTH];
        sprintf(dynamic_doc_menu, urllist[i - EX_DOCUMENTS_MENU_COUNT_OFFSET],
                win->current_node->url);
        mo_access_document (win, dynamic_doc_menu);
      } else
#endif /* DOCMENU_EXTENDER */
      if (i >= DOCUMENTS_MENU_COUNT_OFFSET)
        mo_access_document (win, urllist[i - DOCUMENTS_MENU_COUNT_OFFSET]);
      break;
    }

  return;
}

/* ---------------------------- file_menuspec ----------------------------- */

#if 0
static XmxMenubarStruct file_menuspec[] =
{
  { "New Window",         'N', menubar_cb, mo_new_window },
  { "Clone Window",       'C', menubar_cb, mo_clone_window },
  { "----" },
  { "Open...",            'O', menubar_cb, mo_open_document },
  { "Open Local...",      'L', menubar_cb, mo_open_local_document },
  { "----" },
  { "Save As...",         'A', menubar_cb, mo_save_document },
  { "Mail To...",         'M', menubar_cb, mo_mail_document },
  { "Print...",           'P', menubar_cb, mo_print_document },
#ifdef HAVE_DTM
  { "----" },
  { "Open DTM Outport...",    'T', menubar_cb, mo_dtm_open_outport },
  { "Broadcast Document",     'B', menubar_cb, mo_dtm_send_document },
#endif /* HAVE_DTM */
  { "----" },
  { "Search...",          'S', menubar_cb, mo_search },
  { "Reload",             'R', menubar_cb, mo_reload_document },
  { "Refresh",            'f', menubar_cb, mo_refresh_document },
  { "Source Document...", 'D', menubar_cb, mo_document_source },
  { "----" },
  { "Reload Config Files", 'n', menubar_cb, mo_re_init },
  { "Clear Image Cache",       'I', menubar_cb, mo_clear_image_cache },
  { "----" },
  { "Close Window",       'W', menubar_cb, mo_close_window },
  { "Exit Program...",    'x', menubar_cb, mo_exit_program },
  { NULL },
};

static XmxMenubarStruct navi_menuspec[] =
{
  { "Back",                    'B', menubar_cb, mo_back },
  { "Forward",                 'F', menubar_cb, mo_forward },
  { "----" },   
  { "Open...",                 'O', menubar_cb, mo_open_document },
  { "Open Local...",           'L', menubar_cb, mo_open_local_document },
  { "----" },
  { "Home Document",           'D', menubar_cb, mo_home_document },
  { "Network Starting Points", 'N', menubar_cb, mo_network_starting_points },
  { "----" },   
  { "Window History...",       'W', menubar_cb, mo_history_list },
  { "Clear Global History...",     'C', menubar_cb, mo_clear_global_history },
  { "----" },
  { "Hotlist...",              'H', menubar_cb, mo_hotlist_postit },
  { "Add Document To Hotlist", 'A', menubar_cb, mo_register_node_in_default_hotlist },
  { NULL },
};

static XmxMenubarStruct fnts_menuspec[] =
{
  { "<Large Times Fonts",          'L', menubar_cb, mo_large_fonts },
  { "<Large Helvetica Fonts",      'H', menubar_cb, mo_large_helvetica },
  { "<Large New Century Fonts",    'N', menubar_cb, mo_large_newcentury },
  { "<Large Lucida Bright Fonts",  'B', menubar_cb, mo_large_lucidabright },
  { "----" },
  { "<Small Times Fonts",          'S', menubar_cb, mo_small_fonts },
  { "<Small Helvetica Fonts",      'e', menubar_cb, mo_small_helvetica },
  { "<Small New Century Fonts",    'C', menubar_cb, mo_small_newcentury },
  { "<Small Lucida Bright Fonts",  'F', menubar_cb, mo_small_lucidabright },
  { NULL },
};

static XmxMenubarStruct undr_menuspec[] =
{
  { "<Default Underlines",         'D', menubar_cb, mo_default_underlines },
  { "<Light Underlines",           'L', menubar_cb, mo_l1_underlines },
  { "<Medium Underlines",          'M', menubar_cb, mo_l2_underlines },
  { "<Heavy Underlines",           'H', menubar_cb, mo_l3_underlines },
  { "<No Underlines",              'N', menubar_cb, mo_no_underlines },
  { NULL },
};

static XmxMenubarStruct opts_menuspec[] =
{
  { "#Fancy Selections",           'F', menubar_cb, mo_fancy_selections },
  { "#Binary Transfer Mode",       'B', menubar_cb, mo_binary_transfer },
  { "----" },
  { "<Times (Default) Fonts",      'T', menubar_cb, mo_regular_fonts },
  { "<Helvetica Fonts",            'H', menubar_cb, mo_regular_helvetica },
  { "<New Century Fonts",          'N', menubar_cb, mo_regular_newcentury },
  { "<Lucida Bright Fonts",        'L', menubar_cb, mo_regular_lucidabright },
  { "More Fonts",                  'M', NULL, NULL, fnts_menuspec },
  { "----" },
  { "Anchor Underlines",           'A', NULL, NULL, undr_menuspec }, 
  { NULL },
};

static XmxMenubarStruct help_menuspec[] =
{
  { "About...",      'A', menubar_cb, mo_help_about },
  { "Manual...",     'M', menubar_cb, mo_mosaic_manual },
  { "----" },
  { "What's New...", 'W', menubar_cb, mo_whats_new },
  { "Demo...",       'D', menubar_cb, mo_mosaic_demopage },
  { "----" },
  { "On Version 2.6...", 'V', menubar_cb, mo_help_onversion },
  { "On Window...",  'O', menubar_cb, mo_help_onwindow },
  { "On FAQ...",     'F', menubar_cb, mo_help_faq },
  { "----" },
  { "On HTML...",    'H', menubar_cb, mo_help_html },
  { "On URLs...",    'U', menubar_cb, mo_help_url },
  { "----" },
  { "Mail Tech Support...",   'M', menubar_cb, mo_whine },
  { "----" },
  { "Comment Card...",     'C', menubar_cb, mo_cc },
  { NULL },
};

static XmxMenubarStruct anno_menuspec[] =
{
  { "Annotate...",              'A', menubar_cb, mo_annotate },
#ifdef HAVE_AUDIO_ANNOTATIONS
  { "Audio Annotate...",        'u', menubar_cb, mo_audio_annotate },
#endif
  { "----" },
  { "Edit This Annotation...",  'E', menubar_cb, mo_annotate_edit },
  { "Delete This Annotation...",'D', menubar_cb, mo_annotate_delete },
  { NULL },
};


static XmxMenubarStruct menuspec[] =
{
  { "File",      'F', NULL, NULL, file_menuspec },
  { "Navigate",  'N', NULL, NULL, navi_menuspec },
  { "Options",   'O', NULL, NULL, opts_menuspec },
  { "Annotate",  'A', NULL, NULL, anno_menuspec },
  { "Help",      'H', NULL, NULL, help_menuspec },
  /* Dummy submenu. */
  { NULL,       NULL, NULL, NULL, NULL },
  { NULL },
};
#endif

/* ------------------------------------------------------------------------ */
/* --------------------------- Colleen menubar ---------------------------- */
/* ------------------------------------------------------------------------ */

static XmxMenubarStruct file_menuspec[] =
{
  { "New Window",         'N', menubar_cb, mo_new_window },
  { "Clone Window",       'C', menubar_cb, mo_clone_window },
  { "----" },
  { "Open URL...",        'O', menubar_cb, mo_open_document },
  { "Open Local...",      'L', menubar_cb, mo_open_local_document },
  { "----" },
  { "Reload Current",     'R', menubar_cb, mo_reload_document },
  { "Reload Images",      'a', menubar_cb, mo_reload_document_and_images },
  { "Refresh Current",    'f', menubar_cb, mo_refresh_document },
  { "----" },
  { "Find In Current...", 'I', menubar_cb, mo_search },
  { "View Source...",     'V', menubar_cb, mo_document_source },
  { "Edit Source...",     'E', menubar_cb, mo_document_edit },
  { "----" },
  { "Save As...",         'S', menubar_cb, mo_save_document },
  { "Print...",           'P', menubar_cb, mo_print_document },
  { "Mail To...",         'M', menubar_cb, mo_mail_document },
  { "----" },
  { "CCI...",'D', menubar_cb, mo_cci },
#ifdef HAVE_DTM
  { "----" },
  { "Open DTM Outport...",'D', menubar_cb, mo_dtm_open_outport },
  { "Broadcast Over DTM", 'B', menubar_cb, mo_dtm_send_document },
#endif /* HAVE_DTM */
  { "----" },
  { "Close Window",       'W', menubar_cb, mo_close_window },
  { "Exit Program...",    'x', menubar_cb, mo_exit_program },
  { NULL },
};

static XmxMenubarStruct fnts_menuspec[] =
{
  { "<Times Regular",              'T', menubar_cb, mo_regular_fonts },
  { "<Times Small",                'S', menubar_cb, mo_small_fonts },
  { "<Times Large",                'L', menubar_cb, mo_large_fonts },
  { "----" },
  { "<Helvetica Regular",          'H', menubar_cb, mo_regular_helvetica },
  { "<Helvetica Small",            'e', menubar_cb, mo_small_helvetica },
  { "<Helvetica Large",            'v', menubar_cb, mo_large_helvetica },
  { "----" },
  { "<New Century Regular",        'N', menubar_cb, mo_regular_newcentury },
  { "<New Century Small",          'w', menubar_cb, mo_small_newcentury },
  { "<New Century Large",          'C', menubar_cb, mo_large_newcentury },
  { "----" },
  { "<Lucida Bright Regular",      'L', menubar_cb, mo_regular_lucidabright },
  { "<Lucida Bright Small",        'u', menubar_cb, mo_small_lucidabright },
  { "<Lucida Bright Large",        'i', menubar_cb, mo_large_lucidabright },
#ifdef L10N
  { "----" },
  { "<(ISO 8859-2)",               '2', menubar_cb, mo_charset_iso_8859_2 },
  { "<(ISO 8859-3)",               '3', menubar_cb, mo_charset_iso_8859_3 },
  { "<(ISO 8859-4)",               '4', menubar_cb, mo_charset_iso_8859_4 },
  { "<Cyrillic (ISO 8859-5)",      '5', menubar_cb, mo_charset_iso_8859_5 },
  { "<Cyrillic (KOI8)",            'K', menubar_cb, mo_charset_koi8 },
  { "<Greek (ISO 8859-7)",         '7', menubar_cb, mo_charset_iso_8859_7 },
  { "<Hebrew (ISO 8859-8)",        '8', menubar_cb, mo_charset_iso_8859_8 },
  { "<(ISO 8859-9)",               '9', menubar_cb, mo_charset_iso_8859_9 },
  { "<Chinese (GB 2312)",          'G', menubar_cb, mo_charset_gb },
  { "<Chinese (Big5)",             'B', menubar_cb, mo_charset_big5 },
  { "<Chinese (HZ)",               'H', menubar_cb, mo_charset_hz },
  { "<Korean (KSC 5601)",          'K', menubar_cb, mo_charset_ksc },
  { "<Japanese (JIS X 0208)",      'J', menubar_cb, mo_charset_jis },
#endif /* L10N */
  { NULL },
};

static XmxMenubarStruct undr_menuspec[] =
{
  { "<Default Underlines",         'D', menubar_cb, mo_default_underlines },
  { "<Light Underlines",           'L', menubar_cb, mo_l1_underlines },
  { "<Medium Underlines",          'M', menubar_cb, mo_l2_underlines },
  { "<Heavy Underlines",           'H', menubar_cb, mo_l3_underlines },
  { "<No Underlines",              'N', menubar_cb, mo_no_underlines },
  { NULL },
};

#ifdef L10N
static XmxMenubarStruct bidir_menuspec[] =
{
  { "<Visual",                     'V', menubar_cb, mo_bidir_visual },
  { "<Implicit",                   'I', menubar_cb, mo_bidir_implicit },
/* Not yet supported:
  { "<Explicit",                   'E', menubar_cb, mo_bidir_explicit },
*/
  { NULL },
};
#endif /* L10N */

static XmxMenubarStruct opts_menuspec[] =
{
  { "#Fancy Selections",           'S', menubar_cb, mo_fancy_selections },
  { "----" },
  { "#Load To Local Disk",         'T', menubar_cb, mo_binary_transfer },
  { "----" },
  { "#Delay Image Loading",        'D', menubar_cb, mo_delay_image_loads },
  { "Load Images In Current",      'L', menubar_cb, mo_expand_images_current },
  { "----" },
  { "Reload Config Files",         'R', menubar_cb, mo_re_init },
  { "----" },
  { "Flush Image Cache",           'I', menubar_cb, mo_clear_image_cache },
  { "Clear Global History...",     'C', menubar_cb, mo_clear_global_history },
  { "----" },
  { "Fonts",                       'F', 0, 0, fnts_menuspec },
#ifdef L10N
  { "Bi-directionality",           'B', 0, 0, bidir_menuspec },
#endif /* L10N */
  { "Anchor Underlines",           'A', 0, 0, undr_menuspec }, 
#ifdef L10N
/* Conflict Key `L', Changed to lanGuages ;-)
  { "Accept Languages",            'L', menubar_cb, mo_set_accept_languages },
  */
  { "Accept Languages",            'g', menubar_cb, mo_set_accept_languages },
#endif /* L10N */
#ifdef DISABLE_TABLE
  { "----" },
  { "#Disable TableTag",           'D', menubar_cb, mo_disable_table },
#endif /* DISABLE_TABLE */
  { NULL },
};

static XmxMenubarStruct navi_menuspec[] =
{
  { "Back",                    'B', menubar_cb, mo_back },
  { "Forward",                 'F', menubar_cb, mo_forward },
  { "----" },   
  { "Home Document",           'D', menubar_cb, mo_home_document },
  { "Window History...",       'W', menubar_cb, mo_history_list },
  { "----" },   
  { "Hotlist...",              'H', menubar_cb, mo_hotlist_postit },
  { "Add Current To Hotlist",  'A', menubar_cb, mo_register_node_in_default_hotlist },
  { "----" },   
  { "Internet Starting Points",      'I', menubar_cb, mo_network_starting_points },
  { "Internet Resources Meta-Index", 'M', menubar_cb, mo_internet_metaindex },
  { NULL },
};

static XmxMenubarStruct help_menuspec[] =
{
  { "About...",      'A', menubar_cb, mo_help_about },
  { "Manual...",     'M', menubar_cb, mo_mosaic_manual },
  { "----" },
  { "What's New...", 'W', menubar_cb, mo_whats_new },
  { "Demo...",       'D', menubar_cb, mo_mosaic_demopage },
  { "----" },
  { "On Version 2.6...", 'V', menubar_cb, mo_help_onversion },
  { "On Window...",  'O', menubar_cb, mo_help_onwindow },
  { "On FAQ...",     'F', menubar_cb, mo_help_faq },
  { "----" },
  { "On HTML...",    'H', menubar_cb, mo_help_html },
  { "On URLs...",    'U', menubar_cb, mo_help_url },
  { "----" },
  { "Mail Tech Support...",   'M', menubar_cb, mo_whine },
  { "----" },
  { "Comment Card...",     'C', menubar_cb, mo_cc },
  { NULL },
};

static XmxMenubarStruct anno_menuspec[] =
{
  { "Annotate...",              'A', menubar_cb, mo_annotate },
#ifdef HAVE_AUDIO_ANNOTATIONS
  { "Audio Annotate...",        'u', menubar_cb, mo_audio_annotate },
#endif
  { "----" },
  { "Edit This Annotation...",  'E', menubar_cb, mo_annotate_edit },
  { "Delete This Annotation...",'D', menubar_cb, mo_annotate_delete },
  { NULL },
};

/* News */

static XmxMenubarStruct newsfmt_menuspec[] =
{
    { "<Thread View",      'T', menubar_cb, mo_news_fmt0 },
    { "<Group View",       'G', menubar_cb, mo_news_fmt1 },
/*    { "<Tree View",        'r', menubar_cb, mo_news_cancel },*/
    { NULL }
};

#ifdef NEWS_SELECT
static XmxMenubarStruct newsbodyfmt_menuspec[] =
{
    { "<HTML View",      'H', menubar_cb, mo_news_body_fmt0 },
    { "<Normal View",    'N', menubar_cb, mo_news_body_fmt1 },
    { NULL }
};

static XmxMenubarStruct newsheaderfmt_menuspec[] =
{
    { "<Header View",    'H', menubar_cb, mo_news_header_fmt0 },
    { "<Normal View",    'N', menubar_cb, mo_news_header_fmt1 },
    { NULL }
};
#endif /* NEWS_SELECT */

static XmxMenubarStruct news_menuspec[] = 
{
    { "Next",              'N', menubar_cb, mo_news_next },
    { "Prev",              'P', menubar_cb, mo_news_prev },
    { "Next Thread",       't', menubar_cb, mo_news_nextt },
    { "Prev Thread",       'v', menubar_cb, mo_news_prevt },
    { "Index",             'v', menubar_cb, mo_news_index },
    { "List Groups",       'v', menubar_cb, mo_news_list },
    { "----" },
    { "Post",              'o', menubar_cb, mo_news_post },
    { "Follow-up"   ,      'F', menubar_cb, mo_news_follow },
/*    { "Reply",             'R', menubar_cb, mo_news_reply },
    { "Cancel",            'C', menubar_cb, mo_news_cancel },
*/    { "----" },
    { "Format",            'm', 0, 0, newsfmt_menuspec },
#ifdef NEWS_SELECT
    { "Body Format",       'B', 0, 0, newsbodyfmt_menuspec },
    { "Header Format",     'H', 0, 0, newsheaderfmt_menuspec },
#endif /* NEWS_SELECT */
/*    { "----" },
    { "Subscribe",         'S', menubar_cb, mo_news_cancel },
    { "Unsubscribe",       'U', menubar_cb, mo_news_cancel },
    { "Catchup",           't', menubar_cb, mo_news_cancel },
    { "List All",          'A', menubar_cb, mo_news_cancel },
    { "List Subscribed",   'L', menubar_cb, mo_news_cancel },*/  
    { NULL }
};

static XmxMenubarStruct menuspec[] =
{
  { "File",      'F', 0, 0, file_menuspec },
  { "Options",   'O', 0, 0, opts_menuspec },
  { "Navigate",  'N', 0, 0, navi_menuspec },
  { "Annotate",  'A', 0, 0, anno_menuspec },
  { "News",      'w', 0, 0, news_menuspec }, 
  { "Help",      'H', 0, 0, help_menuspec },
  /* Dummy submenu. */
  { NULL,       '\0', 0, 0, 0 },
  { NULL },
};


/* ----------------------- simple menubar interface ----------------------- */

static XmxMenubarStruct file_simple_menuspec[] =
{
  { "Clone Window",       'C', menubar_cb, mo_clone_window },
  { "----" },
  { "Search...",          'S', menubar_cb, mo_search },
  { "----" },
  { "Close Window",       'W', menubar_cb, mo_close_window },
  { "Exit Program...",    'x', menubar_cb, mo_exit_program },
  { NULL },
};

static XmxMenubarStruct navi_simple_menuspec[] =
{
  { "Back",                    'B', menubar_cb, mo_back },
  { "Forward",                 'F', menubar_cb, mo_forward },
  { "----" },   
  { "Home Document",           'D', menubar_cb, mo_home_document },
  { "----" },   
  { "Window History...",       'W', menubar_cb, mo_history_list },
  { "----" },
  { "Hotlist...",              'H', menubar_cb, mo_hotlist_postit },
  { "Add Document To Hotlist", 'A', menubar_cb, mo_register_node_in_default_hotlist },
  { NULL },
};

static XmxMenubarStruct opts_simple_menuspec[] =
{
  { "#Binary Transfer Mode",       'B', menubar_cb, mo_binary_transfer },
  { NULL },
};

static XmxMenubarStruct help_simple_menuspec[] =
{
  { "About...",      'A', menubar_cb, mo_help_about },
  { "Manual...",     'M', menubar_cb, mo_mosaic_manual },
  { "----" },
  { "What's New...", 'W', menubar_cb, mo_whats_new },
  { "Demo...",       'D', menubar_cb, mo_mosaic_demopage },
  { "----" },
  { "On Version 2.6...", 'V', menubar_cb, mo_help_onversion },
  { "On Window...",  'O', menubar_cb, mo_help_onwindow },
  { "On FAQ...",     'F', menubar_cb, mo_help_faq },
  { "----" },
  { "Comment Card...",     'C', menubar_cb, mo_cc },
  { NULL },
};

static XmxMenubarStruct anno_simple_menuspec[] =
{
  { "Annotate...",              'A', menubar_cb, mo_annotate },
#ifdef HAVE_AUDIO_ANNOTATIONS
  { "Audio Annotate...",        'u', menubar_cb, mo_audio_annotate },
#endif
  { "----" },
  { "Edit This Annotation...",  'E', menubar_cb, mo_annotate_edit },
  { "Delete This Annotation...",'D', menubar_cb, mo_annotate_delete },
  { NULL },
};

static XmxMenubarStruct simple_menuspec[] =
{
  { "File",      'F', 0, 0, file_simple_menuspec },
  { "Navigate",  'N', 0, 0, navi_simple_menuspec },
  { "Options",   'O', 0, 0, opts_simple_menuspec },
  { "Annotate",  'A', 0, 0, anno_simple_menuspec },
  { "Help",      'H', 0, 0, help_simple_menuspec },
  /* Dummy submenu. */
  { NULL,       '\0', 0, 0, 0 },
  { NULL },
};

/* -------------------- mo_make_document_view_menubar --------------------- */

/* We now allow a single customizable menu.  

   First choice for the spec file is the value of the resource
   documentsMenuSpecfile.
   If that doesn't exist, second choice is the value of the
   environment variable MOSAIC_DOCUMENTS_MENU_SPECFILE.
   If *that* doesn't exist, third choice is specified in 
   #define DOCUMENTS_MENU_SPECFILE. */

static mo_status mo_file_exists (char *filename)
{
  struct stat buf;
  int r;

  r = stat (filename, &buf); 
  if (r != -1)
    return mo_succeed;
  else
    return mo_fail;
}

static void mo_grok_menubar (char *filename)
{
  FILE *fp;
  char line[MO_LINE_LENGTH];
  char *status;
  XmxMenubarStruct *menu;
  int count;

  fp = fopen (filename, "r");
  if (!fp)
    return;
/*    goto screwed_no_file;*/

  /* Make the menu. */
  menu = (XmxMenubarStruct *) malloc 
    (MAX_DOCUMENTS_MENU_ITEMS * sizeof (XmxMenubarStruct));
  count = 0;
  
  /* File consists of alternating titles and URL's.
     A title consisting of at least two leading dashes
     is a separator. */
  while (1)
    {
      status = fgets (line, MO_LINE_LENGTH, fp);
      if (!status || !(*line))
/*        goto done;*/
	  break;

      if (strlen (line) >= 2 &&
          line[0] == '-' &&
          line[1] == '-')
        {
          /* It's a separator. */
          menu[count].namestr = "----";
          menu[count].mnemonic = 0;
          menu[count].func = 0;
          menu[count].data = 0;
          menu[count].sub_menu = 0;
        }
      else
        {
          /* That's the title. */
          menu[count].namestr = strdup (line);
          /* Wipe out trailing newline. */
          menu[count].namestr[strlen(line)-1] = '\0';
          menu[count].mnemonic = 0;
          menu[count].func = (void (*)())menubar_cb;
#ifndef DOCMENU_EXTENDER
          menu[count].data = count + DOCUMENTS_MENU_COUNT_OFFSET;
#endif /* !DOCMENU_EXTENDER */
          menu[count].sub_menu = 0;
          
          status = fgets (line, MO_LINE_LENGTH, fp);
          if (!status || !(*line))
            {
              /* Oops, something went wrong. */
              menu[count].namestr = 0;
              
/*              goto done;*/
		break;
            }
          
          /* There's a URL. */
          urllist[count] = strdup (line);
          urllist[count][strlen(line)-1] = '\0';
#ifdef DOCMENU_EXTENDER
          {
            /* Give current URL to "Documets" menu.
             * menu specfile example:
             *
             *   View with Delegate + CIIlib(10080)
             *   http://Delegate.Host:10080/-_-[CURRENT]
             */
            char *p;
            p = strchr(line, '[');
            if (p == NULL || strncmp(p, "[CURRENT]", 9) != 0) {
              menu[count].data = count + DOCUMENTS_MENU_COUNT_OFFSET;
            } else {
              menu[count].data = count + EX_DOCUMENTS_MENU_COUNT_OFFSET;
              urllist[count][p - line] = '\0';
              strcat(urllist[count], "%s");
              strcat(urllist[count], p + 9);
              urllist[count][strlen(urllist[count])-1] = '\0';
            }
          }
#endif /* DOCMENU_EXTENDER */
        }

      /* Count increases. */
      count++;
    }

/* done:
  /* Make sure we get a NULL in the right place. */
  menu[count].namestr = 0;
  fclose (fp);
  if (count > 0)
    {
      if (Rdata.simple_interface)
        {
          simple_menuspec[6].namestr = "Documents";
          simple_menuspec[6].mnemonic = 'D';
          simple_menuspec[6].func = 0;
          simple_menuspec[6].data = 0;
          simple_menuspec[6].sub_menu = menu;
        }
      else
        {
          menuspec[6].namestr = "Documents";
          menuspec[6].mnemonic = 'D';
          menuspec[6].func = 0;
          menuspec[6].data = 0;
          menuspec[6].sub_menu = menu;
        }
    }
  return;

/*
 screwed_open_file:
  fclose (fp);
  return;

 screwed_no_file:
  return;
*/
}


static void mo_try_to_grok_menubar (void)
{
  char *filename = Rdata.documents_menu_specfile;
  
  if (filename && mo_file_exists (filename))
    {
      mo_grok_menubar (filename);
    }
  else
    {
      filename = getenv ("MOSAIC_DOCUMENTS_MENU_SPECFILE");
      if (filename && mo_file_exists (filename))
        {
          mo_grok_menubar (filename);
        }
      else
        {
          filename = DOCUMENTS_MENU_SPECFILE;
          if (filename && mo_file_exists (filename))
            {
              mo_grok_menubar (filename);
            }
        }
    }

  return;
}

static int grokked_menubar = 0;

XmxMenuRecord *mo_make_document_view_menubar (Widget form)
{
XmxMenuRecord *toBeReturned;

  /* If we've never tried to set up the user's configurable menubar by
     loading menuspec[5], give it a shot now. */
  if (!grokked_menubar)
    {
      grokked_menubar = 1;

      mo_try_to_grok_menubar ();
    }

  toBeReturned = XmxRMakeMenubar 
    	(form, Rdata.simple_interface ? simple_menuspec : menuspec);

  if (Rdata.kiosk || Rdata.kioskNoExit) {
		/* won't appear */
		XtUnmanageChild(toBeReturned->base);
		}

  return toBeReturned;
}
