var JS_PRC = "C:\\!\\dh\\web\\PRC\\1\\HTM\\prc.js (4012 lines) 2012-01-27 08:02 Rachel Bartlett";
x_log("\nJS_PRC: \"" + JS_PRC + "\"");
/**********************************************************************/
/*                                                                    */
/*                            P R C . J S                             */
/*                            -----------                             */
/*                                                                    */
/* This is the standard Javascript library for the Paul Rosenfels     */
/* Community website (rosenfels.org). The source code for this        */
/* website is written in HML, an HTML Macro Language designed by      */
/* Rachel Bartlett and implemented in Perl. The output of the HML     */
/* compiler is an HTML file in which any HML macros have been         */
/* converted to Javascript function calls.                            */
/*                                                                    */
/* A macro like <<dialog>>, for example, will be compiled by HML      */
/* into a call to prc_dialog(). Other compilation patterns include    */
/*                                                                    */
/*   Macro invocation      Function call                              */
/*   ------------------    ------------------------------------       */
/*   <<dialog, 'parm'>>    <script>prc_dialog('parm');</script>       */
/*   <</dialog>>           <script>prc_dialog_end();</script>         */
/*                                                                    */
/* See hml.pl for more information.                                   */
/*                                                                    */
/*--------------------------------------------------------------------*/
/*                                                                    */
/* The following sequences of macros generate tables:                 */
/*                                                                    */
/*         <<dialog>> -> <<speech>> -> <</dialog>>                    */
/*      <<footnotes>> -> <<fnote>>  -> <</footnotes>>                 */
/*         <<script>> -> <<line>>   -> <</script>>                    */
/*           <<menu>> -> <<choice>> -> <</menu>>                      */
/*                                                                    */
/* Normally the <<speech>> macro would be mirrored by a <</speech>>   */
/* macro. Instead I let the <<speech>> macro set a global flag named  */
/* prc_in_a_speech to true. All <<speech>> and <</dialog>> macros     */
/* first issue <</speech>>. If this flag is off, it simply exits,     */
/* but if it is on, appropriate code is generated and the flag reset. */
/*                                                                    */
/* Equivalent logic eliminates the need for an explicit <</fnote>>    */
/* and <</line>> macros.                                              */
/*                                                                    */
/* There is no <</choice>> macro, because everything must be speci-   */
/* fied inside the <<choice>> macro. Only the page name is required,  */
/* however, and possibly the anchor. These are used to search the     */
/* pagetree table to find default values for the other parameters.    */
/*                                                                    */
/* Currently, <<dialog>> is implemented as a <<floating_table>>.      */
/* Rows in such tables appear as islands of pastel colors.            */
/*                                                                    */
/*--------------------------------------------------------------------*/
/*                                                                    */
/* Many of these functions are informed by a table of those pages that*/
/* comprise this website. Each entry gives a page's filename, title,  */
/* date of publication, level in the page heirarchy and similar       */
/* attributes.                                                        */
/*                                                                    */
/* Documentation about the structure of this 'pagetree' table is      */
/* contained in sitegen.pl, which is the utility used to generate     */
/* this table as well as the 'snapshots', 'soundbites' and            */
/* 'videoclips' tables. These tables are written into the files       */
/* "htm\pagetree.js" and "htm\snapshots.js" respectively.             */
/*                                                                    */
/* The 'definitions' table is created by 'glossary.pl.                */
/*                                                                    */
/*--------------------------------------------------------------------*/
/*                                                                    */
/* Several other tables and arrays are used to describe objects in    */
/* the Paul Rosenfels Community Website:                              */
/*                                                                    */
/*  1) Language. There are four languages envisioned for this site:   */
/*     English, French, German and Spanish, which are identified by   */
/*     the literals 'E', 'F', 'G' and 'S'. Language information is    */
/*     kept in the prc_languages table:                               */
/*                                                                    */
/*     prc_languages['E']['name'] = 'English';                        */
/*     prc_languages['F']['name'] = 'French';                         */
/*     prc_languages['G']['name'] = 'German';                         */
/*     prc_languages['S']['name'] = 'Spanish';                        */
/*                                                                    */
/*     Foreign languages are indicated by the last character of the   */
/*     pagename. 'G' indicates German, for example. If the last       */
/*     character is neither 'F', 'G' nor 'S' the language is English. */
/*                                                                    */
/*  2) Friends of our community. These are authors who support and    */
/*     contribute to our work (rather than just reviewing it),        */
/*     most of whom are former members of the Ninth Street Center.    */
/*     Friends are serviced by the <<friend>> macro and are           */
/*     identified by their initials. Information about them is kept   */
/*     in the prc_friends table:                                      */
/*                                                                    */
/*     prc_friends['rb']['name'] = 'Rachel Bartlett';                 */
/*     prc_friends['rb']['snapshot'] = 'Rachel_Bartlett_950x950.jpg'; */
/*     prc_friends['rb']['has_mailbox'] = true;                       */
/*     prc_friends['rb']['bio'] = "is an "                            */
/*         + "independent scholar <br>who grew up in East "           */
/*         + "Germany and now lives in New York.";                    */
/*                                                                    */
/*     Friends other than Dean Hannotte are indicated by the first    */
/*     two characters of the pagename. 'rb' indicates Rachel          */
/*     Bartlett, for example. If the first two characters are         */
/*     neither 'bf', 'jc', 'lb', 'mb', 'pr', 'rb', nor 'tr', the      */
/*     friend is assumed to be Dean.                                  */
/*                                                                    */
/*     The terms 'friend' and 'author' in this software includes      */
/*     being an interviewee and thus does not imply that a "byline"   */
/*     is appropriate.                                                */
/*                                                                    */
/*--------------------------------------------------------------------*/
/*                                                                    */
/* Most of these functions write to the document using                */
/* document.write() (as wrapped by x_write()), but some return        */
/* the content to be written and                                      */
/* leave it to the calling function to do any document.write().       */
/* Names of the latter type begin with "p_" instead of "prc_".        */
/* See, for example, p_friend(). Since this is where the real         */
/* work is done, prc_friend() trivially degenerates to something like */
/*                                                                    */
/*     function prc_friend(...)                                       */
/*     {                                                              */
/*         document.write(p_friend(...));                             */
/*     }                                                              */
/*                                                                    */
/*--------------------------------------------------------------------*/
/*                    (c) 2008-2011 Rachel Barlett                    */
/**********************************************************************/

/*--------------------------------------------------------------------*/
/*                Make sure we're in the right domain                 */
/*                                                                    */
/*      Here's an example of a 'wrong' domain:                        */
/*                                                                    */
/*        location.protocol = 'http:';                                */
/*        location.hostname = 'www.ninthstreetcenter.org';            */
/*        location.pathname = '/Rants.htm';                           */
/*        location.search   = '?timeline=wraparound';                 */
/*                                                                    */
/*--------------------------------------------------------------------*/
if (location.protocol == 'http:'
&&  location.hostname != "www.rosenfels.org")
{
    p_normalize_hostname();
}

/*--------------------------------------------------------------------*/
/*                          Global Constants                          */
/*--------------------------------------------------------------------*/
// Offsets into the page descriptors:
var DEPTH   = 0;                      // depth within the page hierarchy
var NODE    = 1;           // outline number (generated algorithmically)
var PUBDATE = 2;                                     // publication date
var PAGE    = 3;                                             // filename
var ANCHOR  = 4;                                      // optional anchor
var TITLE   = 5;                                                // title
var COMMENT = 6;                                              // comment
var PARMS   = 7;                                // additional parameters
var DESCLEN = 8;             // (variables in each each page descriptor)

// Foreground colors:
var PRC_FG_MAROON     = '#800000';                      // 'dark maroon'
var PRC_FG_DARK_GRAY  = '#444444';                          // dark gray
var PRC_FG_GRAY       = '#999999';                               // gray
var PRC_FG_BLACK      = '#000000';                              // black
var PRC_FG_WHITE      = '#FFFFFF';                              // white

// Background colors:
var PRC_BG_MAROON     = '#800000';                      // 'dark maroon'
var PRC_BG_WHEAT      = '#F5DEB3';                            // 'wheat'
var PRC_BG_WHITE      = '#FFFFFF';                              // white
var PRC_BG_LIGHT_GRAY = '#EEEEEE';                         // light gray
var PRC_BG_GRAY       = '#888888';                               // gray
var PRC_BG_DARK_GRAY  = '#444444';                          // dark gray
var PRC_BG_BLACK      = '#000000';                              // black
var PRC_BG_ORANGE     = '#EE8822';                             // orange

// Border colors:
var PRC_BD_BLACK      = '#000000';                              // black
var PRC_BD_WHITE      = '#FFFFFF';                              // white

// Cycling background colors:
var PRC_BG_MINT_GREEN = '#CCFFCC';                         // mint-green
var PRC_BG_WINE       = '#DFD5D6';                       // wine-colored
var PRC_BG_GOLD       = '#FFEEAA';                               // gold
// var PRC_BG_HOT_PINK   = '#FFDDDD';                        // hot-pink

// Cycling background colors if prc_format_flag is '-print':
var PRC_BG_GRAY_1     = '#EEEEEE';
var PRC_BG_GRAY_2     = '#DDDDDD';
var PRC_BG_GRAY_3     = '#CCCCCC';

var PRC_BG_PINK  = '#FF8888';                // see p_translation_icon()
var PRC_WEBSITE  = new String("The Paul Rosenfels Community");
var PRC_MOTTO    = new String("Social Progress through Personal Growth");
// var PRC_DOMAIN   = new String("rosenfels.org");
// var PRC_HOSTNAME = new String("www.rosenfels.org");
// var PRC_HOMEPAGE = new String("http://www.rosenfels.org");
var PRC_DEFAULT_EXT = new String(".htm");
var PRC_SLASH    = new String("/");

var PRC_YAHOO_GROUP_URL = "http://groups.yahoo.com/group/paul-rosenfels/";

var PRC_PAUL_LARGE_SQUARE_SNAPSHOTS =
[
    "Paul_at_home_in_the_kitchen_730x487.jpg",
    "Paul_in_front_of_St._Mark[039]s_Church_in_the_Bowery_541x561.jpg",
    "Paul_on_the_Staten_Island_Ferry_545x565.jpg",
    "Paul_washing_dishes_287x287.jpg",
    "Paul_with_mug_583x589.jpg"
];
var PRC_PAUL_SMALL_SQUARE_SNAPSHOTS =
[
    "Paul_at_home_in_the_kitchen_200x200.jpg",
    "Paul_in_front_of_St._Mark[039]s_Church_in_the_Bowery_200x200.jpg",
    "Paul_on_the_Staten_Island_Ferry_200x200.jpg",
    "Paul_washing_dishes_200x200.jpg",
    "Paul_with_mug_200x200.jpg"
];

/*--------------------------------------------------------------------*/
/*                          Global Variables                          */
/*--------------------------------------------------------------------*/
var prc_body_has_been_loaded     = false;
var prc_famous_faces_dealt       = new Array();
var prc_cycling_snapshots_dealt  = new Array();
// var prc_random_snapshots_used = 0; // how many random snapshots have we used?
var prc_num_children             = 0; // how many children does current page have?
var prc_table_depth              = 0;
var prc_timeline                 = [-1, -1, -1, -1, -1];
var prc_menu_title               = new String();
var prc_menu_parms               = new String();
var prc_menu_choices             = new String();

var prc_cycling_bgcolors         = [PRC_BG_MINT_GREEN, PRC_BG_GOLD, PRC_BG_WINE];
var prc_cycling_bgcolor_index    = -1;         // prior color index used
var prc_cycling_bgcolors_dimen   =    // normally cycle through 3 colors
    prc_cycling_bgcolors.length;

var prc_cycling_snapshot_index   = -1;            // prior snapshot used
var prc_cycling_snapshots_dimen  =          // cycle through all of them
    PRC_PAUL_LARGE_SQUARE_SNAPSHOTS.length;

/*- - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - */
/*                          Context trackers                          */
/*- - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - */
var prc_in_an_fnote   = false;
var prc_in_a_line     = false;
var prc_in_a_speech   = false;
// var prc_toc_bgcolor   = '';

/*- - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - */
/*                            Friend Table                            */
/*- - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - */
// Friend initials are extracted from the first 2 characters of prc_page:
var prc_friend_initials = new String();                    // 'rb', etc.
var prc_friend_name = new String();

var prc_friends   = new Array();

prc_friends['bf'] = new Array();
prc_friends['dh'] = new Array();
prc_friends['jc'] = new Array();
prc_friends['lb'] = new Array();
prc_friends['mb'] = new Array();
prc_friends['pr'] = new Array();
prc_friends['rb'] = new Array();
prc_friends['tr'] = new Array();

prc_friends['bf']['name'] = 'Bob Fink';
prc_friends['dh']['name'] = 'Dean Hannotte';
prc_friends['jc']['name'] = 'John Calhoun';
prc_friends['lb']['name'] = 'Laurie Bell';
prc_friends['mb']['name'] = 'Michael Ballin';
prc_friends['pr']['name'] = 'Paul Rosenfels';
prc_friends['rb']['name'] = 'Rachel Bartlett';
prc_friends['tr']['name'] = 'Tony Rostron';

prc_friends['bf']['bio' ] = "has been a member of the Ninth Street " +
"Center since the mid-1970's, and the corporation's treasurer since 1991.";

prc_friends['dh']['bio' ] = "studied the history of ideas at St. John's " +
"College, met Paul Rosenfels in 1966 and became a proponent of his " +
"psychological discoveries. In 1973 he and Paul founded the Ninth Street " +
"Center and Dean began editing the Ninth Street Center Journal. " +
"Since 1997 he has been the primary author of this website.";

prc_friends['jc']['bio' ] = "was a member of the Ninth Street Center during " +
"the 1980's and 1990's and hosted various discussion groups at his apartment, " +
"including a Great Books group and a Paul Rosenfels study group.";

prc_friends['lb']['bio' ] = "is the daughter of William Weinstone, " +
"one of the founders of the American Communist Party. After becoming a " +
"student of Paul Rosenfels, she went on to become an interfaith minister " +
"and life counselor. Laurie can be reached at the <a href='http://gentleriver.com/'>" +
"<b>Gentle River: Ceremonies, Counseling, Intuitive Healing</b></a> website.";

prc_friends['mb']['bio' ] = "is an Associate Professor Emeritus of the " +
"Department of English, Wilfrid Laurier University Waterloo, Ontario. " +
"He was involved with the Ninth Street Center in the 1990's and has " +
"subsequently used Paul's ideas in his professional and creative life.";

prc_friends['pr']['bio' ] = "was a 20th-century thinker who developed new " +
"ways of thinking about human nature based on the polarity between feminine " +
"and masculine individuals. Some of his students think his ground-breaking " +
"work represents the foundations of that long-sought goal of the " +
"Enlightenment &mdash; a true science of human nature.";

prc_friends['rb']['bio' ] = "is an independent scholar who grew up in East " +
"Germany, read everything Paul published in 1999, and now lives in Manhattan. " +
"Since 2007 she has written " + prc_num_rb_pages + " new pages, translated " +
prc_num_german_pages + " old pages into German, and assembled " + prc_num_collages +
" beautiful and relevant collages for our website.";

prc_friends['rb']['bioG'] = "ist Privatgelehrte und lebt in New York. Sie wuchs " +
"in Ostdeutschland auf, und las im Jahr 1999 alle B&uuml;cher, die Paul je " +
"ver&ouml;ffentlicht hat. Seit 2007 hat sie " + prc_num_rb_pages + " neue Seiten geschrieben, " +
prc_num_german_pages + " bestehende Seiten ins Deutsche &uuml;bersetzt, gestaltete " +
prc_num_collages + " wundersch&ouml;ne und relevante Collagen f&uuml;r unsere Webseite.";

// und " + prc_num_collages + " Collagen f&uuml;r unsere Webseite gestaltet.";

prc_friends['tr']['bio' ] = "was a war photographer in Vietnam and " +
"then a long-time student of Paul Rosenfels. He died in 1992.";

// only use a bio once
prc_friends['bf']['bio_has_been_used'] = false;
prc_friends['dh']['bio_has_been_used'] = false;
prc_friends['jc']['bio_has_been_used'] = false;
prc_friends['lb']['bio_has_been_used'] = false;
prc_friends['mb']['bio_has_been_used'] = false;
prc_friends['pr']['bio_has_been_used'] = false;
prc_friends['rb']['bio_has_been_used'] = false;
prc_friends['tr']['bio_has_been_used'] = false;

prc_friends['bf']['has_mailbox'] = true;
prc_friends['dh']['has_mailbox'] = true;
prc_friends['mb']['has_mailbox'] = true;
prc_friends['rb']['has_mailbox'] = true;

prc_friends['bf']['snapshot'] = 'Bob_Fink_1200x1600.jpg'     ;
prc_friends['dh']['snapshot'] = 'Dean_Hannotte_1350x1350.jpg';
prc_friends['jc']['snapshot'] = 'John_Calhoun_312x315.jpg'   ;
prc_friends['lb']['snapshot'] = 'Laurie_Bell_452x343.jpg'    ;
prc_friends['mb']['snapshot'] = 'Michael_Ballin_346x376.jpg' ;
// Paul's snapshot is generated randomly
prc_friends['rb']['snapshot'] = 'Rachel_Bartlett_950x950.jpg';
prc_friends['tr']['snapshot'] = 'Tony_Rostron_195x199.jpg'   ;

/*- - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - */
/*                          Language Tables                           */
/*- - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - */
// Language initial extracted from the last character of prc_page:
var prc_language_initial = new String();    // 'E', 'F', 'G', 'R' or 'S'
var prc_language_suffix  = new String();     // '', 'F', 'G', 'R' or 'S'
var prc_language_name    = new String();         // 'English', 'French',
                                                // 'German' or 'Spanish'

// Language Name Array:
var prc_languages  = new Array();

prc_languages['E'] = new Array();
prc_languages['F'] = new Array();
prc_languages['G'] = new Array();
prc_languages['R'] = new Array();
prc_languages['S'] = new Array();

prc_languages['E']['suffix'] = "";
prc_languages['F']['suffix'] = "F";
prc_languages['G']['suffix'] = "G";
prc_languages['R']['suffix'] = "R";
prc_languages['S']['suffix'] = "S";

prc_languages['E']['name'] = "English";
prc_languages['F']['name'] = "French";
prc_languages['G']['name'] = "German";
prc_languages['R']['name'] = "Russian";
prc_languages['S']['name'] = "Spanish";

// Vocabulary Arrays:
var prc_vocab = new Array();

prc_vocab['G'] = new Array();
prc_vocab['G'][PRC_WEBSITE] = 'Die Paul Rosenfels Community';
prc_vocab['G'][PRC_MOTTO]   = 'Sozialer Fortschritt durch pers&ouml;nliches Wachstum';
prc_vocab['G']['by']        = 'von';
prc_vocab['G']['reviewed']  = 'rezensiert';

/*- - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - */
/*               Attributes of the Current Page/Anchor                */
/*- - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - */
var prc_ptx      = -1;                                 // pagetree index
var prc_depth    = -1;
var prc_node     = new String();
var prc_pubdate  = new String();
var prc_page     = new String();
var prc_anchor   = new String();
var prc_title    = new String();
var prc_comment  = new String();
var prc_parms    = new String();

/*- - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - */
/*                    Attributes encoded in PARMS                     */
/*- - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - */
var prc_author_name    = new String();                 // from 'author:'
var prc_genre          = new String();                  // from 'genre:'
var prc_source_code    = new String();                 // from 'source:'
var prc_subtitle       = new String();               // from 'subtitle:'
var prc_year           = new String();                   // from 'year:'

/*--------------------------------------------------------------------*/
/*                         Start doing things                         */
/*--------------------------------------------------------------------*/
x_log("\nI N I T I A L I Z A T I O N   C O D E -----------------------------------");
if (x_is_empty(JS_PLX))
{
    x_log("\n*** Please load 'plx.js' before 'prc.js' ***");
}
// x_log
// (
//     "\n         location: \"" + location          + "\""
//   + "\nlocation.protocol: \"" + location.protocol + "\""
//   + "\nlocation.hostname: \"" + location.hostname + "\""
//   + "\nlocation.pathname: \"" + location.pathname + "\""
//   + "\n  location.search: \"" + location.search   + "\""
//   + "\n         document: \"" + document          + "\""
//   + "\n    document.body: \"" + document.body     + "\""
//   + "\n         x_page(): \"" + x_page()          + "\""
//   + "\n       x_anchor(): \"" + x_anchor()        + "\""
//   + "\n        x_parms(): \"" + x_parms()         + "\""
// );

x_log("\nplx_javascript_version: '" + plx_javascript_version + "'");
// NOTE: document.body isn't defined yet!
// x_log("\n document.body.clientWidth: " + document.body.clientWidth);
// x_log("\ndocument.body.clientHeight: " + document.body.clientHeight);

x_log("\nprc_body_has_been_loaded: " + prc_body_has_been_loaded);

x_get_url_parms();                        // fill up plx_url_parms array

// for (pf1 in prc_friends)
// {
//     for (pf2 in prc_friends[pf1])
//     {
// x_log("\nprc_friends['" + pf1 + "']['" + pf2 + "']: \"" + prc_friends[pf1][pf2] + "\"");
//     }
// }

for (pl in prc_languages)
{
    x_log("\nprc_languages['" + pl + "']['name']: \"" + prc_languages[pl]['name'] + "\"");
}

// Seed David Bau's pseudo-random number generator with local entropy:
// x_log("\nMath.seedrandom() = \"" + Math.seedrandom() + "\"");
Math.seedrandom();
// x_log("\nMath.random() = " + Math.random());

// Has prc_menu_type been set by the HML compiler?
if (x_is_empty(prc_menu_type))
{
    var prc_menu_type = 'DH';
x_log("\nWARNING: The prc_menu_type variable has not been set by "
+ "the HML compiler and will default to '" + prc_menu_type + "'.");
}

/*--------------------------------------------------------------------*/
/*             Override default values declared in plx.js             */
/*--------------------------------------------------------------------*/
x_media_folder('_media');                               // see x_media()
x_media_frame_color(PRC_BG_WHEAT);                      // see x_media()
x_media_frame_caption_style                             // see x_media()
(
      "font-size: 13; "
    + "font-weight: bold; "
    + "color: " + PRC_BG_WHITE + "; "
    + "background-color: " + PRC_BG_GRAY + ";"
);
x_hover_style                                         // see x_hover_*()
(
      "font-size: 13; "
    + "color: " + PRC_FG_MAROON + "; "
    + "background-color: " + PRC_BG_LIGHT_GRAY + "; "
    + "border: " + PRC_BG_WHITE + " 6px solid;"
);

/*--------------------------------------------------------------------*/
/*                Are we running locally or remotely?                 */
/*--------------------------------------------------------------------*/
var prc_mode = new String('prod');
if (location.protocol == "file:") prc_mode = 'test';
x_log("\nprc_mode: '" + prc_mode + "'");
var prc_style_2 = prc_mode; // 'test' or 'prod'
x_log("\nprc_style_2: '" + prc_style_2 + "'");

/*--------------------------------------------------------------------*/
/*   Randomize the order of Paul's pictures we'll use on this page    */
/*--------------------------------------------------------------------*/
prc_cycling_snapshots_dealt = x_deal
(
    prc_cycling_snapshots_dimen,                       // cards to deal
    prc_cycling_snapshots_dimen                         // size of deck
);
x_log("\nprc_cycling_snapshots_dealt: (" + prc_cycling_snapshots_dealt.join(', ') + ")");

/*--------------------------------------------------------------------*/
/*             What page are we on? What does that imply?             */
/*--------------------------------------------------------------------*/
x_log("\npagetree.length: '" + pagetree.length + "'");
    prc_page   = x_page();
    prc_anchor = x_anchor();
x_log("\nprc_page: '"   + prc_page   + "'");
x_log("\nprc_anchor: '" + prc_anchor + "'");

    var period = prc_page.lastIndexOf('.');
    if (period > -1)
    {
x_log("\nperiod: '" + period + "'");
        prc_page = prc_page.substr(0, period);
x_log("\nprc_page: '" + prc_page + "'");
    }

    prc_ptx = prc_index(prc_page, prc_anchor);
    if (prc_ptx == -1 && prc_anchor != '')
    {
x_log("\n\"" + prc_page + prc_anchor + "\" isn't in the pagetree table.");
        prc_ptx = prc_index(prc_page, '');
    }
    if (prc_ptx == -1)
    {
x_log("\nAnd neither is \"" + prc_page + "\"");
        alert(plx_log);
        location = "http://www.rosenfels.org" + location.search;
    }
    prc_depth    = pagetree[prc_ptx + DEPTH  ];
    prc_node     = pagetree[prc_ptx + NODE   ];
    prc_pubdate  = pagetree[prc_ptx + PUBDATE];
    prc_page     = pagetree[prc_ptx + PAGE   ]; // corrects case errors
    prc_anchor   = pagetree[prc_ptx + ANCHOR ];
    prc_title    = pagetree[prc_ptx + TITLE  ];
    prc_comment  = pagetree[prc_ptx + COMMENT];
    prc_parms    = pagetree[prc_ptx + PARMS  ];

x_log("\n   prc_depth: '"  + prc_depth    + "'");
x_log("\n    prc_node: '"  + prc_node     + "'");
x_log("\n prc_pubdate: '"  + prc_pubdate  + "'");
x_log("\n    prc_page: '"  + prc_page     + "'");
x_log("\n  prc_anchor: '"  + prc_anchor   + "'");
x_log("\n   prc_title: \"" + prc_title    + "\"");
x_log("\n prc_comment: \"" + prc_comment  + "\"");
x_log("\n   prc_parms: \"" + prc_parms    + "\"");

/*- - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - */
/*               Extract prefix and suffix of page name               */
/*- - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - */
    prc_friend_initials = prc_page.substr(0, 2);
    if (prc_friends[prc_friend_initials] instanceof Array)
    {
        prc_friend_name = prc_friends[prc_friend_initials]['name'];
x_log("\n     prc_friend_name: \"" + prc_friend_name + "\"");
    }
    else
    {
        prc_friend_initials = 'dh';
    }

x_log("\n prc_friend_initials: \"" + prc_friend_initials + "\"");

    prc_language_initial = prc_page.substr(prc_page.length - 1, 1);
    if (!(prc_languages[prc_language_initial] instanceof Array))
    {
        prc_language_initial = 'E';
    }
    prc_language_suffix = prc_languages[prc_language_initial]['suffix'];
    prc_language_name   = prc_languages[prc_language_initial]['name'  ];

x_log("\nprc_language_initial: \"" + prc_language_initial + "\"");
x_log("\n prc_language_suffix: \"" + prc_language_suffix  + "\"");
x_log("\n   prc_language_name: \"" + prc_language_name    + "\"");

/*--------------------------------------------------------------------*/
/*  PARMS have global defaults.                                       */
/*  prc_parms can override global defaults for any page.              */
/*  Url parms can override page settings for any visit.               */
/*                                                                    */
/*  The final value for 'format' implies different defaults for       */
/*  other PARMS, so that has to be worked out first.                  */
/*--------------------------------------------------------------------*/

/*- - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - */
/*                        Set global defaults                         */
/*- - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - */
var prc_age_flag       = new String('');           // '-new', '-updated'
var prc_format_flag    = new String('-webpage'); // '-webpage', '-print'
var prc_private_flag   = new String('-public'); // '-public', '-private'
var prc_top_page_flag  = new String('');                  // '-top-page'

var prc_author_name    = new String(prc_friend_name);
var prc_background     = new String('background_1_100x100.jpg');
var prc_bg_color       = new String(PRC_BG_WHEAT);
var prc_body_padding   = new String(12);
var prc_debug          = 0;
var prc_fg_color       = new String(PRC_FG_MAROON);
var prc_genre          = new String('');
var prc_redirect       = new String('');
var prc_source_code    = new String('');
var prc_subtitle       = new String('');
var prc_year           = new String('');

prc_format_flag = p_apply_overrides('format', prc_parms, ['-webpage', '-print'] , prc_format_flag);
if (prc_format_flag == '-print')
{
    prc_bg_color     = PRC_BG_WHITE;
    prc_body_padding = 48;
    prc_fg_color     = PRC_BG_BLACK;

// x_log("\n     prc_bg_color: \"" + prc_bg_color     + "\"");
// x_log("\n prc_body_padding: \"" + prc_body_padding + "\"");
// x_log("\n     prc_fg_color: \"" + prc_fg_color     + "\"");

    prc_style_2      = 'print';
x_log("\nprc_style_2: '" + prc_style_2 + "'");
x_log("\nSetting cycling background colors to various shades of gray since prc_format_flag is '-print'.");
    prc_cycling_bgcolors = [PRC_BG_GRAY_1, PRC_BG_GRAY_2, PRC_BG_GRAY_3];

// x_log("\nprc_cycling_bgcolors[0]: " + prc_cycling_bgcolors[0]);
// x_log("\nprc_cycling_bgcolors[1]: " + prc_cycling_bgcolors[1]);
// x_log("\nprc_cycling_bgcolors[2]: " + prc_cycling_bgcolors[2]);
}

/*- - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - */
/*         Apply overrides from prc_parms and the url string          */
/*- - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - */
prc_age_flag       = p_apply_overrides('age'         , prc_parms, ['-new', '-updated']   , prc_age_flag);
prc_private_flag   = p_apply_overrides('private'     , prc_parms, ['-public', '-private'], prc_private_flag);
prc_top_page_flag  = p_apply_overrides('top_page'    , prc_parms, ['-top-page']          , prc_top_page_flag);

prc_author_name    = p_apply_overrides('author_name' , prc_parms, 'author:'      , prc_author_name );
prc_background     = p_apply_overrides('background'  , prc_parms, 'background:'  , prc_background  );
prc_bg_color       = p_apply_overrides('bg_color'    , prc_parms, 'bg_color:'    , prc_bg_color    );
prc_body_padding   = p_apply_overrides('body_padding', prc_parms, 'body_padding:', prc_body_padding);
prc_debug          = p_apply_overrides('debug'       , prc_parms, 'debug:'       , prc_debug       );
prc_fg_color       = p_apply_overrides('fg_color'    , prc_parms, 'fg_color:'    , prc_fg_color    );
prc_genre          = p_apply_overrides('genre'       , prc_parms, 'genre:'       , prc_genre       );
prc_redirect       = p_apply_overrides('redirect'    , prc_parms, 'redirect:'    , prc_redirect    );
prc_source_code    = p_apply_overrides('source_code' , prc_parms, 'source:'      , prc_source_code );
prc_subtitle       = p_apply_overrides('subtitle'    , prc_parms, 'subtitle:'    , prc_subtitle    );
prc_year           = p_apply_overrides('year'        , prc_parms, 'year:'        , prc_year        );

x_log("\n        prc_age_flag: '" + prc_age_flag       + "'");
x_log("\n    prc_private_flag: '" + prc_private_flag   + "'");
x_log("\n   prc_top_page_flag: '" + prc_top_page_flag  + "'");

x_log("\n  prc_author_name: \"" + prc_author_name  + "\"");
x_log("\n   prc_background: \"" + prc_background   + "\"");
x_log("\n     prc_bg_color: \"" + prc_bg_color     + "\"");
x_log("\n prc_body_padding: \"" + prc_body_padding + "\"");
x_log("\n        prc_debug: "   + prc_debug              );
x_log("\n     prc_fg_color: \"" + prc_fg_color     + "\"");
x_log("\n        prc_genre: \"" + prc_genre        + "\"");
x_log("\n     prc_redirect: \"" + prc_redirect     + "\"");
x_log("\n  prc_source_code: \"" + prc_source_code  + "\"");
x_log("\n     prc_subtitle: \"" + prc_subtitle     + "\"");
x_log("\n         prc_year: \"" + prc_year         + "\"");

// This redirect service has nothing specifically
// to do with the purposes of this web site!
if (x_is_not_empty(prc_redirect))
{
    location = prc_redirect;
}

/*- - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - */
/*                       Figure out other stuff                       */
/*- - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - */
    prc_num_children = prc_number_of_children();
x_log("\nprc_num_children: \"" + prc_num_children + "\"");

    p_derive_timeline                             // derive prc_timeline
    (
        prc_page,
        prc_anchor
    );

/*--------------------------------------------------------------------*/
/*               Dynamically generate RSS and CSS links               */
/*            into the <HEAD> portion of the HTML document            */
/*--------------------------------------------------------------------*/
var prc_dynamic_html = new String
(
      "\n<link rel='alternate'  type='application/rss+xml' title='RSS Feed' href='rss.xml' />"
    + "\n<link rel='stylesheet' type='text/css' media=all href='prc.css' />"
    + "\n<link rel='stylesheet' type='text/css' media=all href='prc" + prc_style_2 + ".css' />"
);

/*--------------------------------------------------------------------*/
/*           Dynamically generate <TITLE> and </TITLE> tags           */
/*            into the <HEAD> portion of the HTML document            */
/*--------------------------------------------------------------------*/
prc_title_tag = new String(prc_title);
prc_title_tag = prc_title_tag.replace(/<br>/gi, " ");
prc_title_tag = prc_title_tag.replace(/<sbr>/gi, " ");
prc_title_tag = prc_title_tag.replace(/<.*?>/g, "");
prc_title_tag = x_squeeze(prc_title_tag);
if (prc_mode == 'test') prc_title_tag = '(' + prc_page + prc_anchor + ')';
prc_title_tag = "<title>" + prc_title_tag + "</title>";
x_log("\nprc_title_tag: '" + prc_title_tag + "'");
prc_dynamic_html += "\n" + prc_title_tag;
x_log("\nprc_dynamic_html: \"" + prc_dynamic_html + "\".");
x_write(prc_dynamic_html);

x_log("\n----------------------------------- I N I T I A L I Z A T I O N   C O D E");

/**********************************************************************/
/*                                                                    */
/*                  P U B L I C   F U N C T I O N S                   */
/*                                                                    */
/*                Public functions begin with "prc_".                 */
/*                They can be called from HTML, either                */
/*                 from Javascript or via HML macros                  */
/*                                                                    */
/**********************************************************************/

/*--------------------------------------------------------------------*/
/*                        HML macro shortcuts                         */
/*--------------------------------------------------------------------*/
function prc_PAC()           {prc_link('Pac'         )}
function prc_LAP()           {prc_link('Lap'         )}
function prc_HPCP()          {prc_link('Hpcp'        )}
function prc_WKP()           {prc_link('Wkp'         )}

function prc_SUBJECTIVITY()  {prc_link('Subjectivity')}
function prc_FUN()           {prc_link('Fun'         )}
function prc_EXHAUSTION()    {prc_link('Exhaustion'  )}
function prc_NATURE()        {prc_link('Nature'      )}
function prc_MATURITY()      {prc_link('Maturity'    )}
function prc_RENEGADE()      {prc_link('Renegade'    )}
function prc_FREUD()         {prc_link('Freud'       )}
function prc_LETTERS()       {prc_link('Letters'     )}
function prc_HANDBOOK()      {prc_link('Handbook'    )}
function prc_WOMAN()         {prc_link('Woman'       )}

/*--------------------------------------------------------------------*/
/*                        x_ function wrappers                        */
/*--------------------------------------------------------------------*/
function prc_code()
  {x_write(x_code())}
function prc_code_end()
  {x_write(x_code_end())}
function prc_dots(a_count)
  {x_write(x_dots(a_count))}
function prc_dropcap(a_letter)
  {x_write(x_dropcap(a_letter))}
function prc_reverse(a_string)
  {x_write(x_reverse(a_string))}
// function prc_row(a_col1)
//   {x_write(x_row(a_col1))}
function prc_scrapbook(a_title, a_rows)
  {x_write(x_scrapbook(a_title, a_rows))}
function prc_stars(a_count)
  {x_write(x_stars(a_count))}
function prc_tab()
  {x_write(x_tab())}
function prc_tabs(a_count)
  {x_write(x_tabs(a_count))}
function prc_write(a_string) {x_write(a_string)}

/*--------------------------------------------------------------------*/
/*                     x_ media function wrappers                     */
/*--------------------------------------------------------------------*/
function prc_snapshot(a_filespec, a_resize, a_parms, a_caption_override)
{
    x_write(x_snapshot(a_filespec, a_resize, a_parms, a_caption_override));
}
function prc_soundbite(a_filespec, a_resize, a_parms, a_caption_override)
{
    if (prc_format_flag == '-print') return;
    x_write(x_soundbite(a_filespec, a_resize, a_parms, a_caption_override));
}

function prc_videoclip(a_filespec, a_resize, a_parms, a_caption_override)
{
    if (prc_format_flag == '-print') return;
    x_write(x_videoclip(a_filespec, a_resize, a_parms, a_caption_override));
}

/*--------------------------------------------------------------------*/
/*                        p_ function wrappers                        */
/*--------------------------------------------------------------------*/
function prc_analog(a_analog, a_flags)                           {x_write(p_analog(a_analog, a_flags))}
function prc_friend(a_person, a_attrib, a_1, a_2, a_3)           {x_write(p_friend(a_person, a_attrib, a_1, a_2, a_3))}
function prc_email_link()                                        {x_write(p_email_link())}
function prc_floating_row()                                      {x_write(p_floating_row())}
function prc_floating_row_end()                                  {x_write(p_floating_row_end())}
function prc_h1(a_parms)                                         {x_write(p_header(1, a_parms));}
function prc_h2(a_parms)                                         {x_write(p_header(2, a_parms));}
function prc_h3(a_parms)                                         {x_write(p_header(3, a_parms));}
function prc_h4(a_parms)                                         {x_write(p_header(4, a_parms));}
function prc_h5(a_parms)                                         {x_write(p_header(5, a_parms));}
function prc_h6(a_parms)                                         {x_write(p_header(6, a_parms));}
function prc_highlight()                                         {x_write(p_highlight())}
function prc_highlight_end()                                     {x_write(p_highlight_end())}
function prc_hover_hint(a_anchor, a_hint, a_top, a_left)         {x_write(p_hover_hint(a_anchor, a_hint, a_top, a_left));}
function prc_hover_link(a_anchor, a_link, a_hint, a_top, a_left) {x_write(p_hover_link(a_anchor, a_link, a_hint, a_top, a_left));}
function prc_link(a_page, a_anchor, a_title)                     {x_write(p_link(a_page, a_anchor, a_title))}
function prc_sidebar(a_align, a_width)                           {x_write(p_sidebar(a_align, a_width))}
function prc_sidebar_end()                                       {x_write(p_sidebar_end())}
function prc_table(a_parms)                                      {x_write(p_table(a_parms))}
function prc_table_end()                                         {x_write(p_table_end())}
function prc_table_of_contents(a_toc_type)                       {x_write(p_table_of_contents(a_toc_type))}


/*--------------------------------------------------------------------*/
/*                       Link-decorating icons                        */
/*--------------------------------------------------------------------*/
function p_page_icon_is_active()   {return "<span title=\"This page is active\"       ><img src='_media/snapshots/page_is_active_14x13.gif'></span>"  ;}
function p_page_icon_is_current()  {return "<span title=\"This is the page you're on\"><img src='_media/snapshots/page_is_current_14x13.gif'></span>" ;}
function p_page_icon_is_inactive() {return "<span title=\"This page is inactive\"     ><img src='_media/snapshots/page_is_inactive_14x13.gif'></span>";}

function p_page_icon_is_new()      {return "<span title=\"This page is new\"          ><img src='_media/snapshots/page_is_new_28x11.gif'></span>"     ;}
function p_page_icon_was_updated() {return "<span title=\"This page has been updated\"><img src='_media/snapshots/page_was_updated_60x12.gif'></span>";}

function p_page_icon_has_collage() {return "<span title=\"This page includes one or more collages by Rachel Bartlett\"><img src='_media/snapshots/page_has_collage_17x16.gif'></span>";}
function p_page_icon_is_pdf()      {return "<span title=\"This document is a PDF\"                                    ><img src='_media/snapshots/page_is_pdf_17x16.gif'></span>"     ;}
function p_page_icon_is_external() {return "<span title=\"This page is external to this site\"                        ><img src='_media/snapshots/page_is_external_13x15.gif'></span>";}
function p_page_icon_is_wikipedial()
{
    return "<span title=\"This page is a Wikipedia article\" "
        + "style='font-family: garamond; font-weight: bold; font-size: 120%; "
        + "color: black; background-color: white;'>W</span>";
}

/*--------------------------------------------------------------------*/
/*                       prc_lookup() wrappers                        */
/*--------------------------------------------------------------------*/
function prc_abebooks(a_show, a_sarg) {prc_lookup(a_show, a_sarg, "http://www.abebooks.com/servlet/SearchResults?tn=");}
function prc_alibris (a_show, a_sarg) {prc_lookup(a_show, a_sarg, "http://www.alibris.com/booksearch?keyword="       );}
function prc_amazon  (a_show, a_sarg) {prc_lookup(a_show, a_sarg, "http://www.amazon.com/s?field-keywords="          );}
function prc_google  (a_show, a_sarg) {prc_lookup(a_show, a_sarg, "http://www.google.com/search?q="                  );}
function prc_wiki    (a_show, a_sarg) {prc_lookup(a_show, a_sarg, "http://en.wikipedia.org/wiki/"                    );}

function prc_lookup_links(a_sources, a_show, a_sarg) {x_write(x_lookup_links(a_sources, a_show, a_sarg));}

/*--------------------------------------------------------------------*/
/*                     prc_analog_row() function                      */
/*--------------------------------------------------------------------*/
function prc_analog_row(a_feminine, a_masculine)
{
x_log("\nprc_analog_row('" + a_feminine + "', '" + a_masculine + "')");
    var result = p_floating_row()
        + "<td align=right>" + a_feminine  + "</td>"
        + "<td align=left>"  + a_masculine + "</td>"
        + p_floating_row_end();
x_log("\n => '" + result + "'");
    x_write(result);
}

/*--------------------------------------------------------------------*/
/*                        prc_body() function                         */
/*                                                                    */
/*           This function is called by the <<body>> macro,           */
/*             which is generated by the pre_processor()              */
/*                      function in hml_cfg.pl.                       */
/*--------------------------------------------------------------------*/
function prc_body()
{
x_log("\nP R C _ B O D Y ( ) -----------------------------------------------------");
    var result = new String("\n");
    result += "<style>"
            + "\nbody"
            + "\n{"
            + "\n    color: " + prc_fg_color + ";"
            + "\n    padding: " + prc_body_padding + ";"
            + "\n}"
            + "\n</style>";
    if (prc_format_flag == '-print')
    {
        result += "<body id=plx_body bgproperties='fixed' onload='prc_onload()'>";
    }
    else
    {
// Need to declare id= so x_hover_show() can find padding values?
        var body_tag = new String("<body id=plx_body bgproperties='fixed' onload='prc_onload()'"
            + " background='_media/snapshots/" + prc_background + "'>");
        result += "\n" + body_tag;

        var p_rosenfels = x_hover_hint
        (
            p_friend('pr', 'snapshot', 'x150', '-center -nocaption -small'),
            "<big><b>" + x_expand_caption_codes(plx_parse_source_caption) + ".</b></big>"
        );
        var f_face = famous_face(150, 24, 60, "famous_faces");

        result += p_table("border=00 width='100%' cellpadding=6 cellspacing=0")
            + "\n<tr bgcolor=" + prc_bg_color + ">"
            + "\n<td width=250 align=center>" + p_rosenfels + "</td>";

/*- - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - */
/*                    Home Page (in any language)                     */
/*- - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - */
        if (prc_page.substr(0, 5) == 'index' && prc_anchor == '')
        {
// Use height in pixels ('x125') for resize parm because
// document.body.clientHeight doesn't exist at this point:

            result += "\n<td>"
                + "\n<h1 align=center style='margin: 0;'>"
                + "\n" + p_peek(p_translate(PRC_WEBSITE, prc_language_initial))
                + "\n</h1>"

                + "\n<p class=center style='margin-top: 24;'><i>"
                + p_translate(PRC_MOTTO, prc_language_initial) + "</i></p></td>"
        }

/*- - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - */
/*                           NOT Home Page                            */
/*- - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - */
        else
        {
            result += "\n<td>"
//                 + "<span onclick='location = index" + prc_language_suffix + ".htm;'>"
                + "\n<h2 align=center style='margin: 0;'>"
                + "\n" + p_peek(p_translate(PRC_WEBSITE, prc_language_initial))
                + "\n</h2>"

            result += "\n<p style='"
                + "text-indent: 0; "
                + "font-family: Verdana, Palatino, Century Schoolbook; "
                + "font-weight: normal; "
                + "font-size: 14; "
                + "margin-top: 0; margin-bottom: 8; margin-left: 18; margin-right: 0; "
                + "line-height: 120%; "
                + "'>";

            if (prc_menu_type == 'DH')
            {
                result += "\n<a href='index" + prc_language_suffix + ".htm'><b>HOME</b></a>";
                result += p_translation_links('index' + prc_language_suffix);
            }

x_log("\nplx_url_parms[\"timeline\"]: " + plx_url_parms["timeline"] + ".");

/*- - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - */
/*               Unless the page is private, show its timeline            */
/*- - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - */
            if (prc_private_flag == '-private')
            {
x_log("\nThis page is private, so we'll suppress the timeline.");
            }
            else
            {
x_log("\nThis page is public, so we'll show the timeline.");
                var tlx;
                var arrow = "&minus;>";
                var indent = x_tabs(1);
                for (tlx = 1; tlx < prc_depth; tlx++)
                {
//                     if (prc_url_timeline_parm == 'wraparound')
//                     {
//                         result += "\n&nbsp;" + arrow + "&nbsp;";
//                     }
//                     else // if (prc_url_timeline_parm == 'staircase')
//                     {
                        result += "\n<br>" + indent;
//                     }
                    result += p_assemble('-timeline', prc_timeline[tlx]);
                    indent += x_tabs(1);
                }
            }
            result += "</p></td>";
        }
        result += "\n<td width=250 align=center>" + f_face + "</td></tr>" + p_table_end();

    }
x_log("\nprc_body() => \"" + result + "\"");
x_log("\n----------------------------------------------------- P R C _ B O D Y ( )");
    x_write(result);
}

/*--------------------------------------------------------------------*/
/*                      prc_body_end() function                       */
/*                                                                    */
/*          This function is called by the <</body>> macro,           */
/*             which is generated by the pre_processor()              */
/*                      function in hml_cfg.pl.                       */
/*--------------------------------------------------------------------*/
function prc_body_end()
{
x_log("\nP R C _ B O D Y _ E N D ( ) ---------------------------------------------");
    var result = new String("\n");
    if (prc_format_flag == '-print')
    {
        result += "</body>";
    }
    else
    {

/*- - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - */
/*                         Author's Biography                         */
/*- - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - */
        if (prc_friend_initials != 'dh')
        {
            if (prc_friends[prc_friend_initials]['bio_has_been_used'] == false)
            {
                result += "<p class=right style='margin-left: 30%;'>&mdash; "
                    + p_friend(prc_friend_initials, 'name') + " "
                    + p_friend(prc_friend_initials, 'bio' ) + "</p>";
x_log("\nresult: \"" + result + "\"");
            }
        }

/*- - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - */
/*            Translations of this page in other languages            */
/*- - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - */
        p_translations_menu();

/*- - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - */
/*                   Menu of all of Author's pages                    */
/*- - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - */
        if (prc_friend_initials != 'dh') prc_friend(prc_friend_initials, 'menu');

/*- - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - */
/*                     Show this page's siblings                      */
/*                (i. e. pages having the same parent)                */
/*- - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - */
        if (prc_menu_type == 'DH') prc_sibling_menu();

/*- - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - */
/*       Offer other pages in this language if it's not English       */
/*- - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - */
        prc_foreign_language_menu();

/*- - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - */
/*                        Display a Search Box                        */
/*- - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - */
        result += "\n" + prc_search_box();

/*- - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - */
/*                  Offer the full Table of Contents                  */
/*- - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - */
        if (prc_menu_type == 'DH') result += "\n" + p_table_of_contents();

/*- - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - */
/*                            Bottom Panel                            */
/*- - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - */
        result += "\n<table border=00 bgcolor=" + prc_bg_color + " "
            + "width='100%' cellspacing=0 cellpadding=0 "
            + "style='border-width: 0px; border-color: black;'>";

/*- - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - */
/*                             First row                              */
/*- - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - */
        result += "\n<tr>\n<td colspan=9 style='padding-bottom: 4;'>"
            + "<h6 style='font-size: 16; text-align: center;'>"
            + "\n<a href='index" + prc_language_suffix + ".htm'>"
            + "<b>" + p_translate(PRC_WEBSITE, prc_language_initial) + "</b></a>"
            + p_translation_links('index' + prc_language_suffix) + " Website"
            + "\n<big>&copy;</big> 1997-" + x_yyyy() + " Dean Hannotte"
            + "\n</h6></td></tr>";

/*- - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - */
/*                      Second row, first column                      */
/*- - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - */

        result += "\n<tr><td width='40%' valign=top style='padding-left: 16;'><h6>"

          + "Formerly <a href='nsc/index.htm'>"
            + "<b>The Ninth Street Center, Inc.</b></a>"

            + "\n<br>All content by " + p_friend('dh')
            + " except where otherwise indicated"

            + "\n<br>Web design and programming by " + p_friend('rb')

            + "\n<br>Keep up to date by subscribing to "
            + "our <a href='rss.xml'><b>RSS feed</b></a> "
            + "<a href='rss.xml'><img border=0 "
            + "src='_media/snapshots/rss_icon_16x16.png'></a>"


/*- - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - */
/*                         Statistics Credit                          */
/*- - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - */
// This insert slows down the page fetch
// so we skip it when running in TEST mode
        if (prc_mode == 'prod')
        {
            result += "\n<br>Statistics by: <!-- Site Meter -->"
                + "<script type='text/javascript' "
                + "src='http://s13.sitemeter.com/js/counter.js?"
                + "site=s13rosenfels'>"
                + "</script>"
                + "<noscript>"
                + "<a href='http://s13.sitemeter.com/stats.asp?"
                + "site=s13rosenfels' target='_top'>"
                + "<img src='http://s13.sitemeter.com/meter.asp?"
                + "site=s13rosenfels' "
                + "alt='Site Meter' border=0></a>"
                + "</noscript>"
                + "<!-- Copyright (c)2009 Site Meter -->";
        }

/*- - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - */
/*                           Second column                            */
/*- - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - */
        result += "\n</h6></td>"
            + "<td width='20%' valign=top align=center style='padding-right: 16;'>"
            + "\n<h6>";

/*- - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - */
/*                             ClustrMap                              */
/*- - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - */
        if (prc_mode == 'prod')
        {
            result += "<a "
                + "href='http://www3.clustrmaps.com/counter/maps.php?"
                + "url=http://www.rosenfels.org' "
                + "id='clustrMapsLink'><img "
                + "src='http://www3.clustrmaps.com/counter/index2.php?"
                + "url=http://www.rosenfels.org' style='border:0px;' "
                + "alt='Locations of visitors to this page' "
                + "title='Locations of visitors to this page' "
                + "id='clustrMapsImg' onerror='this.onerror=null; "
                + "this.src=\"http://www2.clustrmaps.com/images/clustrmaps-back-soon.jpg\"; "
                + "document.getElementById(\"clustrMapsLink\")"
                + ".href=\"http://www2.clustrmaps.com\";'/></a>";
        }

/*- - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - */
/*                            Third column                            */
/*- - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - */
        result += "\n</h6></td>"
            + "<td width='40%' valign=top align=right style='padding-right: 16;'><h6>"
            + "\nWrite to us at " + p_email_link()
            + "\n<br>Join the " + p_link(PRC_YAHOO_GROUP_URL,
              '', "<b>Paul Rosenfels Group</b>");

//         var mod_date = new String();
// x_log("\ndocument.lastModified: '" + document.lastModified + "'");
//         if (x_is_not_empty(document.lastModified))
//         {
//             mod_date = document.lastModified;
//             mod_date = mod_date.substr(6, 4)
//                      + mod_date.substr(0, 2)
//                      + mod_date.substr(3, 2);
//         }

// alert("prc_pubdate: '" + prc_pubdate + "'"
//   + "\nmod_date: '" + mod_date + "'");

        var preposition = "on";
        if (prc_pubdate.substr(4, 4) == '0000') preposition = "in";
        result += "\n<br>This page was published "
            + preposition + " " + x_format_yyyymmdd(prc_pubdate);

//         preposition = "on";
//         if (mod_date.length == 4) preposition = "in";
//         result += "\n<br>and last modified " + preposition
//             + " " + x_format_yyyymmdd(mod_date);

        if (typeof prc_hml_modified != 'undefined')
        {
            result += "\n<br>and last modified on "
                + x_format_yyyymmdd(prc_hml_modified);
        }

/*- - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - */
/*                         Menu System Credit                         */
/*- - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - */
        if (prc_menu_type == 'UDM4')
        {
            result += "\n<br><a href=\"http://www.udm4.com\"><b>UDM4</b></a>"
                + " menu system by <a href=\"http://brothercake.com\">"
                + "<b>BrotherCake</b>&nbsp;"
                + "<img src='udm-resources/favicon.gif' border=0></a>";
        }

/*- - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - */
/*                   Share this page with bloggers                    */
/*- - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - */
// I stole this code from
// http://www.sott.net/articles/show/211878-New-Dinosaur-Dubbed-Mojoceratops-Over-a-Few-Beers-
        if (prc_mode == 'prod')
        {
            result += "<br><a href='javascript:void window.open(\"http://www.blogger.com/blog-this.g?&amp;u=\"+encodeURIComponent(location.href)+\"&amp;n=\"+encodeURIComponent(document.title)+\"&amp;t=\"+encodeURIComponent(location.href))'                              title='Blog about this page on Blogger'                                          ><img border=0 src='_media/snapshots/sharing/blogger_20x20.jpg'     title='Blogger'      name='Blogger'     id='Blogger'    ></a>"
                + "\n&nbsp;<a href='javascript:void window.open(\"http://del.icio.us/post?v=4&amp;noui&amp;jump=close&amp;url=\"+encodeURIComponent(location.href)+\"&amp;title=\"+encodeURIComponent(document.title))'                                                      title='Bookmark this page to Delicious'                                          ><img border=0 src='_media/snapshots/sharing/delicious_16x16.png'   title='Delicious'    name='Delicious'   id='Delicious'  ></a>"
                + "\n&nbsp;<a href='javascript:void window.open(\"http://digg.com/submit?phase=2&amp;url=\"+encodeURIComponent(window.location.href)+\"&amp;title=\"+encodeURIComponent(document.title))'                                                                    title='Bookmark this page to Digg'                                               ><img border=0 src='_media/snapshots/sharing/digg_16x14.png'        title='Digg'         name='Digg'        id='Digg'       ></a>"
                + "\n&nbsp;<a href='javascript:void window.open(\"http://www.google.com/bookmarks/mark?op=edit&amp;bkmk=\"+encodeURIComponent(document.location.href)+\"&amp;title=\"+encodeURIComponent(document.title))'                                                   title='Bookmark this page to Google'                                             ><img border=0 src='_media/snapshots/sharing/google_16x16.png'      title='Google'       name='Google'      id='Google'     ></a>"
                + "\n&nbsp;<a href='javascript:void window.open(\"http://www.newsvine.com/_tools/seed&amp;save?u=\"+encodeURIComponent(location.href)+\"&amp;h=\"+encodeURIComponent(document.title))'                                                                       title='Bookmark this page to Newsvine'                                           ><img border=0 src='_media/snapshots/sharing/newsvine_16x16.png'    title='Newsvine'     name='Newsvine'    id='Newsvine'   ></a>"
                + "\n&nbsp;<a href='javascript:void window.open(\"http://reddit.com/submit?url=\"+encodeURIComponent(location.href)+\"&amp;title=\"+encodeURIComponent(document.title))'                                                                                     title='Bookmark this page to Reddit'                                             ><img border=0 src='_media/snapshots/sharing/reddit_18x18.png'      title='Reddit'       name='Reddit'      id='Reddit'     ></a>"
                + "\n&nbsp;<a href='javascript:void window.open(\"http://www.simpy.com/simpy/LinkAdd.do?title=\"+encodeURIComponent(document.title)+\"&amp;href=\"+encodeURIComponent(location.href))'                                                                       title='Bookmark this page to Simpy'                                              ><img border=0 src='_media/snapshots/sharing/simpy_16x16.png'       title='Simpy'        name='Simpy'       id='Simpy'      ></a>"
                + "\n&nbsp;<a href='javascript:void window.open(\"http://slashdot.org/bookmark.pl?url=\"+encodeURIComponent(location.href)+\"&amp;title=\"+encodeURIComponent(document.title))'                                                                              title='Bookmark this page to Slashdot'                                           ><img border=0 src='_media/snapshots/sharing/slashdot_16x16.png'    title='Slashdot'     name='Slashdot'    id='Slashdot'   ></a>"
                + "\n&nbsp;<a href='javascript:void window.open(\"http://www.stumbleupon.com/submit.php?url=\"+encodeURIComponent(location.href)+\"&amp;title=\"+encodeURIComponent(document.title))'                                                                        title='Bookmark this page to Stumbleupon (need to download Stumbleupon Toolbar!)'><img border=0 src='_media/snapshots/sharing/stumbleupon_16x16.png' title='Stumbleupon'  name='Stumbleupon' id='Stumbleupon'></a>"
                + "\n&nbsp;<a href='javascript:void window.open(\"http://www.technorati.com/faves?add=\"+escape(document.location))'                                                                                                                                         title='Bookmark this page to Technorati'                                         ><img border=0 src='_media/snapshots/sharing/technorati_16x16.png'  title='Technorati'   name='Technorati'  id='Technorati' ></a>"
                + "\n&nbsp;<a href='javascript:void window.open(\"http://twitter.com/home?status=\"+escape(document.location))'                                                                                                                                              title='Add to Twitter'                                                           ><img border=0 src='_media/snapshots/sharing/twitter_18x18.png'     title='Twitter'      name='Twitter'     id='Twitter'    ></a>"
                + "\n&nbsp;<a href='javascript:void window.open(\"http://myweb2.search.yahoo.com/myresults/bookmarklet?t=\"+encodeURIComponent(document.title)+\"&amp;u=\"+encodeURIComponent(window.location.href)+\"&amp;tag=News, Politics, World Events, Pathocracy\")'  title='Bookmark this page to My Yahoo'                                           ><img border=0 src='_media/snapshots/sharing/myyahoo_18x18.png'     title='My Yahoo'     name='MyYahoo'     id='MyYahoo'    ></a>"
                + "\n&nbsp;<a href='javascript:void window.open(\"https://favorites.live.com/quickadd.aspx?url=\"+encodeURIComponent(location.href)+\"&amp;title=\"+encodeURIComponent(document.title))'                                                                     title='Bookmark this page to Windows Live'                                       ><img border=0 src='_media/snapshots/sharing/live_16x16.png'        title='Windows Live' name='WindowsLive' id='WindowsLive'></a>";
        }

/*- - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - */
/*                           AddThis Button                           */
/*- - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - */
//         result += '\n<br><!-- AddThis Button BEGIN -->'
//             + '<a href="http://www.addthis.com/bookmark.php?v=250" '
//             + 'onmouseover="return addthis_open(this, "", "[URL]", "[TITLE]")" onmouseout="addthis_close()" onclick="return addthis_sendto()">'
//             + '<img src="http://s7.addthis.com/static/btn/lg-share-en.gif" width="125" height="16" alt="Bookmark and Share" style="border:0"/>'
//             + '</a><script type="text/javascript" src="http://s7.addthis.com/js/250/addthis_widget.js?pub=dhannotte"></script>'
//             + '<!-- AddThis Button END -->';

        result += "</h6></td></tr>";

/*- - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - */
/*                             Third Row                              */
/*- - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - */
        result += "\n<tr><td colspan=9><h6 style='text-align: "
            + "justify; padding-left: 16; padding-right: 16;'>";

        result += "\nText recently added or updated is " + p_highlight()
            + "highlighted in yellow" + p_highlight_end() + ". ";

        result += "\nIn menus, " + p_page_icon_is_active() + " "
            + "means the page is active, "
            + p_page_icon_is_current() + " means you're "
            + "already on that page, and " + p_page_icon_is_inactive() + " "
            + "means the page is under construction. ";

        result += "\nIn links, "
            + "\n" + p_page_icon_is_wikipedial()
            + " means the page is a Wikipedia article, "
            + "\n" + p_page_icon_is_external() + " "
            + "means the page is external to this site, "
            + "\n" + p_page_icon_is_pdf() + " "
            + "means the page is a PDF, and "
            + "\n" + p_page_icon_has_collage() + " "
            + "means the page is illustrated by one or more "
            + "original collages by Rachel Bartlett. ";

        result += "\nIf the page is available in other languages, "
            + "links to those pages will be represented by the "
            + "first letter of each language (i.e. ";

        for (pl in prc_languages)
        {
            result += p_translation_icon(pl) + "="
                + prc_languages[pl]['name'] + ", ";
        }
        result = result.substr(0, result.length - 2);    // delete last ", "
        result += ").";                              // replace it with ")."

        result += "\nIf the frame thickens when you mouse over a "
            + "picture, you can enlarge it with a single click.";

        result += "\nTerms and proper names may be underlined "
            + "with dots. If you mouse over a dotted term, like "
            + p_hover_hint("love", "That fusing of the <b>feminine</b> "
            + "with a subject matter that is submitted to.")
            + ", a brief definition of how Paul uses that term will pop up. "
            + "If you mouse over a dotted name, like "
            + p_friend('pr', 'hover_link') + ", a brief capsule biography will pop up.";

        result += "\nTo see a printer-friendly version of this page, "
            + p_link(location + "?format=print", '', "click here") + ".";

        result += "</h6><h6 style='font-size: 16; text-align: center;'>"
            + "\n<b><i>Truth is a work in progress. "
            + "We like our diamonds rough.</i></b></h6>"
            + "</td></tr>";

// "This site is a living document. There will be continual additions and revisions."
// -- metropostcard.com

/*- - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - */
/*                           PayPal Button                            */
/*- - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - */

/*- - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - */
/*          Put Flag Counter on Home Page (in any language)           */
/*- - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - */
//         if (prc_mode == 'prod')
//         {
            if (prc_page.substr(0, 5) == 'index' && prc_anchor == '')
            {
                result += "<tr><td align=center colspan=9><h6>";

//                 result += "<table><tr><td>"
//                     + "<a href='http://s03.flagcounter.com/more/ThW'>"
//                     + "<img border=0 src='http://s03.flagcounter.com/count/ThW"
//                     + "/bg="     + PRC_BG_MINT_GREEN
//                     + "/txt="    + prc_fg_color
//                     + "/border=" + PRC_BD_WHITE
//                     + "/columns=9"
//                     + "/maxflags=54"
//                     + "/viewers=People+Have+Visited+Us+from+the+Following+Countries+Since+April+13,+2009"
//                     + "/labels=1/'></a>"
//                     + "</td></tr></table>";


                result += "<table><tr><td>"
                    + "<a href='http://s05.flagcounter.com/more/2VW'>"
                    + "<img alt='free counters' border='0' "
                    + "src='http://s05.flagcounter.com/count/2VW"
                    + "/bg=CCFFCC" // mint green
                    + "/txt=800000" // maroon
                    + "/border=FFFFFF" // white
                    + "/columns=9"
                    + "/maxflags=54"
                    + "/viewers=1"
                    + "/labels=1/'></a>"
                    + "</td></tr></table>";

                result += "</h6></td></tr>";
            }
//         }
        result += "</table></body>";
    }

x_log_resources_used();

x_log("\nprc_body_end() => \"" + result + "\"");
x_log("\n--------------------------------------------- P R C _ B O D Y _ E N D ( )");
//     result += "</span>";
    x_write(result);
//     if (prc_mode == 'test')
//     {
//         alert
// (
//   "-timeline ---------------------------------------------------------------------\n"
// + p_assemble('-timeline'         , prc_ptx) + "\n\n"
//
// + "-link -------------------------------------------------------------------------\n"
// + p_assemble('-link'             , prc_ptx) + "\n\n"
//
// + "-choice -----------------------------------------------------------------------\n"
// + p_assemble('-choice'           , prc_ptx) + "\n\n"
//
// + "-toc-entry --------------------------------------------------------------------\n"
// + p_assemble('-toc-entry -table', prc_ptx) + "\n\n"
//
//
// + "-toc-entry --------------------------------------------------------------------\n"
// + p_assemble('-toc-entry', prc_ptx) + "\n\n"
//
// + "-h1 ---------------------------------------------------------------------------\n"
// + p_assemble('-h1'       , prc_ptx)
// );
//     }
}

/*--------------------------------------------------------------------*/
/*                        prc_buzz() function                         */
/*--------------------------------------------------------------------*/
function prc_buzz(a_word, a_see)
{
    var name_tag = a_see.toUpperCase();
    name_tag = name_tag.replace(/\W/g, "");
    x_write("<a href='#" + name_tag + "' "
        +   "alt='See &quot;" + a_see + "&quot;' "
        + "title='See &quot;" + a_see + "&quot;'"
        + ">" + a_word + "</a>");
}

/*--------------------------------------------------------------------*/
/*                        prc_cells() function                        */
/*                                                                    */
/*             This function is used in MedProf.hml, etc.             */
/*--------------------------------------------------------------------*/
function prc_cells(a_cells)
{
    var cell_style = "style='padding-left: 8; padding-right: 8;'";
    var cx;
    var result = new String("<tr><td align=right "
        + "valign=top nowrap " + cell_style + ">"
        + "<b>" + a_cells[0] + "</b></td>");
    for (cx = 1; cx < a_cells.length; cx++)
    {
        var cell = a_cells[cx];
        cell = cell.replace(/-/g, "&minus;");
        cell = cell.replace(/Dr. /g, "Dr.&nbsp;");
        cell = cell.replace(/CELL: /g, "CELL:&nbsp;");
        cell = cell.replace(/FAX: /g, "FAX:&nbsp;");
        cell = cell.replace(/HOME: /g, "HOME:&nbsp;");
        cell = cell.replace(/WORK: /g, "WORK:&nbsp;");
        result += "<td valign=top " + cell_style + ">" + cell + "</td>";
    }
    result += "</tr>";
    x_write(result);
}

/*--------------------------------------------------------------------*/
/*                     prc_child_menu() function                      */
/*--------------------------------------------------------------------*/
function prc_child_menu(a_page, a_anchor, a_title)
{
    var ptx, i_page, i_anchor, i_title;
    i_page   = a_page;
    i_anchor = a_anchor;
    i_title  = a_title;
    if (typeof a_page   == 'undefined') i_page   = "";
    if (typeof a_anchor == 'undefined') i_anhcor = "";
    if (typeof a_title  == 'undefined') i_title  = "";
x_log("\nprc_child_menu('" + i_page + "', '" + i_anchor + "', \"" + i_title + "\");");
    var result = new String();
    if (i_page == "" || i_page == 0) i_page = prc_page;
    ptx = prc_index(i_page, i_anchor);
    if (typeof a_title == 'undefined') {i_title = pagetree[ptx + TITLE]}
x_log("\nptx: " + ptx + ", i_page: '" + i_page + "', i_anchor: '" + i_anchor + "', i_title: \"" + i_title + "\"");

x_log("\nDisplaying the child menu for '" + i_page + i_anchor + "'.");
    prc_menu(i_title);
    prc_child_choices(ptx);
    prc_menu_end();
}

/*--------------------------------------------------------------------*/
/*                    prc_child_choices() function                    */
/*--------------------------------------------------------------------*/
function prc_child_choices(a_ptx)
{
x_log("\nprc_child_choices(" + a_ptx + ");");
    var ptx = a_ptx;
x_log("\nptx: " + ptx);
    var depth = pagetree[ptx + DEPTH];
x_log("\ndepth: " + depth);
    for (ptx += DESCLEN; ptx < pagetree.length; ptx += DESCLEN)
    {
        if (pagetree[ptx + DEPTH] > depth + 1) continue;
        if (pagetree[ptx + DEPTH] < depth + 1) break;
        prc_choice(ptx);
    }
}

/*--------------------------------------------------------------------*/
/*                       prc_choice() function                        */
/*                                                                    */
/*         a_page can either be a name (and optional anchor),         */
/*                 a numeric index into the pagetree,                 */
/*                        or an external url.                         */
/*                                                                    */
/*   If a_page is missing it means the page is under construction.    */
/*     In that case the a_title must be given otherwise the page      */
/*                cannot be identified by the visitor.                */
/*                                                                    */
/*--------------------------------------------------------------------*/
function prc_choice(a_page, a_anchor, a_title, a_comment, a_parms)
{
    prc_menu_choices += p_assemble('-choice',
        a_page, a_anchor, a_title, a_comment, a_parms);
}

/*--------------------------------------------------------------------*/
/*                       prc_collage() function                       */
/*--------------------------------------------------------------------*/
function prc_collage(a_key, a_resize, a_parms, a_caption)
{
    var i_key     = '_' +  prc_page + '_';
    var i_resize  = '80%';
    var i_parms   = '-center';
    var i_caption = new String('');

    if (x_is_not_empty(a_key)    ) i_key     = a_key    ;
    if (x_is_not_empty(a_resize) ) i_resize  = a_resize ;
    if (x_is_not_empty(a_parms)  ) i_parms   = a_parms  ;
    if (x_is_not_empty(a_caption)) i_caption = a_caption;

    var snapshot = new String('');
    var last_slash;
x_log("\nprc_collage('" + i_key + "', '" + i_resize + "', '" + i_parms + "', '" + i_caption + "');");
x_log("\nSearching through " + prc_snapshots.length + " snapshots.");
    for (sx = 0; sx < prc_snapshots.length; sx++)
    {
x_log("\nsx: " + sx);
        snapshot = prc_snapshots[sx];
        last_slash = snapshot.lastIndexOf('/');
        if (last_slash > -1) snashot = snapshot.substr(last_slash + 1);
x_log("\nsnapshot: '" + snapshot + "'.");
x_log("\nsnapshot.substr(0, 3): " + snapshot.substr(0, 3));
        if (snapshot.substr(0, 3) != 'rb_') continue;
x_log("\nSearching for '" + i_key + "' within '" + snapshot + "'.");
        if (snapshot.indexOf(i_key) > -1) break;
    }
x_log("\nsx: " + sx);
    if (sx >= prc_snapshots.length)
    {
        return x_error("prc_collage(): Search argument '"
            + i_key + "' not found among collage names.");
    }
    var i_year = snapshot.substr(3, 4);
    if (i_caption == '')
    {
        i_caption = "[&copy; " + i_year + " Rachel Bartlett]<br>"
        + "<a href='rbCollages.htm'>See all of Rachel's collages</a>";
    }
    prc_snapshot(snapshot, i_resize, i_parms, i_caption);
}

/*--------------------------------------------------------------------*/
/*                     prc_friend_menu() function                     */
/*--------------------------------------------------------------------*/
function prc_friend_menu(a_friend_initials, a_menu_title)
{
x_log("\nprc_friend_menu(\"" + a_friend_initials + "\", \"" + a_menu_title + "\");");

    var friend_initials = prc_friend_initials;
    var menu_title      = '';
    if (x_is_not_empty(a_friend_initials)) friend_initials = a_friend_initials;
    if (x_is_not_empty(a_menu_title     )) menu_title      = a_menu_title     ;
x_log("\nfriend_initials: '" + friend_initials + "'");
x_log("\n     menu_title: '" + menu_title      + "'");

    var author_name = prc_friends[friend_initials]['name'];
    if (x_is_empty(author_name)) return;
x_log("\n    author_name: \"" + author_name + "\"");

    var first_name = author_name.substr(0, author_name.indexOf(" "));
x_log("\n     first_name: \"" + first_name  + "\"");

    if (x_is_empty(menu_title)) menu_title = first_name + "'s Pages";
    prc_menu(menu_title);
    var ptx;
    var page = new String();
    var title = new String();
    var rx = 0;
    var rows = new Array();
    for (ptx = 0; ptx < pagetree.length; ptx += DESCLEN)
    {
        this_page  = pagetree[ptx + PAGE ];
        this_title = pagetree[ptx + TITLE];
// x_log("\nthis_page: '" + this_page + "', this_title: \"" + this_title + "\"");
        if (this_page.substr(0, 2) == friend_initials)
        {
x_log("\n ptx: " + ptx + ", page: '" + this_page + "', title: \"" + this_title + "\".");
             rows[rx++] = ptx;
        }
    }
    rows = x_sort_table_selection_by_column(pagetree, rows, TITLE);
// x_log("\ntypeof rows: " + (typeof rows) + ", rows.length: " + rows.length);
    for (rx = 0; rx < rows.length; rx++)
    {
// x_log("\nrows[rx]: " + rows[rx] + ", title: '" + pagetree[rows[rx] + TITLE] + "'");
        prc_choice(rows[rx]);
    }
    prc_menu_end();
}

/*--------------------------------------------------------------------*/
/*                   prc_cycling_bgcolor() function                   */
/*--------------------------------------------------------------------*/
function prc_cycling_bgcolor()
{
x_log("\nprc_cycling_bgcolor()");
    var result = prc_cycling_bgcolors
    [
        ++prc_cycling_bgcolor_index % prc_cycling_bgcolors_dimen
    ];
x_log(" => '" + result + "'");
    return result;
}

/*--------------------------------------------------------------------*/
/*                  prc_cycling_snapshot() function                   */
/*--------------------------------------------------------------------*/
function prc_cycling_snapshot(a_snapshot_array)
{
x_log("\nprc_cycling_snapshot('" + a_snapshot_array + "');");
    var result = a_snapshot_array
    [
        [
            prc_cycling_snapshots_dealt
            [
                ++prc_cycling_snapshot_index % prc_cycling_snapshots_dimen
            ]
        ]
    ];
x_log("\nprc_cycling_snapshot() => '" + result + "'");
    return result;
}

/*--------------------------------------------------------------------*/
/*                       prc_dialog() function                        */
/*--------------------------------------------------------------------*/
function prc_dialog(a_dimen)
{
x_log("\nprc_dialog('" + a_dimen + "');");
// Dialogs look better when the first paragraph in each speech is
// NOT indented. Unfortunately, this trick only works in FireFox!
    x_write("\n<style>"
        + "\ntd p "
        + "\n{"
        + "\n    text-indent: 0;"
//         + "\n    margin-bottom: 16;"
        + "\n}"
        + "\n</style>");
    if (x_is_empty(a_dimen))
    {
        prc_cycling_bgcolors_dimen = 2;          // default to 2 colors
x_log("\nWill treat this as a dialog between " + prc_cycling_bgcolors_dimen + " people.");
    }
    else
    {
        if (a_dimen == '*')
        {
x_log("\nprc_cycling_bgcolors.length: '" + prc_cycling_bgcolors.length + "'");
            prc_cycling_bgcolors_dimen = prc_cycling_bgcolors.length;
        }
        else
        {
            prc_cycling_bgcolors_dimen = a_dimen;
        }
x_log("\nWill treat this 'dialog' as a list whose entries cycle between " + prc_cycling_bgcolors_dimen + " background colors.");
    }
// x_log("\nprc_cycling_bgcolors_dimen: '" + prc_cycling_bgcolors_dimen + "'");
    prc_floating_table();
}

/*--------------------------------------------------------------------*/
/*                     prc_dialog_end() function                      */
/*--------------------------------------------------------------------*/
function prc_dialog_end()
{
    prc_floating_table_end();
}

/*--------------------------------------------------------------------*/
/*                   prc_floating_table() function                    */
/*--------------------------------------------------------------------*/
function prc_floating_table(a_user_parms)
{
    var user_parms = new String(a_user_parms + ' ');
    if (x_is_empty(a_user_parms )) user_parms = '';
    sys_parms = new String("align=center width=0 cellspacing=8 cellpadding=8");
    if (prc_format_flag != '-print')
    {
        sys_parms += "\nstyle='padding-top: 4; padding-bottom: 4;"
            + " margin-top: 12; margin-bottom: 12;"
            + " background-image: url(_media/snapshots/" + prc_background + ");'";
    }
    prc_table(user_parms + sys_parms);
}

/*--------------------------------------------------------------------*/
/*                 prc_floating_table_end() function                  */
/*--------------------------------------------------------------------*/
function prc_floating_table_end()
{
    prc_table_end();
}

/*--------------------------------------------------------------------*/
/*                       prc_fnote() function                         */
/*--------------------------------------------------------------------*/
function prc_fnote(a_num)
{
x_log("\nprc_fnote(" + a_num + ");");
    prc_fnote_end();
    var num = new String();
    if (x_is_not_empty(a_num)) num = a_num;
    var bgcolor = PRC_BG_ORANGE;
    if (prc_format_flag == '-print') bgcolor = PRC_BG_GRAY;
    var result = new String
    (
          "<tr><td align=right valign=top>"
        + "<a name='FNOTE_" + num + "'></a>"
        + "<a href='#FNREF_" + num + "' "
        + "style='text-decoration: none;'>"
        + "<span title='Return to footnote reference' "
        + "style='cursor: pointer; "
        + "color: " + PRC_FG_WHITE + "; "
        + "background-color: " + bgcolor + "; "
        + "font-size: 18; padding-top: 8; font-weight: bold;'>"
        + "<sup><b>&nbsp;" + num + "&nbsp;</b></sub></span></a></td><td>"
    );
    prc_in_an_fnote = true;
x_log("\nprc_fnote(" + num + ") => \"" + result + "\"");
    x_write(result);
}

/*--------------------------------------------------------------------*/
/*                      prc_fnote_end() function                      */
/*--------------------------------------------------------------------*/
function prc_fnote_end()
{
x_log("\nprc_fnote_end()");
    if (prc_in_an_fnote == false) return;
    prc_in_an_fnote = false;
    x_write("</td></tr>");
}

/*--------------------------------------------------------------------*/
/*                       prc_fnref() function                         */
/*--------------------------------------------------------------------*/
function prc_fnref(a_num)
{
    var num = new String();
    if (x_is_not_empty(a_num)) num = a_num;
    var bgcolor = PRC_BG_ORANGE;
    if (prc_format_flag == '-print') bgcolor = PRC_BG_GRAY;
    var result = new String
    (
          "<a name='FNREF_" + num + "'></a>"
        + "<a href='#FNOTE_" + num + "' "
        + "style='text-decoration: none;'>"
        + "<span title='Go to footnote' "
        + "style='cursor: pointer; "
        + "color: " + PRC_FG_WHITE + "; "
        + "background-color: " + bgcolor + "; "
        + "font-size: 18; padding-top: 8; font-weight: bold;'>"
        + "<sup><b>&nbsp;" + num + "&nbsp;</b></sup></span></a>"
    );
x_log("\nprc_fnref(" + num + ") => \"" + result + "\"");
    x_write(result);
}

/*--------------------------------------------------------------------*/
/*                      prc_footnotes() function                      */
/*--------------------------------------------------------------------*/
function prc_footnotes(a_title)
{
x_log("\nprc_footnotes(\"" + a_title + "\")");
    var title = new String('Footnotes');
    if (x_is_not_empty(a_title)) title = a_title;
    prc_table("width=100% cellpadding=4 "
        + "style='border: 1px solid " + prc_fg_color + "; "
        + "margin-top: 16; margin-bottom: 16; padding: 8; '");
    x_write("<tr><td colspan=9 align=center>"
        + "<b>" + title + "</b></td></tr>");
}

/*--------------------------------------------------------------------*/
/*                    prc_footnotes_end() function                    */
/*--------------------------------------------------------------------*/
function prc_footnotes_end()
{
x_log("\nprc_footnotes_end()");
    prc_fnote_end();
    prc_table_end();
}

/*--------------------------------------------------------------------*/
/*                prc_foreign_language_menu() function                */
/*                                                                    */
/*         Offer other translations in this foreign language.         */
/*--------------------------------------------------------------------*/
function prc_foreign_language_menu()
{
x_log("\nprc_foreign_language_menu();");

x_log("\nprc_language_initial: '" + prc_language_initial + "'");

    if (prc_language_initial == "E")
    {
x_log("\nThis page is not in a foreign language.");
        return;
    }
    if (prc_page == prc_language_name)
    {
x_log("\nThis page is in " + prc_language_name + ", so the menu of " + prc_language_name + "-language pages appears above as the child menu.");
        return;
    }
    var menu_title = new String();
    menu_title = "Pages in " + prc_language_name;
    if (prc_language_initial == 'G')
    {
        menu_title = "Seiten auf Deutsch <br>[" + menu_title + "]";
    }
    prc_menu(menu_title);

    var ptx;
    var rx = 0;
    var rows = new Array();
    for (ptx = 0; ptx < pagetree.length; ptx += DESCLEN)
    {
        var this_page  = pagetree[ptx + PAGE ];
        var this_title = pagetree[ptx + TITLE];
        var this_parms = pagetree[ptx + PARMS];
        var this_language_initial = this_page.substr(this_page.length - 1, 1);
        if (this_language_initial == prc_language_initial)
        {
// x_log("\n ptx: " + ptx + ", this_page: '" + this_page + "', this_title: \"" + this_title + "\".");
             rows[rx++] = ptx;
        }
    }
    rows = x_sort_table_selection_by_column(pagetree, rows, TITLE);
x_log("\ntypeof rows: " + (typeof rows) + ", rows.length: " + rows.length);

    for (rx = 0; rx < rows.length; rx++)
    {
x_log("\nrows[rx]: " + rows[rx] + ", title: '" + pagetree[rows[rx] + TITLE] + "'");
        prc_choice(rows[rx]);
    }
x_log("\nDisplaying a menu of " + prc_language_name + "-language pages.");
    prc_menu_end();
}

/*--------------------------------------------------------------------*/
/*                         prc_hr() function                          */
/*--------------------------------------------------------------------*/
function prc_hr(a_style)
{
    var i_style = "margin: 24;";
    var result;
    if (typeof a_style != 'undefined') i_style = a_style;
    var result = new String();
    result = "<table width=96% align=center bgcolor=" + PRC_BG_ORANGE
        + " style='" + i_style + "'><tr><td></td></tr></table>";
    if (prc_format_flag == '-print')
    {
        result = "<hr>";
    }
x_log("\nprc_hr(\"" + i_style + "\") =>\n \"" + result + "\"");
    x_write("\n" + result);
}

/*--------------------------------------------------------------------*/
/*                        prc_index() function                        */
/*                                                                    */
/* The argument to this function can be either                        */
/*                                                                    */
/*     1) a numeric index into the pagetree table, in which case      */
/*        it will be validity-checked and then returned, or           */
/*                                                                    */
/*     2) a page and anchor pair, which will then be looked up        */
/*         in the pagetree table and the index returned.              */
/*                                                                    */
/* If the argument is invalid, this function returns -1.              */
/*                                                                    */
/*--------------------------------------------------------------------*/
function prc_index(a_page, a_anchor)
{
    if (typeof a_page   == 'undefined') a_page   = new String("");
    if (typeof a_anchor == 'undefined') a_anchor = new String("");
    var ptx;
    var errmsg = new String();
    if (typeof a_page == 'number')
    {
        ptx = a_page;
        if (ptx < 0)
        {
            errmsg = "prc_index(" + ptx + "): Index is less than 0.";
x_log("\n" + errmsg);
            return -1;
        }
        if (ptx > pagetree.length - DESCLEN)
        {
            errmsg = "prc_index(" + ptx + "): Index is greater than "
                + pagetree.length - DESCLEN + ".";
x_log("\n" + errmsg);
            return -1;
        }
        if (ptx % DESCLEN)
        {
            errmsg = "prc_index(" + ptx + "): Index is not a multiple of "
                + DESCLEN + ".";
x_log("\n" + errmsg);
            return -1;
        }
x_log("\nprc_index(" + ptx + ") => " + ptx);
        return ptx;
    }

// Since a Windows server will return the "Psychiatry.htm" page
// if "psychiatry.htm" is entered, we need to find out the correct
// page name by doing case-insensitive lookups. The easiest way
// to accomplish this is by translating each operand to upper case.
    var upper_case_page   = a_page.toUpperCase();
    var upper_case_anchor = a_anchor.toUpperCase();
    if (upper_case_page == "" && upper_case_anchor == "")
    {
        errmsg = "prc_index('', ''): Page name required/missing.";
x_log("\n" + errmsg);
        return -1;
    }
// x_log("\nupper_case_page: '" + upper_case_page + "', upper_case_anchor: '" + upper_case_anchor + "'");
    for (ptx = 0; ptx < pagetree.length; ptx += DESCLEN)
    {
        var this_upper_case_page, this_upper_case_anchor;
        this_upper_case_page   = pagetree[ptx + PAGE  ];
        this_upper_case_anchor = pagetree[ptx + ANCHOR];
        this_upper_case_page   = this_upper_case_page.toUpperCase();
        this_upper_case_anchor = this_upper_case_anchor.toUpperCase();
// x_log("\nIn upper case, pagetree[" + ptx + "]: '" + this_upper_case_page + this_upper_case_anchor + "'.");
        if (upper_case_page == this_upper_case_page && upper_case_anchor == this_upper_case_anchor)
        {
            if (a_page   != pagetree[ptx + PAGE]
            ||  a_anchor != pagetree[ptx + ANCHOR])
            {
x_log("\nCorrecting case of '" + a_page + a_anchor + "' to '" + pagetree[ptx + PAGE] + pagetree[ptx + ANCHOR] + "'.");
            }
x_log("\nprc_index('" + a_page + "', '" + a_anchor + "') => " + ptx);
            return ptx;
        }
    }
    errmsg = "prc_index('" + a_page + "', '" + a_anchor + "'): Page/anchor not found in pagetree.";
x_log("\n" + errmsg);
    return -1;
}

/*--------------------------------------------------------------------*/
/*                 prc_initials_of_friend() function                  */
/*--------------------------------------------------------------------*/
function prc_initials_of_friend(a_friend)
{
    var result = new String();
    for (initials in prc_friends)
    {
        if (prc_friends[initials]['name'] == a_friend)
        {
            result = initials;
            break;
        }
    }
x_log("\nprc_initials_of_friend(\"" + a_friend + "\") => '" + result + "'");
    return result;
}

/*--------------------------------------------------------------------*/
/*                    prc_james_analogs() function                    */
/*--------------------------------------------------------------------*/
function prc_james_analogs()
{
x_log("\nprc_james_analogs();");
    prc_floating_table();
    prc_analog_row("<b>TENDER-MINDED</b>", "<b>TOUGH-MINDED</b>");
    prc_analog_row("rationalistic<br>(going by principles)", "empiricist<br>(going by facts)");
    prc_analog_row("intellectualistic"   , "sensationalistic");
    prc_analog_row("idealistic"          , "materialistic");
    prc_analog_row("optimistic"          , "pessimistic");
    prc_analog_row("religious"           , "irreligious");
    prc_analog_row("free-willist"        , "fatalistic");
    prc_analog_row("monistic"            , "pluralistic");
    prc_analog_row("dogmatical"          , "skeptical");
    prc_floating_table_end();
}

/*--------------------------------------------------------------------*/
/*                        prc_line() function                         */
/*--------------------------------------------------------------------*/
function prc_line(who)
{
    prc_line_end();
    x_write("\n<tr><td nowrap align=right valign=top>"
        + "<b>" + who + "</b></td><td width=16></td><td>");
    prc_in_a_line = true;
}

/*--------------------------------------------------------------------*/
/*                        prc_line_end() function                     */
/*--------------------------------------------------------------------*/
function prc_line_end()
{
    if (prc_in_a_line)
    {
        x_write("</td></tr>");
        prc_in_a_line = false;
    }
}

/*--------------------------------------------------------------------*/
/*                       prc_lookup() function                        */
/*--------------------------------------------------------------------*/
function prc_lookup(a_show, a_sarg, a_html)
{
    if (prc_format_flag == '-print')
    {
        a_show = a_show.replace(/_/g, " ");
        x_write("<b>" + a_show + "</b>");
    }
    else
    {
        var i_link = x_lookup_link(a_show, a_sarg, a_html);
        if (p_page_is_wikipedial(a_html))
        {
            i_link = "<span title='Wikipedia article'>" + i_link
                + "&nbsp;" + p_page_icon_is_wikipedial() + "</span>";
        }
        else
        {
            i_link = "<span title='External link'>" + i_link
                + "&nbsp;" + p_page_icon_is_external() + "</span>";
        }
        x_write(i_link);
    }
}

/*--------------------------------------------------------------------*/
/*                        prc_menu() function                         */
/*                                                                    */
/*      The prc_menu() function generates tables that are 1)          */
/* centered, 2) have top and bottom margins that default to 16, and   */
/* 3) have left and right margins that default to 32.                 */
/*                                                                    */
/*      Specifying left and right margins in Firefox cancels the      */
/* effect of align=center, however. To avoid this, we encapsulate our */
/* table in another table that is centered but has no width, which    */
/* lets both tables grow to be as wide as necessary, but with a       */
/* minimum left and right margin.                                     */
/*                                                                    */
/*      If all the choices specified are empty because they were      */
/* already offered earlier in the page, then we don't want to show    */
/* even the menu title. For this reason, all code generated by        */
/* prc_menu() and prc_choice() is saved until prc_menu_end() is       */
/* issued, at which time we can see if any choices need be displayed. */
/*                                                                    */
/*--------------------------------------------------------------------*/
function prc_menu(a_title, a_parms)
{
    prc_menu_title = '';
    prc_menu_parms = '';
    if (x_is_not_empty(a_title)) prc_menu_title = a_title;
    if (x_is_not_empty(a_parms)) prc_menu_parms = a_parms;
x_log("\nprc_menu('" + prc_menu_title + "', '" + prc_menu_parms + "');");
// x_log("\nprc_menu_title = '" + prc_menu_title + "'.");
// x_log("\nprc_menu_parms = '" + prc_menu_parms + "'.");
}

/*--------------------------------------------------------------------*/
/*                      prc_menu_end() function                       */
/*--------------------------------------------------------------------*/
function prc_menu_end(a_flags)
{
x_log("\nprc_menu_end('" + a_flags + "');");
    var debug_flag = x_get_parm(a_flags, ['-debug']);
    var result = new String('');
    if (x_is_empty(prc_menu_choices))
    {
x_log("\nAll menu choices were suppressed, so we will suppress this entire menu.");
        return '';
    }
    else
    {
x_log("\nAt least one menu choice was NOT suppressed, so we will display this menu:\n'" + prc_menu_choices + "'");
    }
x_log("\nprc_menu_title = '" + prc_menu_title + "'.");
x_log("\nprc_menu_parms = '" + prc_menu_parms + "'.");
    result = p_table("align=center width=0") + "<tr><td>";
// I use padding: instead of margin: since I can control the
// background-color: for paddings, but when I use padding: for IE it
// propagates down and swells the table cells. So if I'm in IE I use
// margin:, otherwise I use padding:.
    if (x_browser() == 'IE')
    {
        result += p_table("style='margin-top: 16; margin-bottom: 16; "
            + "margin-left: 32; margin-right: 32;'");
    }
    else
    {
        result += p_table("style='padding-top: 16; padding-bottom: 16; "
            + "padding-left: 32; padding-right: 32;'");
    }
    if (prc_menu_title)
    {
x_log("\nprc_menu_title = \"" + prc_menu_title + "\".");
        result += "<tr><td colspan=9 align=center bgcolor=" + prc_bg_color
            + ">" + prc_menu_title + "</td></tr>";
        prc_menu_title = '';
    }
x_log("\nprc_menu_choices = \"" + prc_menu_choices + "\".");
    result += prc_menu_choices + p_table_end()
        + "</td></tr>" + p_table_end();
    prc_menu_choices = '';
    if (debug_flag) alert(result);
// x_log("\n" + result);
    if (prc_format_flag == '-print') return;
    x_write(result);
}

/*--------------------------------------------------------------------*/
/*                 prc_number_of_children() function                  */
/*--------------------------------------------------------------------*/
function prc_number_of_children(a_parent_page, a_parent_anchor)
{
x_log("\nprc_number_of_children('" + a_parent_page + a_parent_anchor + "')");
    var result = 0;
    var parent_page   = prc_page;
    var parent_anchor = prc_anchor;
    if (x_is_not_empty(a_parent_page))   parent_page   = a_parent_page;
    if (x_is_not_empty(a_parent_anchor)) parent_anchor = a_parent_anchor;
    var ptx = prc_index(parent_page, parent_anchor) + DESCLEN;
    var depth = pagetree[ptx] + DEPTH;
// x_log("\nfor(ptx = " + ptx + "; pagetree[ptx + DEPTH] >= " + depth + "; ptx += " + DESCLEN + ")");
    for
    (
        ptx;
        pagetree[ptx + DEPTH] >= depth;
        ptx += DESCLEN
    )
    {
// x_log("\nptx: " + ptx + ": " + pagetree[ptx + DEPTH] + " '" + pagetree[ptx + PAGE] + pagetree[ptx + ANCHOR] + "' \"" + pagetree[ptx + TITLE] + "\"");
        if (pagetree[ptx + DEPTH] > depth) continue;
        result++;
    }
// x_log("\nprc_number_of_children('" + a_parent_page + a_parent_anchor + "')");
x_log("\n => " + result);
    return result;
}

/*--------------------------------------------------------------------*/
/*                      prc_page_num() function                       */
/*--------------------------------------------------------------------*/
function prc_page_num(a_page_num)
{
    x_write("page&nbsp;" + a_page_num);
}

/*--------------------------------------------------------------------*/
/*                     prc_page_quote() function                      */
/*--------------------------------------------------------------------*/
function prc_page_quote()
{
    x_write("<p class=page_quote>");
}

/*--------------------------------------------------------------------*/
/*                   prc_page_quote_end() function                    */
/*--------------------------------------------------------------------*/
function prc_page_quote_end()
{
    x_write("</p>");
}

/*--------------------------------------------------------------------*/
/*                       prc_private() function                       */
/*--------------------------------------------------------------------*/
function prc_private(a_friends)
{
    x_write("<p>This document is private and "
        + "cannot be found using any search engine. It is "
        + "addressed exclusively to " + a_friends + ", so "
        + "please bookmark this page <b><i>now</i></b>.");
}
/*--------------------------------------------------------------------*/
/*                     prc_pull_quote() function                      */
/*--------------------------------------------------------------------*/
function prc_pull_quote(a_parms, a_quote)
{
    var table_align  = x_get_parm(a_parms, ['-left', '-right'], '-left');
    var table_width  = x_get_parm(a_parms, 'width:', '25%');
    var table_border = x_get_parm(a_parms, 'border:', '0');

    var table_margin_left  = 0;
    var table_margin_right = 16;
    var para_align         = 'right';

    table_align = table_align.substr(1);
    if (table_align == 'right')
    {
        var table_margin_left  = 16;
        var table_margin_right = 0;
        var para_align         = 'left';
    }

    var result = new String
    (
          "<table border='" + table_border + "' "
        + "align='" + table_align  + "' "
        + "width='" + table_width  + "' "
        + "style='margin-left: " + table_margin_left + "; "
        + "margin-right: " + table_margin_right + ";'><tr><td>"
        + "<p style=' text-align: " + para_align + "; "
        + "font-size: 150%;'>" + a_quote + "</p></td></tr></table>"
    );

x_log("\nprc_pull_quote('" + a_parms + "', \"" + a_quote + "\") => \n\"" + result + "\".");
    x_write(result);
}

/*--------------------------------------------------------------------*/
/*                  prc_cycling_snapshot() function                   */
/*--------------------------------------------------------------------*/
// function prc_cycling_snapshot(a_snapshot_array)
// {
// // var old_log_to_browser = x_log_to_browser(true);
// x_log("\nprc_cycling_snapshot('" + a_snapshot_array + "');");
//
//     if (prc_random_snapshots_used >= a_snapshot_array.length)
//     {
// x_log("\nAll " + a_snapshot_array.length + " snapshots have been used already!");
//         return '';
//     }
//
//     var result   = new String('');
//     var resource = new String('');
//     while (result == '')
//     {
//         var random = Math.random();
//         var sax    = Math.floor(random * a_snapshot_array.length);
//         result     = a_snapshot_array[sax];
// x_log("\n               random: " + random);
// x_log("\n                  sax: " + sax);
// x_log("\na_snapshot_array[" + sax + "]: '" + a_snapshot_array[sax] + "'");
//         x_parse_source(result);
//         resource = "snapshot=\"" + plx_parse_source_caption + "\"";
//         if (x_is_a_used_resource(resource))
//         {
// x_log("\nWe've used this snapshot already!");
//             result = '';
// // testing
// // return;
//         }
//     }
//     x_use_resource(resource);
//     prc_random_snapshots_used++;
// x_log("\nprc_random_snapshots_used: '" + prc_random_snapshots_used + "'");
// x_log("\n => '" + result + "'");
// // x_log_to_browser(old_log_to_browser);
//     return result;
// }

/*--------------------------------------------------------------------*/
/*                       prc_script() function                        */
/*--------------------------------------------------------------------*/
function prc_script()
{
x_log("\nprc_script();");
    var result = "<blockquote>" + p_table("align=center");
    x_write(result);
}

/*--------------------------------------------------------------------*/
/*                     prc_script_end() function                      */
/*--------------------------------------------------------------------*/
function prc_script_end()
{
x_log("\nprc_script_end();");
    var result = p_table_end() + "</blockquote>";
    x_write(result);
}

/*--------------------------------------------------------------------*/
/*                       prc_search() function                        */
/*--------------------------------------------------------------------*/
function prc_search()
{
x_log("\nprc_search();");
x_log("\nprc_search_form.prc_search_input.value: '"
       + prc_search_form.prc_search_input.value + "'");
    if (prc_search_form.prc_search_input.value == '')
    {
        alert("Please enter a search argument.");
        prc_search_form.prc_search_input.focus();
        return;
    }
    var new_loc = new String
    (
        "http://www.google.com/search?&q=" + encodeURI
        (
            prc_search_form.prc_search_input.value
            + " site:rosenfels.org "
        )
    );
x_log("\nGoing to '" + new_loc + "'.");
    location = new_loc;
}

/*--------------------------------------------------------------------*/
/*                     prc_search_box() function                      */
/*--------------------------------------------------------------------*/
function prc_search_box()
{
    var result = new String("<center><form name='prc_search_form' "
        + "action='javascript:prc_search();'>"
        + "<input name='prc_search_input' type='text' size=64>"
        + "&nbsp;&nbsp;<input type='submit' value='Search'>"
        + "</form></center>");
    return result;
}

/*--------------------------------------------------------------------*/
/*                    prc_sibling_menu() function                     */
/*--------------------------------------------------------------------*/
function prc_sibling_menu()
{
x_log("\nprc_sibling_menu();");
    var tlx, parent_page, parent_anchor, num_children;
x_log("\nprc_depth: " + prc_depth);
    for (tlx = prc_depth; tlx > 0; tlx--)
    {
        if (prc_depth == 1)                                 // HOME PAGE
        {
x_log("\nWill display a menu of our top pages instead of siblings.");
            prc_top_pages_menu();
            return;
        }
        parent_page   = pagetree[prc_timeline[tlx - 1] + PAGE  ];
        parent_anchor = pagetree[prc_timeline[tlx - 1] + ANCHOR];
x_log("\nparent_page: '" + parent_page + "'");
x_log("\nparent_anchor: '" + parent_anchor + "'");
        if (x_is_not_empty(parent_page))
        {
// If this ancestor has more than one child, show them:
            num_children = prc_number_of_children
            (
                parent_page, parent_anchor
            );
            if (num_children > 1)
            {
                if (prc_language_initial != 'E'
                &&  prc_language_name == parent_page)
                {
x_log("\nThe parent page is '" + parent_page + parent_anchor + "', so our siblings will already have been shown in the prc_foreign_language_menu().");
                }
                else
                {
                    prc_child_menu(parent_page, parent_anchor);
                }
                return;
            }
        }
        else
        {
x_log("\nThis ancestor has only one child. Try the next earlier ancestor.");
        }
    }
}

/*--------------------------------------------------------------------*/
/*                     prc_mode_header() function                     */
/*--------------------------------------------------------------------*/
// function prc_mode_header()
// {
//     var result = new String(p_translate(PRC_WEBSITE, prc_language_initial));
//     return result;
// }

/*--------------------------------------------------------------------*/
/*                     prc_source_name() function                     */
/*--------------------------------------------------------------------*/
function prc_source_name(a_source_name)
{
    var result = new String();
    if (x_is_not_empty(a_source_name))
    {
        result = "<p class=center>[reprinted from "
            + x_soften_breaks(a_source_name) + "]</p>";
    }
x_log("\nprc_source_name('" + a_source_name + "')\n => '" + result + "'");
    x_write("\n" + result);
    return result;
}

/*--------------------------------------------------------------------*/
/*                       prc_speech() function                        */
/*--------------------------------------------------------------------*/
function prc_speech(a_speaker, a_debug)
{
    var i_speaker = new String();
    if (typeof a_speaker != 'undefined') i_speaker = a_speaker;
    var result = new String();
    result += p_floating_row() + "<td valign=top><p class=right>"
        + i_speaker + "</p></td><td valign=top><p>";
    prc_in_a_speech = true;
x_log("\nprc_speech('" + a_speaker + "') => '" + result + "'");
if (a_debug) alert("prc_speech('" + a_speaker + "') => '" + result + "'");
    x_write(result);
}

/*--------------------------------------------------------------------*/
/*                     prc_speech_end() function                      */
/*--------------------------------------------------------------------*/
function prc_speech_end()
{
    if (!prc_in_a_speech) return;
    prc_in_a_speech = false;
    var result = new String("</p></td>" + p_floating_row_end());
// x_log("\nprc_speech_end() => '" + result + "'");
    x_write(result);
}

/*--------------------------------------------------------------------*/
/*                   prc_top_pages_menu() function                    */
/*--------------------------------------------------------------------*/
function prc_top_pages_menu(a_title)
{
x_log("\nprc_top_pages_menu('" + a_title + "')");
    var ptx;
//     var title = new String(p_translate(PRC_WEBSITE, prc_language_initial));
    var title = "Our Top Pages";
    if (x_is_not_empty(a_title)) {title = a_title}
    prc_menu(title);
    for (ptx = 0; ptx < pagetree.length; ptx += DESCLEN)
    {
        var this_page     = pagetree[ptx + PAGE   ];
        var this_anchor   = pagetree[ptx + ANCHOR ];
        var this_comment  = pagetree[ptx + COMMENT];
        var this_parms    = pagetree[ptx + PARMS  ];
        var top_page_flag = x_get_parm(this_parms, ['-top-page']);
        if (!top_page_flag) continue;
        if (this_page.substr(0, 7) == 'http://') continue;
        if (this_page.substr(0, 8) == 'https://') continue;
        prc_choice(this_page, this_anchor);
    }
    prc_menu_end();
}

/*--------------------------------------------------------------------*/
/*               prc_ultimate_dropdown_menu() function                */
/*--------------------------------------------------------------------*/
// function prc_ultimate_dropdown_menu()
// {
//     x_write("\n<script type='text/javascript' "
//         + "src='udm-resources/udm-dom.js'></script>"
//         + "\n<script type='text/javascript' "
//         + "src='udm-resources/udm-mod-keyboard.js'></script>");
// }

/*--------------------------------------------------------------------*/
/*                        prc_yyyy() function                         */
/*--------------------------------------------------------------------*/
function prc_yyyy(a_resource)
{
    x_write(x_yyyy());
}

/**********************************************************************/
/*                                                                    */
/*                     PRIVATE EXTERNAL FUNCTIONS                     */
/*                                                                    */
/*           Private internal functions begin with "prc_".            */
/*            They are called only by HML-generated code.             */
/**********************************************************************/

/*--------------------------------------------------------------------*/
/*                       prc_onload() function                        */
/*                                                                    */
/*             This function is called by the <body> tag,             */
/*             which is generated by the pre_processor()              */
/*                      function in hml_cfg.pl.                       */
/*                                                                    */
/*--------------------------------------------------------------------*/
function prc_onload()
{
// x_log("\nprc_onload();");
// x_log("\ndocument.body.clientWidth : " + document.body.clientWidth);
// x_log("\ndocument.body.clientHeight: " + document.body.clientHeight);
    prc_body_has_been_loaded = true;
// x_log("\n  prc_body_has_been_loaded: " + prc_body_has_been_loaded);
}

/**********************************************************************/
/*                                                                    */
/*                     PRIVATE INTERNAL FUNCTIONS                     */
/*                                                                    */
/*            Private internal functions begin with "p_".             */
/*             They can be called only from this library.             */
/**********************************************************************/

/*--------------------------------------------------------------------*/
/*                        p_analog() function                         */
/*--------------------------------------------------------------------*/
function p_analog(a_analog, a_flags)
{
x_log("\np_analog('" + a_analog + "', '" + a_flags + "');");
    var PRC_FG_RED           = 'FF0000';
    var PRC_FG_BLUE          = '0000FF';
    var PRC_BG_PINK          = 'FFCCCC';
    var PRC_BG_EGGSHELL_BLUE = 'CCCCFF';
    var style  = '';
    var result = '';
    var errmsg = '';
x_log("\nprc_format_flag: '" + prc_format_flag + "'");
    if (prc_format_flag == '-print')
    {
        style = "style='font-weight: bold;'";
        result = new String("<span " + style + ">" + a_analog + "</span>");
    }
    else
    {
        if (a_flags == '-f')                                     // feminine
        {
            color   = PRC_FG_RED;
            bgcolor = PRC_BG_PINK;
        }
        else if (a_flags == '-m')                               // masculine
        {
            color   = PRC_FG_BLUE;
            bgcolor = PRC_BG_EGGSHELL_BLUE;
        }
        else
        {
            errmsg = new String("Invalid flag, '" + a_flags + "' in prc_analog(\""
                + a_analog + "\", '" + a_flags + "').");;
x_log("\n => " + errmsg);
            return errmsg;
        }
        style = "style='color: " + color + "; "
            + "background-color: " + bgcolor + ";'";
        result = new String("<span " + style + ">&nbsp;" + a_analog + "&nbsp;</span>");
    }
x_log("\n => " + result);
    return result;
}

/*--------------------------------------------------------------------*/
/*                    p_apply_overrides() function                    */
/*                                                                    */
/* This function derives a particular PARM from three sources:        */
/*                                                                    */
/*     The global default.                                            */
/*     A value encoded in the prc_parms string.                       */
/*     A value encoded in the url string.                             */
/*--------------------------------------------------------------------*/
function p_apply_overrides(a_url_keyword, a_input, a_find, a_default)
{
    var url_parm;
x_log("\np_apply_overrides(\"" + a_url_keyword + "\", \"" + a_input + "\", \"" + a_find + "\", \"" + a_default + "\")");
    var result = x_get_parm(a_input, a_find, a_default);
    if (plx_url_parms.hasOwnProperty(a_url_keyword))
    {
        if (plx_url_parms[a_url_keyword] != '')
        {
x_log("\nplx_url_parms['" + a_url_keyword + "']: \"" + plx_url_parms[a_url_keyword] + "\"");
            result = plx_url_parms[a_url_keyword];
            if (a_find instanceof Array) result = '-' + result;
        }
    }
x_log("\np_apply_overrides() -> \"" + result + "\"");
    return result;
}

/*--------------------------------------------------------------------*/
/*                         p_debug() function                         */
/*--------------------------------------------------------------------*/
function p_debug(a_msg)
{
    if (prc_debug == 1) alert(a_msg);
    else                x_log("\n" + a_msg);
}

/*--------------------------------------------------------------------*/
/*                        p_friend() function                         */
/*                                                                    */
/*     "Friends" are the primary authors of this site's content       */
/* and are serviced by the <<friend>> macro. They include Michael     */
/* Ballin, Rachel Bartlett and Laurie Bell, who are identified        */
/* by the initials 'mb', 'rb' and 'lb' respectively.                  */
/*                                                                    */
/*--------------------------------------------------------------------*/
function p_friend
(
    a_initials, a_attrib, a_1, a_2, a_3
)
{
x_log("\np_friend('" + a_initials + "', '" + a_attrib + "', '" + a_1 + "', '" + a_2 + "', '" + a_3 + "')");

// Set parameter defaults:
    var i_initials = 'dh';
    var i_attrib   = 'hover_link';

// Override the parameters:
    if (x_is_not_empty(a_initials)) i_initials  = a_initials;
    if (x_is_not_empty(a_attrib)  ) i_attrib    = a_attrib  ;

x_log("\ni_initials: '" + i_initials + "'");
x_log("\n  i_attrib: '" + i_attrib   + "'");
x_log("\n       a_1: '" + a_1        + "'");
x_log("\n       a_2: '" + a_2        + "'");
x_log("\n       a_3: '" + a_3        + "'");

    var i_errmsg                    = '';
    var i_friend_name               = new String('');
    var i_friend_bio                = '';
    var i_friend_bio_has_been_used  = '';
    var i_friend_has_mailbox        = '';
    var i_friend_snapshot           = '';
    var i_first_name                = '';
    var result                      = new String('');

// If arguments are NOT valid:
    if (!(prc_friends[i_initials] instanceof Array))
    {
        i_errmsg = "Invalid initials in call to prc_friend('"
            + i_initials + "', ...);";
        return x_error(" <br>[<b>" + i_errmsg + "</b>]<br> ");
    }
    else if (i_attrib != 'bio'      && i_attrib != 'menu' &&  i_attrib != 'name'
         &&  i_attrib != 'snapshot' && i_attrib != 'hover_link')
    {
        i_errmsg = "Invalid attrib in call to prc_friend('"
            + i_initials + "', '" + i_attrib + "', ...);";
        return x_error(" <br>[<b>" + i_errmsg + "</b>]<br> ");
    }

    i_friend_name         = prc_friends[i_initials]['name'        ];
    i_friend_bio          = prc_friends[i_initials]['bio'         ];
    i_friend_bio_has_been_used = prc_friends[i_initials]['bio_has_been_used'];
    i_friend_has_mailbox  = prc_friends[i_initials]['has_mailbox' ];
    i_friend_snapshot     = prc_friends[i_initials]['snapshot'    ];
    i_first_name          = i_friend_name.substr(0, i_friend_name.indexOf(" "));

x_log("\n        i_friend_name: '" + i_friend_name         + "'");
x_log("\n         i_friend_bio: '" + i_friend_bio          + "'");
x_log("\ni_friend_bio_has_been_used: '" + i_friend_bio_has_been_used + "'");
x_log("\n i_friend_has_mailbox: '" + i_friend_has_mailbox  + "'");
x_log("\n    i_friend_snapshot: '" + i_friend_snapshot     + "'");
x_log("\n         i_first_name: '" + i_first_name          + "'");

/*- - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - */
/*                               'name'                               */
/*- - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - */
    if (i_attrib == 'name')
    {
        result = "<b>" + i_friend_name + "</b>";
    }

/*- - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - */
/*                             'snapshot'                             */
/*- - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - */
    else if (i_attrib == 'snapshot')
    {
        var i_resize  = '20%';
        var i_parms   = '';
        var i_caption = '';

        if (x_is_not_empty(a_1)) i_resize  = a_1;
        if (x_is_not_empty(a_2)) i_parms   = a_2;
        if (x_is_not_empty(a_3)) i_caption = a_3;

x_log("\n i_resize: '" + i_resize  + "'");
x_log("\n  i_parms: '" + i_parms   + "'");
x_log("\ni_caption: '" + i_caption + "'");

        var size = x_get_parm(i_parms, ['-large', '-small'], '-large');
        var snapshots = PRC_PAUL_LARGE_SQUARE_SNAPSHOTS;
        if (size == '-small') snapshots = PRC_PAUL_SMALL_SQUARE_SNAPSHOTS;

        if (i_initials == 'pr')
        {
            i_friend_snapshot = prc_cycling_snapshot(snapshots);
x_log("\ni_friend_snapshot: \"" + i_friend_snapshot + "\"");
        }
        if (x_is_not_empty(i_friend_snapshot))
        {
            result = x_snapshot(i_friend_snapshot, i_resize, i_parms, i_caption);
        }
    }

/*- - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - */
/*                               'bio'                                */
/*- - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - */
    else if (i_attrib == 'bio' && i_friend_bio_has_been_used == false)
    {
        if (prc_language_initial != 'E'
        &&  x_is_not_empty(prc_friends[i_initials]['bio' + prc_language_initial]))
        {
            i_friend_bio = prc_friends[i_initials]['bio' + prc_language_initial];
        }
        if (x_is_not_empty(i_friend_bio))
        {
            prc_friends[i_initials]['bio_has_been_used'] = true;
x_log("\nprc_friends['" + i_initials + "']['bio_has_been_used']: \"" + prc_friends[i_initials]['bio_has_been_used'] + "\"");
            result = i_friend_bio;
        }
    }

/*- - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - */
/*                               'menu'                               */
/*- - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - */
    else if (i_attrib == 'menu')
    {
        var i_menu_title = '';
        if (x_is_not_empty(a_1)) i_menu_title = a_1;
        prc_friend_menu(i_initials, i_menu_title);
    }

/*- - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - */
/*                            'hover_link'                            */
/*- - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - */
    else if (i_attrib == 'hover_link')
    {
x_log("\ni_attrib is '" + i_attrib + "'");
x_log("\nprc_format_flag is '" + prc_format_flag + "'");
        var i_anchor = new String("<b>" + i_friend_name + "</b>");
        if (prc_format_flag == '-print')
        {
            result = i_anchor;
x_log("\nSince prc_format_flag is '" + prc_format_flag + "', our hover_link will be '" + result + "'");
        }
        else
        {
            var i_link = new String();
            var i_hint = new String();
            var i_width, i_height;

            i_anchor = i_anchor.replace(/ /g, "&nbsp;");

// Image:
            if (i_initials == 'pr')
            {
                i_friend_snapshot = prc_cycling_snapshot(PRC_PAUL_SMALL_SQUARE_SNAPSHOTS);
x_log("\ni_friend_snapshot: \"" + i_friend_snapshot + "\"");
            }
            x_parse_source(i_friend_snapshot);

// Do NOT refer to document.body.clientWidth (even via x_window_width())
// until the page is completely loaded!
//             i_width  = Math.floor(x_window_width() / 15);

            i_width  = 100;
            i_height = Math.floor(i_width * (plx_parse_source_height / plx_parse_source_width));

            i_hint = "<img width=" + i_width + " height=" + i_height + " src='_media/snapshots/"
                + i_friend_snapshot + "' align=right style='margin-left: 16;'>";

// Name:
            i_hint += '<b>' + i_friend_name + '</b>';

// Bio:
            if (prc_language_initial != 'E'
            &&  x_is_not_empty(prc_friends[i_initials]['bio' + prc_language_initial]))
            {
                i_friend_bio = prc_friends[i_initials]['bio' + prc_language_initial];
            }
            if (x_is_not_empty(i_friend_bio))
            {
                i_hint += " " + i_friend_bio.replace(/<br>/g, " ");
            }

// Contact:
            if (i_friend_has_mailbox)
            {
                var i_mailbox = i_first_name.toLowerCase() + "." + x_yyyy();
                if (i_first_name == "Rachel" && prc_language_initial == 'G')
                {
                    i_hint += " " + i_first_name + " kann &uuml;ber "
                        + x_email
                        (
                            i_mailbox + "@rosenfels.org", i_mailbox, "rosenfels.org",
                            'subject=(Sent to ' + i_friend_name + ' from "' + x_page() + '")'
                        )
                        + " erreicht werden.";
                }
                else
                {
                    i_hint += " " + i_first_name + " can be reached at "
                        + x_email(i_mailbox + "@rosenfels.org", i_mailbox, "rosenfels.org",
                        'subject=(Sent to ' + i_friend_name + ' from "' + x_page() + '")') + '.';
                }
            }
x_log("\n          i_width: \"" + i_width + "\"");
x_log("\n         i_height: \"" + i_height + "\"");
x_log("\n       i_friend_bio: \"" + i_friend_bio + "\"");
x_log("\n           i_hint: \"" + i_hint + "\"");
            result = p_hover_link(i_anchor, i_link, i_hint);
        }
    }

/*- - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - */
/*                           return result                            */
/*- - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - */
x_log("\np_friend() => '" + result + "'");
    return result;
}

/*--------------------------------------------------------------------*/
/*                      p_email_link() function                       */
/*--------------------------------------------------------------------*/
function p_email_link()
{
    var result = x_email
    (
        x_yyyy() + '@' + "rosenfels.org",
        x_yyyy(),
        "rosenfels.org",
        'subject=(Sent from "' + x_page() + '")'
//         'subject=(Sent from "' + location + '")'
    );
    return result;
}

/*--------------------------------------------------------------------*/
/*                     p_floating_row() function                      */
/*--------------------------------------------------------------------*/
function p_floating_row()
{
    var result = new String("<tr bgcolor='" + prc_cycling_bgcolor() + "'>");
    return result;
}

/*--------------------------------------------------------------------*/
/*                   p_floating_row_end() function                    */
/*--------------------------------------------------------------------*/
function p_floating_row_end()
{
    return "</tr>";
}

/*--------------------------------------------------------------------*/
/*                        p_header() function                         */
/*--------------------------------------------------------------------*/
function p_header(a_level, a_parms)
{
    return p_assemble
    (
        "-h" + a_level,        // what to assemble
        prc_ptx,               // page
        '',                    // anchor
        '',                    // comment
        a_parms                // parms
    );
}

/*--------------------------------------------------------------------*/
/*                       p_highlight() function                       */
/*--------------------------------------------------------------------*/
function p_highlight()
{
    return "<span class=highlight title='This text "
        + "has recently been added or updated'>";
}

/*--------------------------------------------------------------------*/
/*                     p_highlight_end() function                     */
/*--------------------------------------------------------------------*/
function p_highlight_end()
{
    return "</span>";
}

/*--------------------------------------------------------------------*/
/*                      p_hover_hint() function                       */
/*--------------------------------------------------------------------*/
function p_hover_hint(a_anchor, a_hint, a_left, a_top)
{
    if (prc_format_flag == '-print')
    {
        return "<b>" + a_anchor + "</b>";
    }
    else
    {
        return x_hover_hint(a_anchor, a_hint, a_left, a_top);
    }
}

/*--------------------------------------------------------------------*/
/*                      p_hover_link() function                       */
/*--------------------------------------------------------------------*/
function p_hover_link(a_anchor, a_href, a_hint, a_left, a_top)
{
    if (prc_format_flag == '-print')
    {
        return "<b>" + a_anchor + "</b>";
    }
    else
    {
        return x_hover_link(a_anchor, a_href, a_hint, a_left, a_top);
    }
}

/*--------------------------------------------------------------------*/
/*                  p_page_is_wikipedial() function                   */
/*--------------------------------------------------------------------*/
function p_page_is_wikipedial(a_page)
{
    var result = false;
    if (a_page.indexOf("http://en.wikipedia.org/wiki/") > -1)
    {
        result = true;
    }
x_log("\np_page_is_wikipedial('" + a_page + "') => " + result);
    return result;
}

/*--------------------------------------------------------------------*/
/*                         p_link() function                          */
/*--------------------------------------------------------------------*/
function p_link(a_page, a_anchor, a_title)
{
    return p_assemble('-link', a_page, a_anchor, a_title);
}

/*--------------------------------------------------------------------*/
/*                         p_peek() function                          */
/*--------------------------------------------------------------------*/
function p_peek(a_html)
{
    return "<span onClick='x_peek();'>" + a_html + "</span>";
}

/*--------------------------------------------------------------------*/
/*                        p_sidebar() function                        */
/*--------------------------------------------------------------------*/
function p_sidebar(a_parms)
{
    var align_parm        = x_get_parm(a_parms, ['-left', '-right'], '-left');
    var width_parm        = x_get_parm(a_parms, 'width:', '33%');
    var margin_parm       = x_get_parm(a_parms, 'margin:', '16');
    var cell_padding_parm = x_get_parm(a_parms, 'cell-padding:', '16');
//     var font_size_parm = x_get_parm(a_parms, 'font-size:', '12');

    var bgcolor;
    if (prc_format_flag == '-print')
    {
        bgcolor = PRC_BG_GRAY_1;
    }
    else
    {
        bgcolor = PRC_BG_MINT_GREEN;
    }

    var margin_top    = margin_parm;
    var margin_bottom = margin_parm;
    var margin_left   = margin_parm;
    var margin_right  = margin_parm;

    if (align_parm == '-left' ) margin_left  = 0;
    if (align_parm == '-right') margin_right = 0;

    var result = p_table
    (
        "align='" + align_parm.substr(1) + "' width='" + width_parm + "' "
            + "cellpadding=" + cell_padding_parm + " bgcolor=" + bgcolor
            + "\nstyle='"
//             + "font-size: "     + font_size_parm + "; "
            + "margin-top: "    + margin_top     + "; "
            + "margin-bottom: " + margin_bottom  + "; "
            + "margin-left: "   + margin_left    + "; "
            + "margin-right: "  + margin_right   + ";'"
    )
    + "<tr><td>";
x_log("\nprc_sidebar() => '" + result + "'");
    return result;
}

/*--------------------------------------------------------------------*/
/*                      p_sidebar_end() function                      */
/*--------------------------------------------------------------------*/
function p_sidebar_end()
{
    var result = "\n</td></tr>" + p_table_end();
x_log("\nprc_sidebar_end() => '" + result + "'");
    return result;
}

/*--------------------------------------------------------------------*/
/*                         p_table() function                         */
/*--------------------------------------------------------------------*/
function p_table(a_parms)
{
    prc_table_depth++;
x_log("\n" + prc_table_depth + " p_table(\"" + a_parms + "\")");
    var result = "\n<table";
    if (prc_debug == 1)
    {
        var table_borders = ['#000000', '#ff0000',
            '#00ff00', '#0000ff', '#808080'];
        result += " border=04 cellspacing=01 bordercolor=\""
            + table_borders[prc_table_depth] + "\"";
    }
    if (x_is_not_empty(a_parms))
    {
        result += " " + a_parms;
    }
// If any of the following attributes were NOT
// specified, they'll default to the following values:
    result += "\nalign=center cellpadding=0 cellspacing=0>";
x_log(" => \"" + result + "\"");
    return result;
}

/*--------------------------------------------------------------------*/
/*                       p_table_end() function                       */
/*--------------------------------------------------------------------*/
function p_table_end()
{
x_log("\n" + prc_table_depth + " p_table_end()");
    prc_table_depth--;
    var result = "</table>";
x_log(" => \"" + result + "\"");
    return result;
}

/*--------------------------------------------------------------------*/
/*                   p_table_of_contents() function                   */
/*--------------------------------------------------------------------*/
function p_table_of_contents(a_toc_type)
{
x_log("\nP _ T A B L E _ O F _ C O N T E N T S ( ) -------------------------------");
    var result = new String("\n");
    var i_toc_type = '-form';
    if (x_is_not_empty(a_toc_type)) i_toc_type = a_toc_type;
    var i_toc_type = x_get_parm(i_toc_type, ['-form', '-table'], i_toc_type);

// NOTE: In Firefox tag attributes can't be names only; they must have
//       attributes following a keyword. "selected" won't work, but
//       "selected=\"selected\"" will. This has something to do with
//       Firefox's inane allegiance to the sillier rules of XHTML.

    if (i_toc_type == '-table')
    {
        result += p_table("width='100%'");
    }
    else // if (i_toc_type == '-form')
    {
        result += "<center>"
            + "\n<form name=prc_toc>"
            + "\n<select name=f_page"
            + "\n onChange='window.location = "
            + "document.prc_toc.f_page.options["
            + "document.prc_toc.f_page.selectedIndex].value;'>"
            + "\n<option selected=\"selected\" value=''>";

        result += x_tabs(25);

// Browsers like Firefox need a bit more padding:
        if (x_browser() == 'FF')
        {
            result += x_tabs(5);
        }

        result += "\nTable of Contents</option>";
    }

x_log_disable();
    for (ptx = 0; ptx < pagetree.length; ptx += DESCLEN)
    {
//         if (ptx == 5) x_log_disable();
        result += "\n" + p_assemble('-toc-entry ' + i_toc_type, ptx);
    }
x_log_enable();

    if (i_toc_type == '-table')
    {
        result += p_table_end();
    }
    else // if (i_toc_type == '-form')
    {
        result += "\n</select>\n</form>\n</center>";
    }
x_log("\np_table_of_contents('" + i_toc_type + "')");
x_log("\n => " + result + "\n");
x_log("\n-------------------------------- P _ T A B L E _ O F _C O N T E N T S ( )");
    return result;
}

/*--------------------------------------------------------------------*/
/*                    p_derive_timeline() function                    */
/*--------------------------------------------------------------------*/
function p_derive_timeline(a_page, a_anchor)
{
x_log("\np_derive_timeline('" + a_page + "', '" + a_anchor + "');");
    var ptx, tlx, depth, node, pubdate, page, anchor, title;
    for (ptx = 0; ptx < pagetree.length; ptx += DESCLEN)
    {
        this_depth    = pagetree[ptx + DEPTH  ];
        this_page     = pagetree[ptx + PAGE   ];
        this_anchor   = pagetree[ptx + ANCHOR ];
        prc_timeline[this_depth] = ptx;
        if (this_page == a_page && this_anchor == a_anchor) break;
    }
    for (tlx = 0; tlx < prc_timeline.length; tlx++)
    {
x_log("\n  tlx: " + prc_timeline[tlx]);
    }
}

/*--------------------------------------------------------------------*/
/*                   p_page_has_collage() function                    */
/*--------------------------------------------------------------------*/
function p_page_has_collage(a_page)
{
    var cpx, result = false;
    if (typeof prc_collage_pages != 'undefined')
    {
        for (cpx = 0; cpx < prc_collage_pages.length; cpx++)
        {
            if (a_page == prc_collage_pages[cpx])
            {
                result = true;
                break;
            }
        }
    }
x_log("\np_page_has_collage('" + a_page + "') => " + result);
    return result;
}

/*--------------------------------------------------------------------*/
/*                  p_normalize_hostname() function                   */
/*--------------------------------------------------------------------*/
function p_normalize_hostname()
{
x_log("\np_normalize_hostname();");
    var msg = "\nlocation.protocol: '" + location.protocol + "'"
            + "\nlocation.hostname: '" + location.hostname + "'"
            + "\nlocation.pathname: '" + location.pathname + "'";
    if  (location.host != location.hostname)
    {
        msg += "\nlocation.host: '" + location.host + "'";
    }
x_log(msg);
    var new_loc = new String();
    if ((location.hostname == 'www.ninthstreetcenter.org'
    ||   location.hostname == 'ninthstreetcenter.org')
    &&  (location.pathname == ''
    ||   location.pathname == '/'))
    {
// Google 'define' sends people to 'ninthstreetcenter.org/Glossary.htm'!
        if (location.pathname == '/Glossary.htm')
        {
            new_loc = "http://www.rosenfels.org/nsc/Glossary.htm";
        }
        else
        {
            new_loc = "http://www.rosenfels.org";
x_log("\nYou are being redirected to the new Paul Rosenfels "
                + "Community website at '" + new_loc + "'.");
            location = new_loc;
        }
    }

/*--------------------------------------------------------------------*/
/*                                                                    */
/*         Redirect from [www.]enlightenment-book-club.org[/]         */
/*                    to www.rosenfels.org/Enlightenment.htm          */
/*                                                                    */
/*--------------------------------------------------------------------*/
    if ((location.host     == 'enlightenment-book-club.org'
    ||   location.host     == 'www.enlightenment-book-club.org')
    &&  (location.pathname == ''
    ||   location.pathname == '/'))
    {
        new_loc = 'http://www.rosenfels.org/Enlightenment.htm';
x_log("\nYou are being redirected to '" + new_loc + "'.");
        location = new_loc;
    }

/*--------------------------------------------------------------------*/
/*                                                                    */
/*         Redirect from [www.]science-of-human-nature.org[/]         */
/*                  to www.rosenfels.org/Science.htm                  */
/*                                                                    */
/*--------------------------------------------------------------------*/
    if ((location.host     == 'science-of-human-nature.org'
    ||   location.host     == 'www.science-of-human-nature.org')
    &&  (location.pathname == ''
    ||   location.pathname == '/'))
    {
        new_loc = 'http://www.rosenfels.org/Science.htm';
x_log("\nYou are being redirected to '" + new_loc + "'.");
        location = new_loc;
    }
}

/*--------------------------------------------------------------------*/
/*                       p_translate() function                       */
/*--------------------------------------------------------------------*/
function p_translate(a_english_phrase, a_language_initial)
{
x_log("\np_translate(\"" + a_english_phrase + "\", '" + a_language_initial + "'\")");
    var result = new String(a_english_phrase);

    if (typeof a_language_initial != 'undefined'
    &&  a_language_initial != 'E'
    &&  prc_vocab[a_language_initial] instanceof Array
    &&  typeof prc_vocab[a_language_initial][a_english_phrase] != 'undefined')
    {
        result = prc_vocab[a_language_initial][a_english_phrase];
    }
x_log("\n = \"" + result + "\"");
    return result;
}

/*--------------------------------------------------------------------*/
/*                   p_translation_icon() function                    */
/*--------------------------------------------------------------------*/
function p_translation_icon(a_language_initial)
{
    var result = "<span title='Click here for the "
        + prc_languages[a_language_initial]['name']
        + " version of this page' style='"

        + "font-size: 14; "
        + "font-weight: bold; "
        + "color: " + PRC_FG_WHITE + "; "
        + "background-color: " + PRC_BG_PINK + "; "
        + "text-decoration: none; "

        + "'>&nbsp;" + a_language_initial + "&nbsp;</span>";
x_log("\np_translation_icon('" + a_language_initial + "') => " + result);
    return result;
}

/*--------------------------------------------------------------------*/
/*                   p_translation_links() function                   */
/*--------------------------------------------------------------------*/
function p_translation_links(a_page, a_anchor)
{
    var page      = new String(prc_page);
    var anchor    = new String(prc_anchor);
    var page_root = new String('');
    var lang_init = new String('');
    var lang_name = new String('');

    if (typeof a_page   != 'undefined') page   = a_page  ;
    if (typeof a_anchor != 'undefined') anchor = a_anchor;

x_log("\np_translation_links('" + page + "', '" + anchor + "')");

    var lang_init = page.substr(page.length - 1, 1);

    if ((prc_languages[lang_init] instanceof Array))
    {
        page_root = page.substr(0, page.length - 1);
        lang_name = prc_languages[lang_init]['name'];
    }
    else
    {
        page_root = page;
        lang_init = 'E';
        lang_name = 'English';
    }
x_log("\npage_root: \"" + page_root + "\"");
x_log("\nlang_init: \"" + lang_init + "\"");
x_log("\nlang_name: \"" + lang_name + "\"");

    var result           = new String('');
    var translation_page = new String('');
    var ptx              = 0;

    for (language_initial in prc_languages)
    {
// Don't link to the referenced page!
        if (language_initial == lang_init) continue;
        translation_page = page_root;
        translation_page += prc_languages[language_initial]['suffix'];
// Don't link to the current page!
        if (translation_page + anchor == prc_page + prc_anchor) continue;
// Is there a translation in this language?
        ptx = prc_index(translation_page, anchor);
        if (ptx > -1)
        {
            result += "\n<a style='text-decoration: none;' "
                + "href='" + translation_page + PRC_DEFAULT_EXT + anchor
                + "'>" + p_translation_icon(language_initial) + "</a>";
        }
    }
x_log("\n => '" + result + "'");
    return result;
}

/*--------------------------------------------------------------------*/
/*                   p_translations_menu() function                   */
/*                                                                    */
/*         Offer translations of this page in other languages         */
/*--------------------------------------------------------------------*/
function p_translations_menu()
{
x_log("\np_translations_menu();");
    var menu_title = new String();

/*--------------------------------------------------------------------*/
/*                    If this page is in English,                     */
/*        offer any foreign lanaguage versions that may exist         */
/*--------------------------------------------------------------------*/
    if (prc_language_initial == 'E')
    {
        var lang_init = new String();
        var lang_name = new String();
        var index     = -1;
        for (lang_init in prc_languages)
        {
            if (lang_init == 'E') continue;
            lang_name = prc_languages[lang_init]['name'];
            index = prc_index(prc_page + lang_init, prc_anchor);
            if (index > -1)
            {
// x_log("\nA " + lang_name + "-language verion of this page is named '" + prc_page + lang_init + prc_anchor + "'.");
                menu_title = "Here is a " + lang_name
                    + "-language version of this page";
                if (lang_init == 'G')
                {
                    menu_title += " <br>[Hier ist eine deutsche Version dieser Seite]";
                }
                prc_menu(menu_title);
                prc_choice(prc_page + lang_init, prc_anchor);
                prc_menu_end();
            }
        }
    }

/*- - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - */
/*  If this page is in a foreign language, offer the English version  */
/*- - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - */
    else
    {
x_log("\nSince there is currently an English version of every page, we don't need");
x_log("\n  to look up the English page in the index to make sure it exists.");
        var english_page = prc_page.substr(0, prc_page.length - 1);
x_log("\nWe may eventually publish pages whose original language was German, ");
x_log("\n  so we use the preposition 'an' rather than 'the' in the menu title.");

        menu_title = "Here is an English-language version of this page";
        if (prc_language_initial == 'G')
        {
            menu_title = "Hier ist eine englische Version "
                + "dieser Seite <br>[" + menu_title + "]";
        }
        prc_menu(menu_title);
        prc_choice(english_page, prc_anchor);
        prc_menu_end();
    }
}

/*--------------------------------------------------------------------*/
/*                       p_assemble() function                        */
/*--------------------------------------------------------------------*/
function p_assemble(a_what, a_page, a_anchor, a_title, a_comment, a_parms)
{
x_log("\nP R C _ A S S E M B L E ( ) ---------------------------------------------");

// Stringize the parms, but the a_* versions are still
// useful when you need to know if they're 'undefined'
    var i_what    = '';
    var i_page    = '';
    var i_anchor  = '';
    var i_title   = '';
    var i_comment = '';
    var i_parms   = '';

// Don't use x_is_not_empty() since a ptx of 0 is considered empty:
    if (typeof a_what    != 'undefined') i_what    = a_what   ;
    if (typeof a_page    != 'undefined') i_page    = a_page   ;
    if (typeof a_anchor  != 'undefined') i_anchor  = a_anchor ;
    if (typeof a_title   != 'undefined') i_title   = a_title  ;
    if (typeof a_comment != 'undefined') i_comment = a_comment;
    if (typeof a_parms   != 'undefined') i_parms   = a_parms  ;

    var i_func_call = "p_assemble('"
        + i_what    + "', '"
        + i_page    + "', '"
        + i_anchor  + "', \""
        + i_title   + "\", \""
        + i_comment + "\", \""
        + i_parms   + "\")";

x_log("\n" + i_func_call + ";");

/*- - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - */
/*    Data from the pagetree or overrides from the parameter list     */
/*- - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - */
    var i_depth   = '';
    var i_node    = '';
    var i_pubdate = '';

/*- - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - */
/*                      Data extracted from PAGE                      */
/*- - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - */
    var i_friend_initials  = '';
    var i_friend_name      = '';

    var i_language_initial = '';
    var i_language_suffix  = '';
    var i_language_name    = '';

    var i_link_is_folder     = false;
    var i_link_has_filetype  = false;
    var i_page_is_external   = false;
    var i_page_is_pdf        = false;
    var i_page_is_wikipedial = false;
    var i_page_has_collage   = false;

/*- - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - */
/*                     Data extracted from PARMS                      */
/*- - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - */
    var i_age_flag       = ''; // -new, -updated
    var i_format_flag    = ''; // -webpage, -print
    var i_private_flag   = ''; // -private
    var i_top_page_flag  = ''; // -top-page

    var i_author_name    = ''; // author:
    var i_genre          = ''; // genre:
    var i_source_code    = ''; // source:
    var i_subtitle       = ''; // subtitle:
    var i_year           = ''; // year:

/*- - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - */
/*                  Data derived from i_author_name                   */
/*- - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - */
    var i_first_name     = '';
    var i_last_name      = '';
    var i_byline         = '';

/*- - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - */
/*                            Other stuff                             */
/*- - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - */
    var i_translation_links = new String('');       // icons pointing to
                                          // translations of this i_page
    var ptx         = -1;                    // ptx of i_page + i_anchor
    var result      = new String('');
    var i_href      = new String('');
    var i_object = x_get_parm
    (
        i_what, ['-timeline', '-h1', '-link', '-choice', '-toc-entry'], '-link'
    );

/*- - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - */
/*     Phase 1: Gather as much information as possible about the      */
/*   page in question from the parameters passed to this function.    */
/*- - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - */
x_log("\ni_object: \"" + i_object + "\"");

x_log("\ni_page: '" + i_page + "' (" + (typeof i_page) + ").");
    if ((typeof i_page == 'string' && i_page == '')
    ||  (typeof i_page == 'number' && i_page == 0))
    {
x_log("\n'i_page' is blank or 0, setting i_page to '" + prc_page + "'.");
        i_page = prc_page;
    }
    else
    {
x_log("\nEither 'i_page' is not blank or not 0");
    }
    i_link_has_filetype = x_link_has_filetype(i_page);
    i_page_is_external  = x_page_is_external (i_page);

/*- - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - */
/*                 If i_page is a number then it must                 */
/*              be a valid index into the pagetree table              */
/*- - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - */
x_log("\ntypeof i_page = '" + typeof i_page + "'");
    if (typeof i_page == 'number')
    {
        ptx = i_page;
        if (ptx % DESCLEN == 0)
        {
x_log("\n" + ptx + " is a multiple of " + DESCLEN + ", and therefor a valid index into the i_pagetree table.");
        }
        else
        {
            return x_error(i_func_call + ": '" + ptx + "' is not a "
                + "multiple of " + DESCLEN + ", and therefor "
                + "not a valid index into the i_pagetree table.");
        }
    }

/*- - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - */
/*               Else if it begins with 'http' or has a               */
/*                filetype then it is an explicit href                */
/*- - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - */
    else if (i_page_is_external || i_link_has_filetype)
    {
x_log("\n\"" + i_page + i_anchor + "\" is 'explicit' since it begins with 'http' or has a filetype.");
    }

/*- - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - */
/*  Else if page+anchor is found in the pagetree then use that page   */
/*- - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - */
    else if ((ptx = prc_index(i_page, i_anchor)) > -1)
    {
x_log("\n\"" + i_page + i_anchor + "\" is in the pagetree table.");
    }

/*- - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - */
/*         Else if the page is found in the pagetree then use         */
/*         that page to gather up all the default parameters          */
/*- - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - */
    else if ((ptx = prc_index(i_page)) > -1)
    {
x_log("\nBut \"" + i_page + "\" is in the pagetree table.");
    }

/*- - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - */
/*                      Else just use the title                       */
/*- - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - */
    else
    {
x_log("\nWill just use the title, '" + i_title + "'.");
    }

/*- - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - */
/*               If you find a pagetree entry,  gather                */
/*               up all default parameters found there                */
/*- - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - */
    if (ptx > -1)
    {
x_log("\nGathering all the default parameters from pagetree index " + ptx + " ...");
        i_depth   = pagetree[ptx + DEPTH  ];
        i_node    = pagetree[ptx + NODE   ];
        i_pubdate = pagetree[ptx + PUBDATE];
        i_page    = pagetree[ptx + PAGE   ];
//         i_anchor  = pagetree[ptx + ANCHOR ];
        i_title   = pagetree[ptx + TITLE  ];
        i_comment = pagetree[ptx + COMMENT];
        i_parms   = pagetree[ptx + PARMS  ];

x_log("\n      i_depth: "   + i_depth         );
x_log("\n       i_node: '"  + i_node    + "'" );
x_log("\n    i_pubdate: '"  + i_pubdate + "'" );
x_log("\n       i_page: '"  + i_page    + "'" );
// x_log("\n     i_anchor: '"  + i_anchor  + "'" );
x_log("\n      i_title: \"" + i_title   + "\"");
x_log("\n    i_comment: \"" + i_comment + "\"");
x_log("\n      i_parms: \"" + i_parms   + "\"");
    }

/*- - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - */
/*      If other parameters to this function are specified, use       */
/*   them to override whatever you might have found in the pagetree   */
/*- - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - */
    if (typeof a_anchor  != 'undefined') i_anchor  = a_anchor ;
    if (typeof a_title   != 'undefined') i_title   = a_title  ;
    if (typeof a_comment != 'undefined') i_comment = a_comment;
    if (typeof a_parms   != 'undefined') i_parms   = a_parms  ;

/*- - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - */
/*    Analyze all the attributes thus found. For example, look for    */
/*     author initials and a language initial as part of the PAGE     */
/*           column if, indeed, the page has been published.          */
/*- - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - */
    i_page = new String(i_page);
    if (x_is_not_empty(i_page))
    {
        i_link_has_filetype  = x_link_has_filetype(i_page);
        i_page_is_external   = x_page_is_external(i_page);
        i_page_is_pdf        = x_page_is_pdf(i_page);
        i_link_is_folder     = i_page_is_external
                            && i_page.charAt(i_page.length - 1) == PRC_SLASH;
        i_page_has_collage   = p_page_has_collage(i_page);
        i_page_is_wikipedial = p_page_is_wikipedial(i_page);
        if (i_link_has_filetype || i_page_is_external || i_page_is_pdf
        ||  i_link_is_folder    || i_page_has_collage || i_page_is_wikipedial)
        {
x_log("\ni_link_has_filetype: " + i_link_has_filetype
     + ", i_page_is_external: " + i_page_is_external
          + ", i_page_is_pdf: " + i_page_is_pdf
       + ", i_link_is_folder: " + i_link_is_folder
     + ", i_page_has_collage: " + i_page_has_collage
   + ", i_page_is_wikipedial: " + i_page_is_wikipedial);
        }

        if (i_page_is_external || i_link_has_filetype)
        {
            i_href = i_page;
            if (x_is_empty(i_title)) i_title = i_href;
        }
        else
        {
            i_href = i_page + PRC_DEFAULT_EXT + i_anchor;
        }
x_log("\ni_href: \"" + i_href + "\"");

        i_friend_initials = i_page.substr(0, 2);
        i_friend_name     = '';
        if (prc_friends[i_friend_initials] instanceof Array)
        {
            i_friend_name = prc_friends[i_friend_initials]['name'];
        }
        else
        {
            i_friend_initials = '';
        }
x_log("\n i_friend_initials: \"" + i_friend_initials + "\"");
x_log("\n     i_friend_name: \"" + i_friend_name     + "\"");

        i_language_initial = i_page.substr(i_page.length - 1, 1);
        if (!(prc_languages[i_language_initial] instanceof Array))
        {
            i_language_initial = 'E';
        }
        i_language_suffix = prc_languages[i_language_initial]['suffix'];
        i_language_name   = prc_languages[i_language_initial]['name'  ];
x_log("\ni_language_initial: \"" + i_language_initial + "\"");
x_log("\n i_language_suffix: \"" + i_language_suffix  + "\"");
x_log("\n   i_language_name: \"" + i_language_name    + "\"");

        i_translation_links = p_translation_links(i_page, i_anchor);
    }

/*- - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - */
/*                   Extract data from PARMS column                   */
/*- - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - */
    if (x_is_not_empty(i_parms))
    {
        i_age_flag       = x_get_parm(i_parms, ['-new', '-updated']);
        i_format_flag    = x_get_parm(i_parms, ['-web_page', '-print']);
        i_private_flag   = x_get_parm(i_parms, ['-private']);
        i_top_page_flag  = x_get_parm(i_parms, ['-top-page']);

        i_author_name    = x_get_parm(i_parms, 'author:');
        i_genre          = x_get_parm(i_parms, 'genre:');
        i_source_code    = x_get_parm(i_parms, 'source:');
        i_subtitle       = x_get_parm(i_parms, 'subtitle:');
        i_year           = x_get_parm(i_parms, 'year:');

        if (i_age_flag || i_format_flag || i_private_flag || i_top_page_flag
        ||  i_author_name || i_genre || i_source_code || i_subtitle || i_year)
        {
x_log("\ni_age_flag: '"    + i_age_flag
+ "', i_format_flag: '"    + i_format_flag
+ "', i_private_flag: '"   + i_private_flag
+ "', i_top_page_flag: '"  + i_top_page_flag
+ "', i_author_name: '"    + i_author_name
+ "', i_genre: '"          + i_genre
+ "', i_source_code: '"    + i_source_code
+ "', i_subtitle: '"       + i_subtitle
+ "', i_year: '"           + i_year
+ "'");
        }
    }

/*- - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - */
/*                  Derive more info from the givens                  */
/*- - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - */
    if (!i_author_name && i_friend_name)
    {
        i_author_name = i_friend_name;
x_log("\ni_author_name: \"" + i_author_name + "\"");
    }
    if (i_author_name)
    {
        var i_first_name_len = i_author_name.indexOf(' ');
        var i_last_name_len  = i_author_name.length
                           - i_author_name.lastIndexOf(' ') - 1;
        i_first_name = i_author_name.substr(0, i_first_name_len);
        i_last_name  = i_author_name.substr
        (
            i_author_name.length - i_last_name_len,
            i_last_name_len
        );
x_log("\ni_first_name: \"" + i_first_name + "\"");
x_log("\ni_last_name: \"" + i_last_name + "\"");

/*- - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - */
/*                         Construct a byline                         */
/*                                                                    */
/* But only if the author's name (or part thereof) does not already   */
/* appear in the page title or, if we're constructing a menu, the     */
/* menu title or choice title.                                        */
/*- - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - */
if (prc_title != "") x_log("\nprc_title: '" + prc_title + "'.");
if (prc_menu_title != "") x_log("\nprc_menu_title: '" + prc_menu_title + "'.");
        if (prc_title.indexOf(i_first_name)      == -1
        &&  prc_title.indexOf( i_last_name)      == -1
        &&  prc_menu_title.indexOf(i_first_name) == -1
        &&  prc_menu_title.indexOf( i_last_name) == -1
        &&  i_title.indexOf(i_first_name)        == -1
        &&  i_title.indexOf( i_last_name)        == -1)
        {
            if (i_genre == 'reviews')
            {
                i_byline += p_translate('reviewed', i_language_initial) + ' ';
            }
            i_byline += p_translate('by', i_language_initial);
            var initials = prc_initials_of_friend(i_author_name);
            if (initials != "")
            {
x_log("\nThis author, " + i_author_name + ", is a known friend.");
                if (i_object == '-h1' || i_object == '-choice')
                {
                    i_byline += " " + p_friend(initials, 'hover_link');
                }
                else i_byline += " " + i_author_name;
            }
            else
            {
x_log("\nThis author, " + i_author_name + ", is NOT a known friend.");
                i_byline += " " + i_author_name;
            }
x_log("\nAdding i_byline to choice: \"" + i_byline + "\"");
        }
        else
        {
x_log("\nSuppressing byline since '" + i_first_name + "' or '" + i_last_name + "' is already in this page or menu title.");
        }
    }

/*- - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - */
/*     Phase 2: Assemble and return HTML that refers to this page     */
/*- - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - */

/*- - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - */
/*   Don't assemble anything except an <h1> if the page is private    */
/*- - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - */
    if (i_private_flag
    && (i_object == '-choice' || i_object == '-toc-entry'))
    {
x_log("\n'" + i_href + "' is '" + i_private_flag + "'.");
        return '';
    }

/*- - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - */
/*                      Assemble a -timeline                          */
/*- - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - */
    else if (i_object == '-timeline')
    {

// Don't use soft breaks in the timeline:
        i_title = String(i_title);
        i_title = i_title.replace(/<br>/gi, "&nbsp;");
        i_title = i_title.replace(/<sbr>/gi, "&nbsp;");
        if (i_year) i_title += ' [' + i_year + ']';

// Convert "] [" strings to commas:
        i_title = i_title.replace(/] \[/g, ", ");

        result += "<a href='" + i_href + "'><b>" + i_title  + "</b></a>";
        result += i_translation_links;
        if (i_page_has_collage) result += "&nbsp;" + p_page_icon_has_collage();
    }

/*- - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - */
/*                           Assemble a -h1                           */
/*- - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - */
    else if (i_object == '-h1')
    {
x_log("\nWe're assembling a '-h1' object with title '" + i_title + "'.");
        if (x_is_empty(i_anchor))
        {
x_log("\nUsing title and subtitle of page, not title and subtitle of page/anchor.");
            var i_page_ptx = prc_index(i_page);
x_log("\ni_page_ptx: '" + i_page_ptx + "'");
            i_title = pagetree[i_page_ptx + TITLE];
            i_subtitle = x_get_parm(pagetree[i_page_ptx + PARMS], 'i_subtitle:');
x_log("\n   i_title: '" + i_title + "'");
x_log("\ni_subtitle: '" + i_subtitle + "'");
        }

        i_title = x_soften_breaks(i_title);

        if (i_year) i_title += ' [' + i_year + ']';
// Convert "] [" strings to commas:
        i_title = i_title.replace(/] \[/g, ", ");
        result += p_peek("<h1>" + i_title + "</h1>");

        if (i_subtitle)
        {
            i_subtitle = x_soften_breaks(i_subtitle);
            result += "\n<h1 class=subtitle>" + i_subtitle + "</h1>";
        }

        if (i_byline)
        {
            result += "\n<h1 class=byline>" + i_byline + "</h1>";
        }
        else
        {
// Pages printed out should always have a byline in case
// they're intended to be read by prospective publishers.
// Do this by specifying author: in sitegen.pl.
//             if (prc_format_flag == '-print'
//             &&  result.indexOf("Hannotte") == -1)
//             {
//                 result += "\n<h1 class=byline>"
//                     + p_translate('by', i_language_initial)
//                     + " Dean Hannotte</h1>";
//             }
        }

        if (i_language_initial == 'G' && i_friend_initials != 'rb')
        {
            result += "\n<h1 class=translator>[&Uuml;bersetzt von "
                + p_friend('rb') + "]</h1>";
        }
    }

/*- - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - */
/*                          Assemble a -link                          */
/*                                                                    */
/*           If page is in the pagetree, the title defaults           */
/*                to the title attribute in pagetree.                 */
/*                                                                    */
/*     If page ends in '\' then you're linking to a folder rather     */
/*   than to a page which can be assumed to end in PRC_DEFAULT_EXT.   */
/*- - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - */
    else if (i_object == '-link')
    {
        i_title = i_title.replace(/<br>/gi, " ");
        i_title = i_title.replace(/<sbr>/gi, " ");
        i_title = i_title.replace(/_/g, " ");
        i_title = i_title.replace(/  /gi, " ");
        result = i_title;
// Insert i_year if there wasn't a title override:
        if (i_year && x_is_empty(i_title)) result += ' [' + i_year + ']';
// Convert "] [" strings to commas:
        result = result.replace(/] \[/g, ", ");
        result = "<b>" + result + "</b>";
        if (prc_format_flag != '-print')
        {
// Don't force the page to open in a new tab or new window. With smart browsers,
// it's easy for the user to decide that for himself on a case-by-case basis.
            result = "<a href='" + i_href + "'>" + result + "</a>";
//             if (prc_mode == 'test') result += " (" + i_href + ")";
            result += i_translation_links;
            if  (i_page_has_collage)     result += "&nbsp;" + p_page_icon_has_collage();
            if  (i_page_is_pdf)          result += "&nbsp;" + p_page_icon_is_pdf();
            if  (i_page_is_wikipedial)   result += "&nbsp;" + p_page_icon_is_wikipedial();
            else if (i_page_is_external) result += "&nbsp;" + p_page_icon_is_external();
        }
    }

/*- - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - */
/*                         Assemble a -choice                         */
/*- - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - */
    else if (i_object == '-choice')
    {

/*- - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - */
/*             Has this page already appeared in a menu?              */
/*- - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - */
        var i_resource;
        if (ptx > -1)
        {
            i_resource = "ptx="  + ptx;
        }
        else
        {
            i_resource = "href=" + i_href;
        }
        i_resource += i_anchor;
        if (x_is_a_used_resource(i_resource))
        {
//  BUG: Sometimes we SHOULD offer the same title twice, as when it
//       appears in an author menu as well as a foreign language menu!
x_log("\nSuppressing " + i_resource + " because it was already offered on this page.");
        }
        else
        {
            x_use_resource(i_resource);

/*- - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - */
/*            Start generating this row of the menu table             */
/*- - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - */
            result += "<tr><td width=22 valign=top>";

/*- - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - */
/*                  What color bullet should we use?                  */
/*- - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - */
            var i_page_is_active   = false;
            var i_page_is_current  = false;
            var i_page_is_inactive = false;

            if (i_page == "" && i_anchor == "" && i_href == "")
            {
                i_page_is_inactive = true; // i_page is under construction
                result += p_page_icon_is_inactive();
            }
            else if (i_page == prc_page && i_anchor == prc_anchor)
            {
                i_page_is_current = true;
                result += p_page_icon_is_current();
            }
            else
            {
                i_page_is_active = true;
                result += p_page_icon_is_active();
            }
            result += "</td>\n<td>";
            if (i_page_is_active) result += "<a href='" + i_href + "'>";

/*- - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - */
/*   Change &quot; to " in the title to prevent premature wrapping    */
/*- - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - */
            i_title = i_title.replace(/&quot;/gi, '"');

            i_title = i_title.replace(/<sbr>/gi, " ");
            i_title = i_title.replace(/_/g, " ");
            if (i_year) i_title += ' [' + i_year + ']';
// Convert "] [" strings to commas:
            i_title = i_title.replace(/] \[/g, ", ");

// The comment should only be used for the page, not the
// subpage (i. e. anchor point):
            if (x_is_empty(i_anchor))
            {
                i_comment = new String(i_comment);
                i_comment = i_comment.replace(/<br>/gi, " ");
                i_comment = i_comment.replace(/<sbr>/gi, " ");
            }
            else
            {
                i_comment = "";
            }

            result += "<b>" + i_title;
            if (i_byline) result += ', ' + i_byline;
            result += "</b>";
            if (i_page_is_active) result += "</a>";
//             if (prc_mode == 'test') result += " (" + i_href + ")";
            result += i_translation_links;
            if (i_page_has_collage) result += "&nbsp;" + p_page_icon_has_collage();
            if (i_page_is_external) result += "&nbsp;" + p_page_icon_is_external();
            if (i_page_is_pdf)      result += "&nbsp;" + p_page_icon_is_pdf();

/*- - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - */
/*                  Append an age flag if requested                   */
/*- - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - */
            if (i_age_flag == '-new')
            {
                result += "&nbsp;&nbsp;&nbsp;" + p_page_icon_is_new();
            }
            else if (i_age_flag == '-updated')
            {
                result += "&nbsp;&nbsp;&nbsp;" + p_page_icon_was_updated();
            }

/*- - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - */
/*                   Append a comment if requested                    */
/*- - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - */
            if (i_comment != '')
            {
                result += "\n<span style='color: #" + PRC_FG_DARK_GRAY +
                    ";'><br>" + x_tab() + i_comment + "</span>";
            }

/*- - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - */
/*                         Terminate the row                          */
/*- - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - */
            result += "</td></tr>";
        }
    }

/*- - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - */
/*                       Assemble a -toc-entry                        */
/*- - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - */
    else if (i_object == '-toc-entry')
    {
        var i_toc_type = x_get_parm(i_what, ['-form', '-table'], '-form');
// These rows seem truncated here!
//         if (prc_toc_bgcolor == PRC_BG_WHITE) prc_toc_bgcolor = PRC_BG_LIGHT_GRAY;
//         else                                 prc_toc_bgcolor = PRC_BG_WHITE;
        if (i_toc_type == '-table')                       // see Toc.hml
        {
            result = "<tr";
            if (i_depth < 2) result += " style='font-weight: bold;'";
            result += ">";
            for (var dx = 0; dx < i_depth; dx++)
            {
                result += '<td width=1></td>';
            }
            result += '<td align=left valign=top width=1>'
                + i_node + '&nbsp;</td>' + '<td colspan=9>';

            i_title = i_title.replace(/<br>/gi, " ");
            i_title = i_title.replace(/<sbr>/gi, " ");
//             i_title = i_title.replace(/  /gi, " ");
            i_title = i_title.replace(/_/g, " ");
// Insert i_year if there wasn't a i_title override:
            if (i_year && x_is_empty(i_title)) i_title += ' [' + i_year + ']';
// Convert "] [" strings to commas:
            i_title = i_title.replace(/] \[/g, ", ");
            if (prc_format_flag != '-print')
            {
// Don't force the page to open in a new tab or new window. With smart browsers,
// it's easy for the user to decide that for himself on a case-by-case basis.
                if (i_href != '') i_title = "<a href='" + i_href + "'><b>" + i_title + "</b></a>";
                result += i_title + i_translation_links;
                if  (i_page_has_collage) result += "&nbsp;" + p_page_icon_has_collage();
                if  (i_page_is_external) result += "&nbsp;" + p_page_icon_is_external();
                if  (i_page_is_pdf)      result += "&nbsp;" + p_page_icon_is_pdf();
            }

            result += "</td></tr>";
//             if (i_node.substr(0, 5) == '4.9.1') alert(result);
        }
        else // if (i_toc_type == '-form') // at the bottom of each page
        {
            result += "<option value='" + i_href + "'";

// NOTE: the disabled= attribute is ignored by IE7 and below!
            if (i_page == "")
            {
x_log("\n'" + i_page + "' isn't up yet (\"" + i_title + "\")");
                result += " disabled=\"disabled\"";
            }
            result += ">";

// NOTE: the font-size: and font-weight: attributes are ignored by IE!
// BUG: When there is a jump in effective font
//          size, the indent is disproportional!
//             result += " font-size:" + (16 - i_depth) + ";";
            result += "<span style='";
            result += "color: " + i_depth + i_depth + i_depth + i_depth + i_depth + i_depth + ";";
            if (i_depth < 2) result += " font-weight: bold;";
            if (i_page == prc_page && i_anchor == prc_anchor)
            {
x_log("\n'" + i_page + "' is the i_page we're on (\"" + i_title + "\")");
                result += " background-color: " + prc_bg_color + ";";
            }
            else if (i_page == "")
            {
x_log("\n'" + i_page + "' isn't up yet (\"" + i_title + "\")");
// NOTE: the disabled= attribute is ignored by IE7 and below!
                if (x_browser() == 'IE' && x_browser_version() < 8)
                {
                     result += " color: " + PRC_FG_GRAY + ";";
                }
            }
            result += "'>";

            for (tlx = 1; tlx <= i_depth; tlx++)
            {
                result += x_tabs(2);
            }

            result += i_node + "&nbsp;&nbsp;";
            i_title = i_title.replace(/<b><i>/g, '"');
            i_title = i_title.replace(/<\/i><\/b>/g, '"');
            result += "\n" + i_title;
            if (i_year) result += ' [' + i_year + ']';
// Convert "] [" strings to commas:
            result = result.replace(/] \[/g, ", ");
            if (prc_mode == 'test') result += " (" + i_href + ")";
            result += "</span></option>";
        }
    }

x_log("\n" + i_func_call + "\n => '" + result + "'.");
x_log("\n--------------------------------------------- P R C _ A S S E M B L E ( )");
    return result;
}

/**********************************************************************/
/*                               E N D                                */
/**********************************************************************/

