var JS_PRC = "C:\\dh\\web\\PRC\\1\\HTM\\prc.js (3276 lines) 2010-09-06 01:21 Rachel Bartlett";
/**********************************************************************/
/*                                                                    */
/*                            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 Dean */
/* Hannotte 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          */
/* specified in 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 'piclist' table. These tables are        */
/* written into the files "htm\pagetree.js" and "htm\piclist.js"      */
/* respectively.                                                      */
/*                                                                    */
/*--------------------------------------------------------------------*/
/*                                                                    */
/* 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 former members of          */
/*     the Center and authors who support and                         */
/*     contribute to our work (rather than just reviewing it).        */
/*     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'] = YES;                        */
/*     prc_friends['rb']['bio'] = "Rachel Bartlett is an "            */
/*         + "independent scholar <br>who grew up in East "           */
/*         + "Germany and now lives in Berlin.";                      */
/*                                                                    */
/*     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.                                                */
/*                                                                    */
/*  3) Sources indicate where the page text originally appeared.      */
/*     A source code is expanded into a source name using the         */
/*     prc_source_names array:                                        */
/*                                                                    */
/*     prc_source_names['journal_1'] = "<b><i>The Ninth "             */
/*         + "Street Center Journal 1</i></b>, Winter 1973";          */
/*     prc_source_names['journal_2'] = "<b><i>The Ninth "             */
/*         + "Street Center Journal 2</i></b>, 1974";                 */
/*     prc_source_names['journal_3'] = "<b><i>The Ninth "             */
/*         + "Street Center Journal 3</i></b>, Winter 1983";          */
/*     prc_source_names['journal_4'] = "<b><i>The Ninth "             */
/*         + "Street Center Journal 4</i></b>, Winter 1984";          */
/*     prc_source_names['journal_5'] = "<b><i>The Ninth "             */
/*         + "Street Center Journal 5</i></b>, Winter 1985";          */
/*     prc_source_names['journal_6'] = "<b><i>The Ninth "             */
/*         + "Street Center Journal 6</i></b>, Autumn 1986";          */
/*     prc_source_names['journal_7'] = "<b><i>The Ninth "             */
/*         + "Street Center Journal 7</i></b>, Winter 1987";          */
/*     prc_source_names['wkp'] = "<b><i>We Knew Paul</i></b>, "       */
/*         + "1991";                                                  */
/*                                                                    */
/*--------------------------------------------------------------------*/
/*                                                                    */
/* Most of these functions write to the document using                */
/* document.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 are usually suffixed with _code.          */
/* See, for example, prc_friend_code(). Since this is where the real  */
/* work is done, prc_friend() trivially degenerates to something like */
/*                                                                    */
/*     function prc_friend(...)                                       */
/*     {                                                              */
/*         document.write(prc_friend_code(...));                      */
/*     }                                                              */
/*                                                                    */
/*--------------------------------------------------------------------*/
/*  This was library designed and written by Rachel Bartlett in 2008  */
/**********************************************************************/
x_log("\nJS_PRC: '" + JS_PRC + "'");
if (x_is_empty(JS_PLX))
{
    alert("Please load 'plx.js' before 'prc.js'.");
}
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);

/*--------------------------------------------------------------------*/
/*                          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 color:
var PRC_FG_MAROON     = '800000';                       // 'dark maroon'
var PRC_FG_DARK_GRAY  = '444444';                           // dark gray
var PRC_FG_GRAY       = '999999';                                // gray

// Background colors:
var PRC_BG_WHEAT      = 'F5DEB3';                             // 'wheat'
var PRC_BG_WHITE      = 'FFFFFF';                               // white
var PRC_BG_GRAY       = '888888';                                // gray
var PRC_BG_LIGHT_GRAY = 'EEEEEE';                          // light gray

// 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';                       // creamy-orange
// var PRC_BG_HOT_PINK   = 'FFDDDD';                         // hot-pink

// var PRC_BG_WHEAT      = x_rgb(245, 222, 179);              // 'wheat'
// var PRC_BG_HOT_PINK   = x_rgb(255, 221, 221);             // hot-pink
// var PRC_BG_MINT_GREEN = x_rgb(204, 255, 204);           // mint-green
// var PRC_BG_WINE       = x_rgb(223, 213, 214);         // wine-colored

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." + PRC_DOMAIN);
var PRC_HOMEPAGE = new String("http://" + PRC_HOSTNAME);
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_CYCLING_BGCOLORS = [PRC_BG_MINT_GREEN, PRC_BG_GOLD, PRC_BG_WINE];
var PRC_PAUL_LARGE_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_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                          */
/*--------------------------------------------------------------------*/

/*- - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - */
/*                   Attributes of the Current Page                   */
/*- - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - */
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();

/*- - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - */
/*                            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['lb']['bio' ] = "Laurie Bell is the daughter of William Weinstone, <br>one of the founders of the American Communist Party.";
prc_friends['mb']['bio' ] = "Michael Ballin is an Associate Professor Emeritus of the <br>Department of English, Wilfrid Laurier University Waterloo, Ontario.";

// prc_friends['rb']['bio' ] = "Rachel Bartlett is an independent scholar who grew up in East Germany and "
// + "<br>now lives in Berlin. Since 2007 she has written " + prc_num_rb_pages + " new pages, translated "
// + "<br>" + prc_num_german_pages + " old pages into German, and assembled " + prc_num_collages + " collages for our website.";

prc_friends['rb']['bio' ] = "Rachel Bartlett is an independent scholar who <br>grew up in East Germany and now lives in Berlin.";
prc_friends['rb']['bioG'] = "Rachel Bartlett ist Privatgelehrte. Sie wuchs <br>in Ostdeutschland auf und lebt derzeit in Berlin.";
prc_friends['tr']['bio' ] = "Tony Rostron was a war photographer <br>in Vietnam. He died in 1992.";

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

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' ;
prc_friends['rb']['snapshot'] = 'Rachel_Bartlett_950x950.jpg';
prc_friends['tr']['snapshot'] = 'Tony_Rostron_195x199.jpg'   ;

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

/*- - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - */
/*                          Language Tables                           */
/*- - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - */
// Language initial extracted from the last character of prc_page:
var prc_language_initial = new String();         // 'E', 'F', 'G' or 'S'
var prc_language_suffix  = new String();          // '', 'F', 'G' 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['S'] = new Array();

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

prc_languages['E']['name'] = "English";
prc_languages['F']['name'] = "French";
prc_languages['G']['name'] = "German";
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';

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

/*- - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - */
/*                            Source Table                            */
/*- - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - */
// var prc_source_names = new Array();
//
// prc_source_names['journal_1'] = "<b><i>The Ninth Street Center Journal 1</i></b>, Winter 1973",
// prc_source_names['journal_2'] = "<b><i>The Ninth Street Center Journal 2</i></b>, 1974",
// prc_source_names['journal_3'] = "<b><i>The Ninth Street Center Journal 3</i></b>, Winter 1983",
// prc_source_names['journal_4'] = "<b><i>The Ninth Street Center Journal 4</i></b>, Winter 1984",
// prc_source_names['journal_5'] = "<b><i>The Ninth Street Center Journal 5</i></b>, Winter 1985",
// prc_source_names['journal_6'] = "<b><i>The Ninth Street Center Journal 6</i></b>, Autumn 1986",
// prc_source_names['journal_7'] = "<b><i>The Ninth Street Center Journal 7</i></b>, Winter 1987",
// prc_source_names['wkp']       = "<b><i>We Knew Paul</i></b> [1991]";
//
// for (psn in prc_source_names)
// {
//     x_log("\nprc_source_names['" + psn + "']: \"" + prc_source_names[psn] + "\"");
// }

/*- - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - */
/*                       Flags encoded in PARMS                       */
/*- - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - */
var prc_age_flag      = new String();        // '-new', '-updated', etc.
var prc_private_flag  = new String();                      // '-private'

/*- - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - */
/*                    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:'

/*- - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - */
/*                       Other Global Variables                       */
/*- - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - */
var prc_random_snapshots_used = 0;                    // how many random
                                              // snapshots have we used?
var prc_num_children = 0;            // does current page have children?

var prc_cycling_bgcolor_index = 0;            // next color index to use
var prc_cycling_bgcolor_dimen =       // normally cycle through 3 colors
    PRC_CYCLING_BGCOLORS.length;
x_log("\nprc_cycling_bgcolor_dimen: '" + prc_cycling_bgcolor_dimen + "'");

var prc_debug_setting         = 0;
var prc_table_depth           = 0;
var prc_timeline              = [-1, -1, -1, -1, -1];

var prc_menu_title   = new String();
var prc_menu_choices = new String();

/*--------------------------------------------------------------------*/
/*                          Context trackers                          */
/*--------------------------------------------------------------------*/
var prc_in_an_fnote   = false;
var prc_in_a_speech   = false;
var prc_speech_column = 0;
var prc_in_a_line     = false;

/*--------------------------------------------------------------------*/
/*                         Start doing things                         */
/*--------------------------------------------------------------------*/
// Has prc_menu_type been set?
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 + "'.");
}

// Are we running 1) in production mode on a
// server or 2) in test mode on a workstation?
var prc_site = new String("remote");
if (location.protocol == "file:") prc_site = "local";
x_log("\nprc_site: '" + prc_site + "'");

/*--------------------------------------------------------------------*/
/*                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';                 */
/*                                                                    */
/*--------------------------------------------------------------------*/
// alert("location.protocol: \"" + location.protocol + "\""
//   + "\nlocation.hostname: \"" + location.hostname + "\""
//   + "\nlocation.pathname: \"" + location.pathname + "\""
//   + "\n  location.search: \"" + location.search   + "\"");
if (location.protocol == 'http:'
&&  location.hostname != PRC_HOSTNAME)
{
    p_normalize_hostname();
}

/*--------------------------------------------------------------------*/
/*                 Get parameters from the url string                 */
/*--------------------------------------------------------------------*/
x_get_url_parms();
if (plx_url_parms.hasOwnProperty("debug"))
{
    prc_debug_setting = plx_url_parms["debug"];
}

/*--------------------------------------------------------------------*/
/*             Override default values declared in plx.js             */
/*--------------------------------------------------------------------*/
x_snapshot_img_dir('_pix');                          // see x_snapshot()
x_snapshot_frame_color(PRC_BG_WHEAT);
x_snapshot_frame_caption_style
(
      "font-size: 12; "
    + "font-weight: bold; "
    + "color: #" + PRC_BG_WHITE + "; "
    + "background-color: #" + PRC_BG_GRAY + ";"
);

x_hover_style
(
      "font-size: 12; "
    + "color: #" + PRC_FG_MAROON + "; "
    + "background-color: #" + PRC_BG_LIGHT_GRAY + "; "
    + "border: #" + PRC_BG_WHITE + " 4px solid;"
);
// x_hover_width(500);

/**********************************************************************/
/*                                                                    */
/*                  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                  */
/*                                                                    */
/**********************************************************************/
/*--------------------------------------------------------------------*/
/*                        One-line HML macros                         */
/*--------------------------------------------------------------------*/
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'       )}

/*--------------------------------------------------------------------*/
/*                       plx function wrappers                        */
/*--------------------------------------------------------------------*/
function prc_write(a_string) {document.write(a_string)}
//
function prc_dots(a_count)
{prc_write(x_dots(a_count))}
function prc_dropcap(a_letter)
{prc_write(x_dropcap(a_letter))}
function prc_hover_hint(a_text_html, a_hint_html, a_left, a_top)
{prc_write(x_hover_hint(a_text_html, a_hint_html, a_left, a_top))}
function prc_hover_link(a_text_html, a_link_html, a_hint_html)
{prc_write(x_hover_link(a_text_html, a_link_html, a_hint_html))}
function prc_snapshot(a_filespec, a_resize, a_parms, a_caption)
{prc_write(x_snapshot(a_filespec, a_resize, a_parms, a_caption))}
function prc_stars(a_count)
{prc_write(x_stars(a_count))}
function prc_tabs(a_count)
{prc_write(x_tabs(a_count))}

/*--------------------------------------------------------------------*/
/*                       prc function wrappers                        */
/*--------------------------------------------------------------------*/
function prc_h1(a_title) {prc_write(prc_h_code(1, a_title));}
function prc_h2(a_title) {prc_write(prc_h_code(2, a_title));}
function prc_h3(a_title) {prc_write(prc_h_code(3, a_title));}
function prc_h4(a_title) {prc_write(prc_h_code(4, a_title));}
function prc_h5(a_title) {prc_write(prc_h_code(5, a_title));}
function prc_h6(a_title) {prc_write(prc_h_code(6, a_title));}

// function prc_choice(a_page, a_anchor, a_title, a_comment, a_parms) {prc_write(prc_choice_code(a_page, a_anchor, a_title, a_comment, a_parms))}
function prc_analog(a_analog, a_flags)                                {prc_write(prc_analog_code(a_analog, a_flags))}
function prc_friend(a_person, a_attrib, a_1, a_2, a_3)                {prc_write(prc_friend_code(a_person, a_attrib, a_1, a_2, a_3))}
function prc_email_link()                                             {prc_write(prc_email_link_code())}
function prc_floating_row()                                           {prc_write(prc_floating_row_code())}
function prc_floating_row_end()                                       {prc_write(prc_floating_row_end_code())}
function prc_link(a_page, a_anchor, a_title)                          {prc_write(prc_link_code(a_page, a_anchor, a_title))}
function prc_sidebar(a_align, a_width)                                {prc_write(prc_sidebar_code(a_align, a_width))}
function prc_sidebar_end()                                            {prc_write(prc_sidebar_end_code())}
function prc_table(a_parms)                                           {prc_write(prc_table_code(a_parms))}
function prc_table_end()                                              {prc_write(prc_table_end_code())}

/*--------------------------------------------------------------------*/
/*                     prc_analog_code() function                     */
/*--------------------------------------------------------------------*/
function prc_analog_code(a_analog, a_flags)
{
x_log("\nprc_analog_code('" + 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 result = '';
    var errmsg = '';
    var color = '#' + PRC_FG_MAROON, bgcolor = '#' + PRC_BG_WHEAT;
    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;
    }
    result = new String("<span style='"
        + "color: #" + color + "; "
        + "background-color: #" + bgcolor + "; "
        + "'>&nbsp;" + a_analog + "&nbsp;</span>");
x_log("\n => " + result);
    return result;
}

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

/*--------------------------------------------------------------------*/
/*                     prc_friend_code() 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 prc_friend_code
(
    a_initials, a_attrib, a_1, a_2, a_3
)
{
// x_log_to_browser(true);
x_log("\nprc_friend_code('" + a_initials + "', '" + a_attrib + "', '" + a_1 + "', '" + a_2 + "', '" + a_3 + "')");

// Set parameter defaults:
    var initials  = 'dh';
    var attrib    = 'name';

    var errmsg             = '';
    var result             = '';
    var friend_name        = '';
    var friend_bio         = '';
    var friend_has_mailbox = '';
    var friend_snapshot    = '';
    var first_name         = '';

// Override the parameters:
    if (x_is_not_empty(a_initials)) initials  = a_initials;
    if (x_is_not_empty(a_attrib)  ) attrib    = a_attrib  ;

x_log("\ninitials: '" + initials + "'");
x_log("\n  attrib: '" + attrib   + "'");
x_log("\n     a_1: '" + a_1      + "'");
x_log("\n     a_2: '" + a_2      + "'");
x_log("\n     a_3: '" + a_3      + "'");

    if (prc_friends[initials] instanceof Array)
    {
        friend_name        = prc_friends[initials]['name'       ];
        friend_bio         = prc_friends[initials]['bio'        ];
        friend_has_mailbox = prc_friends[initials]['has_mailbox'];
        friend_snapshot    = prc_friends[initials]['snapshot'   ];

x_log("\n       friend_name: '" + friend_name        + "'");
x_log("\n        friend_bio: '" + friend_bio         + "'");
x_log("\nfriend_has_mailbox: '" + friend_has_mailbox + "'");
x_log("\n   friend_snapshot: '" + friend_snapshot    + "'");

    }

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

/*- - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - */
/*                               'name'                               */
/*- - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - */
    else if (attrib == 'name')
    {
        if (friend_has_mailbox == YES)
        {
            first_name = friend_name.substr(0, friend_name.indexOf(' '));
            result = x_email(friend_name.replace(/ /g, "&nbsp;"),
                first_name.toLowerCase() + "." + x_yyyy(), PRC_DOMAIN,
                "subject=(Sent to " + friend_name
                + " from '" + location + "')");
        }
        else
        {
            result = "<b>" + friend_name + "</b>";
        }
    }

/*- - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - */
/*                             'snapshot'                             */
/*- - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - */
    else if (attrib == 'snapshot')
    {
        var resize    = '20%';
        var parms     = '';
        var caption   = '';

        if (x_is_not_empty(a_1)) resize  = a_1;
        if (x_is_not_empty(a_2)) parms   = a_2;
        if (x_is_not_empty(a_3)) caption = a_3;

x_log("\n resize: '" + resize  + "'");
x_log("\n  parms: '" + parms   + "'");
x_log("\ncaption: '" + caption + "'");

        if (initials == 'pr')
        {
            friend_snapshot = prc_random_unused_snapshot(PRC_PAUL_LARGE_SNAPSHOTS);
        }
        if (x_is_not_empty(friend_snapshot))
        {
            result = x_snapshot(friend_snapshot, resize, parms, caption);
        }
    }

/*- - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - */
/*                               'bio'                                */
/*- - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - */
    else if (attrib == 'bio')
    {
        if (prc_language_initial != 'E'
        &&  x_is_not_empty(prc_friends[initials]['bio' + prc_language_initial]))
        {
            friend_bio = prc_friends[initials]['bio' + prc_language_initial];
        }
        if (x_is_not_empty(friend_bio))
        {
            result = "<p class=right>&mdash; " + friend_bio + "</p>";
        }
    }

/*- - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - */
/*                               'menu'                               */
/*- - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - */
    else if (attrib == 'menu')
    {
        var menu_title = '';
        if (x_is_not_empty(a_1)) menu_title = a_1;
        prc_friend_menu(initials, menu_title);
    }

x_log("\n => '" + result + "'");
// x_log_to_browser(false);
    return 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()
{
    var result = new String();
x_log("\nP R C _ B O D Y ( ) -----------------------------------------------------");
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);
// Not every anchor has to be in the pagetree table. If it's
// not there, trying looking up just the page name alone:
    if (prc_ptx == -1 && prc_anchor != '')
    {
        prc_ptx = prc_index(prc_page, '');
    }
// If a page isn't in the pagetree table, default to the home page:
    if (prc_ptx == -1)
    {
x_log("\nCan't find this page, so we'll jump to the home page.");
        location = PRC_HOMEPAGE;
    }
    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    + "\"");


/*- - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - */
/*                    Extract flags from prc_parms                    */
/*- - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - */
    prc_age_flag     = x_get_parm(prc_parms, ['-new', '-updated']);
    prc_private_flag = x_get_parm(prc_parms, ['-private']);

    prc_author_name  = x_get_parm(prc_parms, 'author:');
    prc_genre        = x_get_parm(prc_parms, 'genre:');
    prc_source_code  = x_get_parm(prc_parms, 'source:');
    prc_subtitle     = x_get_parm(prc_parms, 'subtitle:');
    prc_year         = x_get_parm(prc_parms, 'year:');

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

x_log("\n     prc_author_name: '" + prc_author_name   + "'");
x_log("\n           prc_genre: '" + prc_genre         + "'");
x_log("\n     prc_source_code: '" + prc_source_code   + "'");
x_log("\n        prc_subtitle: '" + prc_subtitle      + "'");
x_log("\n            prc_year: '" + prc_year          + "'");

    if (prc_author_name == false)
    {
        prc_author_name = prc_friend_name;
    }

/*- - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - */
/*                       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
    );

/*- - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - */
/*                    Home Page (in any language)                     */
/*- - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - */
    if (prc_page.substr(0, 5) == 'index' && prc_anchor == '')
    {
        result += "\n<table border=00 width='100%' "
            + "cellpadding=6 cellspacing=0><tr>"

// Use height in pixels ('x125') for resize parm because
// document.body.clientHeight doesn't exist at this point:
            + "\n<td width=250 bgcolor=#" + PRC_BG_WHEAT + ">"
            + prc_friend_code('pr', 'snapshot', 'x125', '-center -nocaption')
            + "</td>"
            + "\n<td align=center valign=middle bgcolor=#" + PRC_BG_WHEAT + ">"
            + "<h1 style='margin: 0;'>"
            + p_translate(PRC_WEBSITE, prc_language_initial) + "</h1>"
            + "\n<p style='margin-top: 24; text-align: center;'><i>"
            + p_translate(PRC_MOTTO, prc_language_initial) + "</i></p></td>"
            + "</tr></table>";
// alert(result);
    }

/*- - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - */
/*                           NOT Home Page                            */
/*- - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - */
    else
    {
        result += "\n<table border=00 width='100%' "
            + "cellpadding=6 cellspacing=0><tr>"
            + "\n<td bgcolor=#" + PRC_BG_WHEAT + ">"
            + "<span onclick='location = index" + prc_language_suffix + ".htm;'>"
            + "<h2 style='text-align: left; margin: 0;'>"
            + p_translate(PRC_WEBSITE, prc_language_initial) + "</h2></span>";

        result += "\n<p class=timeline>";
        if (prc_menu_type == 'DH')
        {
            result += "<a href='index" + prc_language_suffix + ".htm'><b>HOME</b></a>";
            result += p_translation_links('index' + prc_language_suffix);
//                 + "\n<a style='text-decoration: none;' "
//                 + "href='indexG.htm'>"
//                 + p_translation_icon('G') + "</a>";
        }

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 timeline_type = new String();
            if (plx_url_parms.hasOwnProperty("timeline"))
            {
                timeline_type = plx_url_parms["timeline"];
            }
            var tlx;
            var arrow = "&minus;>";
//             var tab = "&nbsp;&nbsp;&nbsp;&nbsp;";
            var indent = x_tabs(1);
            for (tlx = 1; tlx < prc_depth; tlx++)
            {
                if (timeline_type == 'wraparound')
                {
                    result += "\n&nbsp;" + arrow + "&nbsp;";
                }
                else // if (timeline_type == 'staircase')
                {
                    result += "\n<br>" + indent;
                }
                result += p_assemble('-timeline', prc_timeline[tlx]);
                indent += x_tabs(1);
            }
        }
        result += "</p>";
        result += "</td>";

/*- - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - */
/*                       Show a picture of Paul                       */
/*- - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - */
// Use absolute client width and height because
// document.body.clientWidth doesn't exist yet:
        result += "\n<td align=center bgcolor=#" + PRC_BG_WHEAT + ">"
            + "<img src='_pix/" + prc_random_unused_snapshot(PRC_PAUL_SMALL_SNAPSHOTS)
            + "' width=100 height=100></td></tr></table>";
    }
x_log(result);
x_log("\n----------------------------------------------------- P R C _ B O D Y ( )");
    prc_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()
{
    var result = new String();
x_log("\nP R C _ B O D Y _ E N D ( ) ---------------------------------------------");

/*- - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - */
/*              Source Name, Author Bio and Author Menu               */
/*- - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - */
//     prc_source_name();
    if (prc_friend_initials != 'dh') prc_friend(prc_friend_initials, 'bio');
    if (prc_friend_initials != 'dh') prc_friend(prc_friend_initials, 'menu');

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

/*- - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - */
/*                     Show this page's siblings                      */
/*- - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - */
    if (prc_menu_type == 'DH') prc_sibling_menu();

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

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

/*- - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - */
/*                         Table of Contents                          */
/*- - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - */
    if (prc_menu_type == 'DH') result += "\n" + prc_table_of_contents();

/*- - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - */
/*                            Bottom Panel                            */
/*- - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - */
    result += "\n<table border=00 bgcolor=#" + PRC_BG_WHEAT + " "
        + "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 " + prc_friend_code('dh')
        + " except where otherwise indicated"

        + "\n<br>Web design and programming by " + prc_friend_code('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 width=16 height=16 "
//         + "src='_pix/rss_icon_16x16.png'></a>"

        + "\n<br>Write to us at " + prc_email_link_code();

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

/*- - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - */
/*                             ClustrMap                              */
/*- - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - */
    if (prc_site == 'remote')
    {
        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;'>"
        + "\n<h6>Join the " + prc_link_code(PRC_YAHOO_GROUP_URL,
          '', "<b>Paul Rosenfels Yahoo 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);

/*- - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - */
/*                         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>";
    }

/*- - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - */
/*                         Statistics Credit                          */
/*- - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - */
// This insert slows down the page fetch
// so we skip it when running in TEST mode
    if (prc_site == 'remote')
    {
        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 -->";
    }

/*- - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - */
/*                   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_site == 'remote')
    {
        result +=
                "\n<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 src='_pix/sharing/blogger.jpg'                                            alt='Blogger'      name='Blogger'     id='Blogger'     border='0' /></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 src='_pix/sharing/delicious.png'                                          alt='Delicious'    name='Delicious'   id='Delicious'   border='0' /></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 src='_pix/sharing/digg.png'                                               alt='Digg'         name='Digg'        id='Digg'        border='0' /></a>"
    //         + "\n&nbsp;<a name='fb_share' type='button' href='http://www.facebook.com/sharer.php'>Share</a><script src='http://static.ak.fbcdn.net/connect.php/js/FB.Share' type='text/javascript'></script>"
            + "\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 src='_pix/sharing/google.png'                                             alt='Google'       name='Google'      id='Google'      border='0' /></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 src='_pix/sharing/newsvine.png'                                           alt='Newsvine'     name='Newsvine'    id='Newsvine'    border='0' /></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 src='_pix/sharing/reddit.png'                                             alt='Reddit'       name='Reddit'      id='Reddit'      border='0' /></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 src='_pix/sharing/simpy.png'                                              alt='Simpy'        name='Simpy'       id='Simpy'       border='0' /></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 src='_pix/sharing/slashdot.png'                                           alt='Slashdot'     name='slashdot'    id='slashdot'    border='0' /></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 src='_pix/sharing/stumbleupon.png' alt='Stumbleupon'  name='stumbleupon' id='stumbleupon' border='0' /></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 src='_pix/sharing/technorati.png'                                         alt='Technorati'   name='Technorati'  id='Technorati'  border='0' /></a>"
            + "\n&nbsp;<a href='javascript:void window.open(\"http://twitter.com/home?status=\"+escape(document.location))'                                                                                                                                              title='Add to Twitter'                    ><img src='_pix/sharing/twitter.png'                                            alt='Twitter'      name='Twitter'     id='Twitter'     border='0' /></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 src='_pix/sharing/myyahoo.png'                                            alt='My Yahoo'     name='MyYahoo'     id='MyYahoo'     border='0' /></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 src='_pix/sharing/live.png'                                               alt='Windows Live' name='WindowsLive' id='WindowsLive' border='0' /></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 += "\nIn menus, <img src='_pix/bullet_green_14x13.gif'> "
        + "means the link is active, "
        + "<img src='_pix/bullet_yellow_14x13.gif'>means you're "
        + "already on that page, and <img src='_pix/bullet_red_14x13.gif'> "
        + "means the page is under construction. ";

    result += "\nIn links, <img src='_pix/is_external_link_13x15.gif'> "
        + "means the page is external to this site, "
        + "\n<img src='_pix/is_pdf_link_17x16.gif'> "
        + "means the page is a .pdf file, and "
        + "\n<img src='_pix/is_collage_link_17x16.gif'> "
        + "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. "
        + p_translation_icon('E') + "=English, "
        + p_translation_icon('F') + "=French, "
        + p_translation_icon('G') + "=German and "
        + p_translation_icon('S') + "=Spanish.";

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

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

//         + "\n<br>Don't expect any polished gems on this site."

        + "</td></tr>";

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

/*- - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - */
/*          Put Flag Counter on Home Page (in any language)           */
/*- - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - */
    if (prc_site == 'remote')
    {
        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_MAROON
                + "/border=" + PRC_BD_WHITE
                + "/columns=9"
                + "/maxflags=54"
                + "/viewers=People+Have+Visited+Us+from+the+Following+Countries"
                + "/labels=1"
                + "/'></a></td></tr></table>";

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

x_log_resources_used();

x_log("\n--------------------------------------------- P R C _ B O D Y _ E N D ( )");
    prc_write(result);
//     if (prc_site == "local")
//     {
//         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"
//
// + "-table-of-contents ------------------------------------------------------------\n"
// + p_assemble('-table-of-contents', prc_ptx) + "\n\n"
//
// + "-h1 ---------------------------------------------------------------------------\n"
// + p_assemble('-h1'       , prc_ptx)
// );
//     }
}

/*--------------------------------------------------------------------*/
/*                     prc_child_menu() function                      */
/*--------------------------------------------------------------------*/
function prc_child_menu(a_page, a_anchor, a_title)
{
x_log("\nprc_child_menu('" + a_page + "', '" + a_anchor + "', \"" + a_title + "\");");
    var result = new String();
    var ptx, page, anchor, title;
    if (x_is_not_empty(a_page))
    {
        page   = a_page;
        anchor = a_anchor;
        title  = "";
        var ptx = prc_index(page, anchor);
        if (ptx > -1) {title = pagetree[ptx + TITLE]}
    }
    else
    {
        ptx    = prc_ptx;
        page   = prc_page;
        anchor = prc_anchor;
        title  = prc_title;
    }
    if (typeof a_title != 'undefined') {title = a_title}
x_log("\npage: '" + page + "', anchor: '" + anchor + "', title: \"" + title + "\"");

x_log("\nDisplaying a child menu for '" + page + anchor + "'.");
    prc_menu(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)
{
x_log("\nprc_collage('" + a_key + "', '" + a_resize + "', '" + a_parms + "', '" + a_caption + "');");
    var key = '_' +  prc_page + '_';
    if (x_is_not_empty(a_key)) key = a_key;
    var resize = '80%';
    var parms = '-center';
    var caption = new String();
    if (x_is_not_empty(a_resize) ) resize = a_resize  ;
    if (x_is_not_empty(a_parms)  ) parms = a_parms    ;
    if (x_is_not_empty(a_caption)) caption = a_caption;
    for (px = 0; px < piclist.length; px++)
    {
        if (piclist[px].substr(0, 3) != 'rb_') continue;
        if (piclist[px].indexOf(key) > -1) break;
    }
    if (px >= piclist.length)
    {
        return x_error("prc_collage(): Search argument '"
            + key + "' " + "not found among collage names.");
    }
    var year = piclist[px].substr(3, 4);
    if (caption == '')
    {
        caption = "[&copy; " + year + " Rachel Bartlett]<br>"
        + "<a href='rbCollages.htm'>See all of Rachel's collages</a>";
    }
    prc_snapshot(piclist[px], resize, parms, 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()
{
    var result = PRC_CYCLING_BGCOLORS[prc_cycling_bgcolor_index];
// x_log("\nprc_cycling_bgcolor() => '"
// + PRC_CYCLING_BGCOLORS[prc_cycling_bgcolor_index]
// + "' (" + prc_cycling_bgcolor_index + ")");
    prc_cycling_bgcolor_index
        = ++prc_cycling_bgcolor_index
        %   prc_cycling_bgcolor_dimen;
    return result;
}

/*--------------------------------------------------------------------*/
/*                        prc_debug() function                        */
/*--------------------------------------------------------------------*/
function prc_debug(a_setting)
{
x_log("\nChanging 'prc_debug_setting' from '" + prc_debug_setting + "' to '" + a_setting + "'.");
    prc_debug_setting = a_setting;
}

/*--------------------------------------------------------------------*/
/*                      prc_debug_end() function                      */
/*--------------------------------------------------------------------*/
function prc_debug_end()
{
x_log("\nChanging 'prc_debug_end_setting' from '" + prc_debug_setting + "' to '0'.");
    prc_debug_end_setting = 0;
}

/*--------------------------------------------------------------------*/
/*                       prc_dialog() function                        */
/*--------------------------------------------------------------------*/
function prc_dialog(a_dimen)
{
x_log("\nprc_dialog('" + a_dimen + "');");
    if (x_is_empty(a_dimen))
    {
        prc_cycling_bgcolor_dimen = 2;          // default to 2 colors
x_log("\nprc_cycling_bgcolor_dimen defaults to '2'.");
    }
    else
    {
        if (a_dimen == '*')
        {
x_log("\nPRC_CYCLING_BGCOLORS.length: '" + PRC_CYCLING_BGCOLORS.length + "'");
            prc_cycling_bgcolor_dimen = PRC_CYCLING_BGCOLORS.length;
        }
        else
        {
            prc_cycling_bgcolor_dimen = a_dimen;
        }
    }
x_log("\nprc_cycling_bgcolor_dimen: '" + prc_cycling_bgcolor_dimen + "'");
    prc_floating_table();
}

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

/*--------------------------------------------------------------------*/
/*                     prc_email_link_code() function                 */
/*--------------------------------------------------------------------*/
function prc_email_link_code()
{
    var result = x_email
    (
        x_yyyy() + '@' + PRC_DOMAIN,
        x_yyyy(),
        PRC_DOMAIN,
        "subject=(Sent from '" + location + "')"
    );
    return result;
}

/*--------------------------------------------------------------------*/
/*                  prc_floating_row_code() function                  */
/*--------------------------------------------------------------------*/
function prc_floating_row_code()
{
    return "<tr bgcolor='" + prc_cycling_bgcolor() + "'>";
}

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

/*--------------------------------------------------------------------*/
/*                   prc_floating_table() function                    */
/*--------------------------------------------------------------------*/
function prc_floating_table(a_parms)
{
    var parms = a_parms;
    if (x_is_empty(a_parms )) parms = '';
    parms += " align=center width=0 cellspacing=16 cellpadding=8 "
        + "\n style='margin-top: 12; margin-bottom: 12; "
        + "padding-top: 4; padding-bottom: 4; "
        + "background-image: url(_pix/background_1_100x100.jpg);'";
    prc_table(parms);
}

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

/*--------------------------------------------------------------------*/
/*                       prc_fnote() function                         */
/*--------------------------------------------------------------------*/
function prc_fnote(a_num)
{
// NOTE: Footnote links only work in IE because Firefox doesn't
// seem to support <a name=''> tags generated in Javascript.
    prc_fnote_end();
    var num = new String();
    if (x_is_not_empty(a_num)) num = a_num;
    var result = new String("<tr><td align=right valign=top>");
    if (x_browser() == 'IE')
    {
        result += "<a name='#FNOTE_" + num + "'></a>"
                + "<a href='#FNREF_" + num + "'>";
    }
    result += "&nbsp;" + num + ".&nbsp;"
    if (x_browser() == 'IE') result += "</a>";
    result += "</td><td>";
    prc_write(result);
    prc_in_an_fnote = true;
}

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

/*--------------------------------------------------------------------*/
/*                       prc_fnref() function                         */
/*--------------------------------------------------------------------*/
function prc_fnref(a_num)
{
// NOTE: Footnote links only work in IE because Firefox doesn't
// seem to support <a name=''> tags generated in Javascript.
    var num = new String();
    if (x_is_not_empty(a_num)) num = a_num;
    var result = new String();
    if (x_browser() == 'IE')
    {
        result += "<a name='#FNREF_" + num + "'></a>"
                + "<a href='#FNOTE_" + num + "'>";
    }
    result += "<b><sup>&nbsp;" + num + "&nbsp;</sup></b>";
    if (x_browser() == 'IE') result += "</a>";
    prc_write(result);
}

/*--------------------------------------------------------------------*/
/*                      prc_footnotes() function                      */
/*--------------------------------------------------------------------*/
function prc_footnotes(a_title)
{
    var title = new String('Footnotes');
    if (x_is_not_empty(a_title)) title = a_title;
    prc_table("cellpadding=4");
    prc_write("<tr><td colspan=9 align=center>"
        + "<b>" + title + "</b></td></tr>");
}

/*--------------------------------------------------------------------*/
/*                    prc_footnotes_end() function                    */
/*--------------------------------------------------------------------*/
function prc_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_h_code() function                        */
/*--------------------------------------------------------------------*/
function prc_h_code(a_level)
{
    return p_assemble("-h" + a_level, prc_ptx);
}

/*--------------------------------------------------------------------*/
/*                        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_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();
    document.write("\n<tr><td nowrap align=right valign=top>"
        + "<b>" + who + "</b></td><td width=16>&nbsp;</td>"
        + "\n<td>");
    prc_in_a_line = true;
}

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

/*--------------------------------------------------------------------*/
/*                      prc_link_code() function                      */
/*                                                                    */
/*   If a_page is in the pagetree, the title defaults to the title    */
/*                       attribute in pagetree.                       */
/*                                                                    */
/*    If a_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.   */
/*--------------------------------------------------------------------*/
function prc_link_code(a_page, a_anchor, a_title)
{
    return p_assemble('-link', a_page, a_anchor, a_title);
}

/*--------------------------------------------------------------------*/
/*                        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 early 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 are to be          */
/* displayed.                                                         */
/*                                                                    */
/*--------------------------------------------------------------------*/
function prc_menu(a_title)
{
x_log("\nprc_menu('" + a_title + "');");
    prc_menu_title = '';
    if (x_is_not_empty(a_title)) prc_menu_title = a_title;
x_log("\nprc_menu_title = '" + prc_menu_title + "'.");
}

/*--------------------------------------------------------------------*/
/*                      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 + "'.");
    result = prc_table_code("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 += prc_table_code("style='margin-top: 16; margin-bottom: 16; "
            + "margin-left: 32; margin-right: 32;'");
    }
    else
    {
        result += prc_table_code("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_WHEAT + ">" + prc_menu_title + "</td></tr>";
        prc_menu_title = '';
    }
x_log("\nprc_menu_choices = \"" + prc_menu_choices + "\".");
    result += prc_menu_choices + prc_table_end_code()
        + "</td></tr>" + prc_table_end_code();
    prc_menu_choices = '';
    if (debug_flag) alert(result);
// x_log("\n" + result);
    prc_write(result);
}

/*--------------------------------------------------------------------*/
/*                 prc_notable_pages_menu() function                  */
/*--------------------------------------------------------------------*/
function prc_notable_pages_menu(a_title)
{
x_log("\nprc_notable_pages_menu('" + a_title + "')");
    var ptx;
    var title = new String(p_translate(PRC_WEBSITE, prc_language_initial));
    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];
        if (this_page == '' || this_comment == '') continue;
        if (this_page.substr(0, 7) == 'http://') continue;
        if (this_page.substr(0, 7) == 'https:/') continue;
        prc_choice(this_page, this_anchor);
    }
    prc_menu_end();
}

/*--------------------------------------------------------------------*/
/*                 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)
{
    prc_write("page&nbsp;" + a_page_num);
}

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

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

/*--------------------------------------------------------------------*/
/*                     prc_pull_quote() function                      */
/*--------------------------------------------------------------------*/
function prc_pull_quote(a_flags, a_quote)
{
    var result = new String
    (
          "<td bgcolor='#" + PRC_BG_WHITE + "' align='" + a_flags + "' width=175>"
        + "<img src='_pix/quote_open 175x29.gif'><p "

        + "style='margin-left: 8; margin-right: 8; "
        + "color: #"                      // copied from x_hover_style()
        + PRC_FG_MAROON + "; font-size: 12; "
        + "background-color: #" + PRC_BG_LIGHT_GRAY + "; "
        + "border: #" + PRC_BG_WHITE + " 4px solid;'>"

        + a_quote + "</p><img src='_pix/quote_close 175x28.gif'></td>"
    );
    var errmsg = new String();
    if      (a_flags == '-right') result =  "<td></td>" + result;
    else if (a_flags == '-left' ) result += "<td></td>";
    else
    {
         errmsg = "Invalid flags, '<b>" + a_flags
             + "</b>', in invocation of prc_pull_quote).";
         result = errmsg;
    }
    result = "<table border=00 align='" + a_flags.substr(1) + "'><tr>"
        + result + "</tr></table>";
x_log("\nprc_pull_quote('" + a_flags + "', \"" + a_quote + "\") => \"" + result + "\".");
    prc_write(result);
}

/*--------------------------------------------------------------------*/
/*               prc_random_unused_snapshot() function                */
/*--------------------------------------------------------------------*/
function prc_random_unused_snapshot(a_snapshot_array)
{
// var old_log_to_browser = x_log_to_browser(true);
x_log("\nprc_random_unused_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 = '';
    var resource = new String('');
    while (result == '')
    {
        result = a_snapshot_array
        [
            Math.floor(Math.random() * a_snapshot_array.length)
        ];
        x_parse_imgsrc(result);
        resource = "snapshot=\"" + plx_parse_imgsrc_caption + "\"";
        if (x_is_a_used_resource(resource))
        {
x_log("\nWe've used this snapshot already!");
            result = '';
        }
    }
    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>" + prc_table_code("cellspacing=8");
    document.write(result);
}

/*--------------------------------------------------------------------*/
/*                     prc_script_end() function                      */
/*--------------------------------------------------------------------*/
function prc_script_end()
{
x_log("\nprc_script_end();");
    var result = prc_table_end_code() + "</blockquote>";
    document.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 notable pages instead of siblings.");
            prc_notable_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_sidebar_code() function                     */
/*--------------------------------------------------------------------*/
function prc_sidebar_code(a_align, a_width, a_bgcolor)
{
    var align   = 'left';
    var width   = '50%';
    var bgcolor = PRC_BG_MINT_GREEN;

    if (typeof a_align   != 'undefined') align   = a_align  ;
    if (typeof a_width   != 'undefined') width   = a_width  ;
    if (typeof a_bgcolor != 'undefined') bgcolor = a_bgcolor;

    var margin_top    = 16;
    var margin_bottom = 16;
    var margin_left   = 16;
    var margin_right  = 16;

    if (align == 'left' ) margin_left  = 0;
    if (align == 'right') margin_right = 0;

    var result = prc_table_code
    (
        "align='" + align + "' width='" + width + "' "
            + "cellpadding=16 bgcolor=#" + bgcolor
            + "\nstyle='"
            + "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;
}

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

/*--------------------------------------------------------------------*/
/*                        prc_site() function                         */
/*--------------------------------------------------------------------*/
function prc_site()
{
    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();
//     var source_name = prc_source_names[prc_source_code];
//     if (x_is_not_empty(a_source_name)) source_name = a_source_name;
//     if (x_is_not_empty(source_name))
//     {
//         result = "<p class=right>&mdash; reprinted from "
//             + source_name + ".</p>";
//         prc_write("\n" + result);
//     }
// x_log("\nprc_source_name('" + a_source_name + "') = '" + result + "'");
//     return result;
// }

/*--------------------------------------------------------------------*/
/*                       prc_speech() function                        */
/*                                                                    */
/*        The first column of a speech row can be the value of        */
/*    a_column, or it can immediately follow the <<speech>> macro.    */
/*                                                                    */
/*                   There are usually two columns.                   */
/*                Column 1 generates <<floating_row>>.                */
/*              <</speech>> generates <</floating_row>>.              */
/*                                                                    */
/*--------------------------------------------------------------------*/
function prc_speech(a_speaker, a_debug)
{
    var result = new String();
    if (prc_speech_column == 2) prc_speech_end();
    prc_speech_column++;

    if (prc_speech_column == 1)
    {
        result += prc_floating_row_code()
            + "<td align=right valign=top><p class=right>";
    }
    else
    {
        result += "</p></td><td valign=top><p>";
    }
    if (x_is_not_empty(a_speaker))
    {
        result += a_speaker + "</p></td><td valign=top><p>";
        prc_speech_column++;
    }
    prc_in_a_speech = true;
if (a_debug) alert("prc_speech('" + a_speaker + "') => '" + result + "'");
    prc_write(result);
}

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

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

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

/*--------------------------------------------------------------------*/
/*                  prc_table_of_contents() function                  */
/*--------------------------------------------------------------------*/
function prc_table_of_contents()
{
x_log("\nP R C _ T A B L E _ O F _ C O N T E N T S ( ) ---------------------------");
    var result = new String();

// 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 greater allegiance to the sillier rules of XHTML.

    result += "\n<center><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(20);
//     result += "\n&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;"
//             + "\n&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;"
//             + "\n&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;"
//             + "\n&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;"
//             + "\n&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;"
//             + "\n&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;"
//             + "\n&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;"
//             + "\n&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;"
//             + "\n&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;"
//             + "\n&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;"
//             + "\n&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;"
//             + "\n&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;"
//             + "\n&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;";

// Browsers like Firefox need a bit more padding:
    if (x_browser() != 'IE')
    {
//         result += "\n&nbsp;&nbsp;&nbsp;&nbsp;";
    }

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

    for (ptx = 0; ptx < pagetree.length; ptx += DESCLEN)
    {
        result += "\n" + p_assemble('-table-of-contents', ptx);
    }

/*- - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - */
/*                            End of form                             */
/*- - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - */
    result += "\n</select>\n</form>\n</center>";
// x_log(result + "\n");
x_log("\n---------------------------- P R C _ T A B L E _ O F _C O N T E N T S ( )");
    return result;
}

/*--------------------------------------------------------------------*/
/*               prc_ultimate_dropdown_menu() function                */
/*--------------------------------------------------------------------*/
// function prc_ultimate_dropdown_menu()
// {
//     prc_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_wiki() function                         */
/*--------------------------------------------------------------------*/
function prc_wiki(a_article, a_display)
{
    prc_write(x_wiki(a_article, a_display) + "&nbsp;"
        + "<img border=0 src='_pix/is_external_link_13x15.gif'>");
}

/*--------------------------------------------------------------------*/
/*                        prc_yyyy() function                         */
/*--------------------------------------------------------------------*/
function prc_yyyy(a_resource)
{
    prc_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("\n document.body.clientWidth: " + document.body.clientWidth);
x_log("\ndocument.body.clientHeight: " + document.body.clientHeight);
// x_log("\ndocument.styleSheets.length = '" + document.styleSheets.length + "'");
//     if (prc_debug_setting == 1)
//     {
//         var sheet = document.styleSheets[0];
//         if (sheet.insertRule)
//         {
// x_log("\nUsing insertRule ...");
//             sheet.insertRule("p {background-color: 'yellow';}");
//         }
//         else if (sheet.addRule)
//         {
// x_log("\nUsing addRule ...");
//             sheet.addRule("p", "background-color: 'yellow';");
//         }
//     }
}

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

/*--------------------------------------------------------------------*/
/*                    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_is_collage_link() function                    */
/*--------------------------------------------------------------------*/
function p_is_collage_link(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;
        }
    }
x_log("\np_is_collage_link('" + a_page + "') => " + result);
    return result;
}

/*--------------------------------------------------------------------*/
/*                  p_normalize_hostname() function                   */
/*--------------------------------------------------------------------*/
function p_normalize_hostname()
{
    var new_loc = PRC_HOMEPAGE;
    if (location.hostname == 'www.ninthstreetcenter.org'
    ||  location.hostname == 'ninthstreetcenter.org')
    {
// Google 'define' sends people to 'ninthstreetcenter.org/Glossary.htm'!
        if (location.pathname == '/Glossary.htm')
        {
            new_loc = PRC_HOMEPAGE + '/nsc/Glossary.htm';
        }
        else
        {
            alert("You are being redirected to the new Paul Rosenfels "
                + "Community website at '" + PRC_HOMEPAGE + "'.");
        }
    }
    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(" = \"" + result + "\"");
    return result;
}

/*--------------------------------------------------------------------*/
/*                   p_translation_icon() function                    */
/*--------------------------------------------------------------------*/
function p_translation_icon(a_language_initial)
{
    var color = '#fff';
//     var background_color = '#69c';
    var background_color = '#f88';
    var result = "<span style='"

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

        + "'>&nbsp;" + a_language_initial + "&nbsp;</span>";
    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 a foreign language, offer the English version  */
/*- - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - */
    if (prc_language_initial != 'E')
    {
// x_log("\nSince there is currently an English version of every page, we don't "
// + "need 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);
        menu_title = "Here is the English-language version of this page";
        if (prc_language_initial == 'G')
        {
            menu_title = "Hier ist die englische Version "
                + "dieser Seite <br>[" + menu_title + "]";
        }
        prc_menu(menu_title);
        prc_choice(english_page, prc_anchor);
        prc_menu_end();
    }

/*--------------------------------------------------------------------*/
/*                    If this page is in English,                     */
/*        offer any foreign lanaguage versions that may exist         */
/*--------------------------------------------------------------------*/
    else
    {
        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();
            }
        }
    }
}

/*--------------------------------------------------------------------*/
/*                       p_assemble() function                        */
/*--------------------------------------------------------------------*/
function p_assemble(a_what, a_page, a_anchor, a_title, a_comment, a_parms)
{
// var i_what = ''; if (x_is_not_empty

/*- - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - */
/*    Data from the pagetree or overrides from the parameter list     */
/*- - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - */
    var depth   = '';
    var node    = '';
    var pubdate = '';
    var page    = '';
    var anchor  = '';
    var title   = '';
    var comment = '';
    var parms   = '';

/*- - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - */
/*                      Data extracted from PAGE                      */
/*- - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - */
    var friend_initials  = '';
    var friend_name      = '';

    var language_initial = '';
    var language_suffix  = '';
    var language_name    = '';

    var has_filetype     = false;
    var is_external_link = false;
    var is_pdf_link      = false;
    var is_folder_link   = false;
    var is_collage_link  = false;

/*- - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - */
/*                     Data extracted from PARMS                      */
/*- - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - */
    var age_flag     = ''; // -new, -updated
    var private_flag = ''; // -private

    var author_name  = ''; // author:
    var genre        = ''; // genre:
    var source_code  = ''; // source:
    var subtitle     = ''; // subtitle:
    var year         = ''; // year:

/*- - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - */
/*                   Data derived from author_name                    */
/*- - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - */
    var first_name   = '';
    var last_name    = '';
    var byline       = '';

/*- - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - */
/*                            Other stuff                             */
/*- - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - */
    var translation_links = new String('');         // icons pointing to
                                            // translations of this page
    var funcall  = '';
    var ptx      = -1;                           // ptx of page + anchor
    var page_ptx = -1;               // ptx of page only if anchor != ""
    var href     = '';
    var result   = '';

    var funcall = "p_assemble('"
        + a_what    + "', '"
        + a_page    + "', '"
        + a_anchor  + "', \""
        + a_title   + "\", \""
        + a_comment + "\", \""
        + a_parms   + "\")";

    var what = x_get_parm
    (
        a_what, ['-timeline', '-h1', '-link', '-choice', '-table-of-contents'], '-link'
    );

/*- - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - */
/*     Phase 1: Gather as much information as possible about the      */
/*   page in question from the parameters passed to this function.    */
/*- - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - */
x_log("\nP R C _ A S S E M B L E ( ) ---------------------------------------------");
x_log("\n" + funcall + ";");
x_log("\nwhat: \"" + what + "\"");

    has_filetype     = x_has_filetype    (a_page);
    is_external_link = x_is_external_link(a_page);

/*- - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - */
/*          If the first parameter is a number then it must           */
/*           be a valid index into the pagetree table                 */
/*- - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - */
x_log("\ntypeof a_page = '" + typeof a_page + "'");
    if (typeof a_page == 'number')
    {
        ptx = a_page;
        if (ptx % DESCLEN == 0)
        {
x_log("\n" + a_page + " is a valid index into the pagetree table");
        }
        else
        {
            result = funcall + ": '" + a_page
                + "' is not a valid index into the pagetree table"
                + " because it's not a multiple of " + DESCLEN + ".";
x_log("\n" + result);
            return result;
        }
    }

/*- - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - */
/*               Else if it begins with 'http' or has a               */
/*                filetype then it is an explicit href                */
/*- - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - */
    else if (is_external_link || has_filetype)
    {
        page = a_page;
    }

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

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

/*- - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - */
/*            Else exit because this is not a valid page.             */
/*- - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - */
    else
    {
        result = funcall + ": '" + a_page
            + "' is neither a pagetree index, a page name, or an href.";
x_log("\n" + result);
        return result;
    }

/*- - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - */
/*                   If you find a pagetree entry,                    */
/*               gather up all parameters found there                 */
/*- - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - */
    if (ptx > -1)
    {
x_log("\nGathering all parameters from pagetree index " + ptx + " ...");
        depth   = pagetree[ptx + DEPTH  ];
        node    = pagetree[ptx + NODE   ];
        pubdate = pagetree[ptx + PUBDATE];
        page    = pagetree[ptx + PAGE   ];
        anchor  = pagetree[ptx + ANCHOR ];
        title   = pagetree[ptx + TITLE  ];
        comment = pagetree[ptx + COMMENT];
        parms   = pagetree[ptx + PARMS  ];

x_log("\n      depth: "   + depth               );
x_log("\n       node: '"  + node          + "'" );
x_log("\n    pubdate: '"  + pubdate       + "'" );
x_log("\npage/anchor: '"  + page + anchor + "'" );
x_log("\n      title: \"" + title         + "\"");
x_log("\n    comment: \"" + comment       + "\"");
x_log("\n      parms: \"" + parms         + "\"");
    }

/*- - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - */
/*      If other parameters to this function are specified, use       */
/*   them to override whatever you might have found in the pagetree   */
/*- - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - */
//  if (x_is_not_empty(a_page   )) page    = a_page   ;
    if (x_is_not_empty(a_anchor )) anchor  = a_anchor ;
    if (x_is_not_empty(a_title  )) title   = a_title  ;
    if (x_is_not_empty(a_comment)) comment = a_comment;
    if (x_is_not_empty(a_parms  )) 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           */
/*- - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - */
    page = new String(page);
    if (x_is_not_empty(page))
    {
        has_filetype     = x_has_filetype(page);
        is_external_link = x_is_external_link(page);
        is_pdf_link      = x_is_pdf_link(page);
        is_folder_link   = is_external_link
                         && page.charAt(page.length - 1) == PRC_SLASH;
        is_collage_link  = p_is_collage_link(page);
        if (has_filetype   || is_external_link || is_pdf_link
        ||  is_folder_link || is_collage_link)
        {
x_log("\nhas_filetype: " + has_filetype
+ ", is_external_link: " + is_external_link
     + ", is_pdf_link: " + is_pdf_link
  + ", is_folder_link: " + is_folder_link
 + ", is_collage_link: " + is_collage_link);
        }

        if (is_external_link || has_filetype)
        {
            href = page;
            if (x_is_empty(title)) title = href;
        }
        else
        {
            href = page + PRC_DEFAULT_EXT + anchor;
        }
x_log("\nhref: \"" + href + "\"");

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

        language_initial = page.substr(page.length - 1, 1);
        if (!(prc_languages[language_initial] instanceof Array))
        {
            language_initial = 'E';
        }
        language_suffix = prc_languages[language_initial]['suffix'];
        language_name   = prc_languages[language_initial]['name'  ];
x_log("\nlanguage_initial: \"" + language_initial + "\"");
x_log("\n language_suffix: \"" + language_suffix  + "\"");
x_log("\n   language_name: \"" + language_name    + "\"");

        translation_links = p_translation_links(page, anchor);
    }

/*- - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - */
/*                   Extract data from PARMS column                   */
/*- - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - */
    if (x_is_not_empty(parms))
    {
        age_flag     = x_get_parm(parms, ['-new', '-updated']);
        private_flag = x_get_parm(parms, ['-private']);

        author_name  = x_get_parm(parms, 'author:');
        genre        = x_get_parm(parms, 'genre:');
        source_code  = x_get_parm(parms, 'source:');
        subtitle     = x_get_parm(parms, 'subtitle:');
        year         = x_get_parm(parms, 'year:');

        if (age_flag || author_name || genre || private_flag || source_code || subtitle || year)
        {
x_log("\nage_flag: '"  + age_flag
+ "', private_flag: '" + private_flag
+ "', author_name: '"  + author_name
+ "', genre: '"    + genre
+ "', source_code: '"  + source_code
+ "', subtitle: '" + subtitle
+ "', year: '"     + year
+ "'");
        }
    }

/*- - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - */
/*                  Derive more info from the givens                  */
/*- - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - */
    if (!author_name && friend_name)
    {
        author_name = friend_name;
x_log("\nauthor_name: \"" + author_name + "\"");
    }
    if (author_name)
    {
        var first_name_len = author_name.indexOf(' ');
        var last_name_len  = author_name.length
                           - author_name.lastIndexOf(' ') - 1;
        first_name = author_name.substr(0, first_name_len);
        last_name  = author_name.substr
        (
            author_name.length - last_name_len,
            last_name_len
        );
x_log("\nfirst_name: \"" + first_name + "\"");
x_log("\nlast_name: \"" + 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.                                                        */
/*- - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - */
        if (title.indexOf(first_name)          == -1
        &&  title.indexOf( last_name)          == -1
        &&  prc_menu_title.indexOf(first_name) == -1
        &&  prc_menu_title.indexOf( last_name) == -1)
        {
            if (genre == 'reviews')
            {
                byline += p_translate('reviewed', language_initial) + ' ';
            }
            byline += p_translate('by', language_initial)
                + ' ' + author_name;
x_log("\nbyline: \"" + byline + "\"");
        }
    }

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

/*- - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - */
/*   Don't assemble anything except an <h1> if the page is private    */
/*- - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - */
    if (private_flag && what != '-h1')
    {
x_log("\n'" + href + "' is '" + private_flag + "'.");
        return '';
    }

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

// Don't use soft breaks in the timeline:
        title = String(title);
        title = title.replace(/ /g, "&nbsp;");
        title = title.replace(/<br>/gi, "&nbsp;");
        title = title.replace(/<sbr>/gi, "&nbsp;");

        result += "<a href='" + href + "'><b>" + title  + "</b></a>";
        if (prc_site == "local") result += " (" + href + ")";
        result += translation_links;
        if (is_collage_link)
        {
            result += "&nbsp;<img border=0 src='_pix/is_collage_link_17x16.gif'>";
        }
    }

/*- - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - */
/*                           Assemble a -h1                           */
/*- - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - */
    else if (what == '-h1')
    {
// Get title of page, not just anchor:
        if (anchor)
        {
            title = pagetree[page_ptx + TITLE];
x_log("\ntitle: '" + title + "'");
        }
// Process soft breaks:
        if (title.indexOf("<sbr>") > -1)
        {
            title = title.replace(/ <sbr>/gi, "<sbr>");
            title = x_soft_breaks(title);
x_log("\ntitle: '" + title + "'");
        }

        if (year)
        {
            year = '&nbsp;&nbsp;[' + year + ']';
            if (byline) byline += year;
            else if (subtitle) subtitle += year;
            else title += year;
        }
        result += "<h1>" + title + "</h1>";
        if (subtitle)
        {
            result += "\n<h1 class=subtitle>" + subtitle + "</h1>";
        }
        if (byline)
        {
            result += "\n<h1 class=byline>" + byline + "</h1>";
        }
        if (language_initial == 'G' && friend_initials != 'rb')
        {
            result += "\n<h1 class=translator>[&Uuml;bersetzt von "
                + prc_friend_code('rb') + "]</h1>";
        }
    }

/*- - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - */
/*                          Assemble a -link                          */
/*- - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - */
    else if (what == '-link')
    {
        result = title.replace(/<br>/gi, " ");
        result = result.replace(/<sbr>/gi, " ");
        result = result.replace(/  /gi, " ");
        result = "<b>" + result + "</b>";                    // 20100827
        result = "<a href='" + href + "'>" + result + "</a>";
        if (prc_site == "local") result += " (" + href + ")";
        result += translation_links;
        if  (is_collage_link)
        {
            result += "&nbsp;<img border=0 src='_pix/is_collage_link_17x16.gif'>";
        }
        if  (is_external_link)
        {
            result += "&nbsp;<img border=0 src='_pix/is_external_link_13x15.gif'>";
        }
        if  (is_pdf_link)
        {
            result += "&nbsp;<img border=0 src='_pix/is_pdf_link_17x16.gif'>";
        }
    }

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

/*- - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - */
/*                         Remember this page                         */
/*- - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - */
        var resource;
        if (ptx > -1) resource = "ptx="  + ptx;
        else          resource = "href=" + href;
        if (x_is_a_used_resource(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 " + resource + " because it was already offered on this page.");
        }
        else
        {
            x_use_resource(resource);

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

/*- - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - */
/*                  What color bullet should we use?                  */
/*- - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - */
            var is_link_active = false;
            var on_this_page   = false;
            var page_not_ready = false;

            if (page == "" && anchor == "" && href == "")
            {
                page_not_ready = true;             // page is under construction
                result += "<img src='_pix/bullet_red_14x13.gif' border=0>";
            }
            else if (page == prc_page && anchor == prc_anchor)    // we're there
            {
                on_this_page = true;
                result += "<img src='_pix/bullet_yellow_14x13.gif' border=0>";
            }
            else
            {
                is_link_active = true;           // page is ready for prime time
                result += "<img src='_pix/bullet_green_14x13.gif' border=0>";
            }
            result += "</td>\n<td>";
            if (is_link_active) result += "<a href='" + href + "'>";

/*- - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - */
/*   Change &quot; to " in the title to prevent premature wrapping    */
/*- - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - */
            title   = title.replace(/&quot;/gi, '"');
            title   = title.replace(/<br>/gi, " ");
            title   = title.replace(/<sbr>/gi, " ");
            comment = new String(comment);
            comment = comment.replace(/<br>/gi, " ");
            comment = comment.replace(/<sbr>/gi, " ");

            result += "<b>" + title;
//             if (year)   result += '&nbsp;&nbsp;[' + year + ']';
            if (byline) result += ', ' + byline;
            result += "</b>";
            if (is_link_active) result += "</a>";
            if (prc_site == "local") result += " (" + href + ")";
            result += translation_links;
            if  (is_collage_link)
            {
                result += "&nbsp;<img border=0 src='_pix/is_collage_link_17x16.gif'>";
            }
            if (is_external_link)
            {
                result += "&nbsp;<img border=0 src='_pix/is_external_link_13x15.gif'>";
            }
            if (is_pdf_link)
            {
                result += "&nbsp;<img border=0 src='_pix/is_pdf_link_17x16.gif'>";
            }

/*- - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - */
/*                  Append an age flag if requested                   */
/*- - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - */
            if (age_flag == '-new')
            {
                result += "&nbsp;&nbsp;&nbsp;"
                    + "<img border=0 src='_pix/new_28x11.gif'>";
            }
            else if (age_flag == '-updated')
            {
                result += "&nbsp;&nbsp;&nbsp;"
                    + "<img border=0 src='_pix/updated_60x12.gif'>";
            }

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

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

/*- - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - */
/*                   Assemble a -table-of-contents                    */
/*- - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - */
    else if (what == '-table-of-contents')
    {
        result += "<option value='" + href + "'";

// NOTE: the disabled= attribute is ignored by IE7 and below!
        if (page == "")
        {
// x_log("\n'" + page + "' isn't up yet (\"" + 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 - depth) + ";";
        result += "<span style='";
        result += "color: #" + depth + depth + depth + depth + depth + depth + ";";
        if (depth < 2) result += " font-weight: bold;";
        if (page == prc_page && anchor == prc_anchor)
        {
// x_log("\n'" + page + "' is the page we're on (\"" + title + "\")");
            result += " background-color: #" + PRC_BG_WHEAT + ";";
        }
        else if (page == "")
        {
// x_log("\n'" + page + "' isn't up yet (\"" + 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 += "'>";

//         if (depth > 0) result += "\n";
        for (tlx = 1; tlx <= depth; tlx++)
        {
            result += "\n&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;";
        }

        result += node + "&nbsp;&nbsp;";
        result += "\n" + title;
        if (prc_site == "local") result += " (" + href + ")";
//         if (prc_site == "local" && is_collage_link)
//         {
//             result += "&nbsp;&nbsp;*";
//         }
        result += "</span></option>";
    }

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

/**********************************************************************/
/*                               E N D                                */
/**********************************************************************/
// t = true;
// f = false;
// w = 'word';
// b = '';
// ws = new String('word');
// bs = new String('');
//
// alert
// (
//     "var is type"       + "\n" +
//     "t  " + (typeof t ) + "\n" +
//     "f  " + (typeof f ) + "\n" +
//     "w  " + (typeof w ) + "\n" +
//     "b  " + (typeof b ) + "\n" +
//     "ws " + (typeof ws) + "\n" +
//     "bs " + (typeof bs) + "\n"
// );
// alert("ws instanceof String = " + (ws instanceof String));
// alert("bs instanceof String = " + (bs instanceof String));
//
// if (t) alert("if (t) is true");
// if (f) alert("if (f) is true");
// if (w) alert("if (w) is true");
// if (b) alert("if (b) is true");
// if (ws) alert("if (ws) is true");
// if (bs) alert("if (bs) is true");

// if (!t) alert("if (!t) is true");
// if (!f) alert("if (!f) is true");
// if (!w) alert("if (!w) is true");
// if (!b) alert("if (!b) is true");
// if (!ws) alert("if (!ws) is true");
// if (!bs) alert("if (!bs) is true");

