var JS_CRK = "D:\\dh\\web\\CRK\\1\\HTM\\crk.js (847 lines) 2005-03-13 12:44 Dean Hannotte";
/**********************************************************************/
/*                                                                    */
/*                Charles R. Knight Javascript Library                */
/*                ------------------------------------                */
/*                                                                    */
/*            NOTE: Functions named x_*() come from plx.js            */
/**********************************************************************/

/*--------------------------------------------------------------------*/
/*                       Constants and globals                        */
/*--------------------------------------------------------------------*/
var USED      = 0;
var NEWCOL    = 1;
var WIDTH     = 2;
var HEIGHT    = 3;
var FTYPE     = 4;
var GALLERY   = 5;
var COPYRIGHT = 6;
var FNAME     = 7;               // defaults to title without the spaces
var TITLE     = 8;          // defaults to fname without the underscores
var COLUMNS   = 9;

var crk_next_align     = new String('RIGHT'); // default initial value
var crk_next_caption   = new String('[default]');
var crk_next_copyright = new String('[default]');
var crk_next_link      = new String('[default]');

/*--------------------------------------------------------------------*/
/*                         crk_site_map array                         */
/*--------------------------------------------------------------------*/
var crk_site_map = new Array
(
// level fname                title
// ----- -------------------- ----------------------------------------------------
   0   , "index"            , "Welcome to the World of Charles R. Knight"        ,
    1  , "Biography"        , "Learn About Knight's Life"                        ,
//   2 , "Memories"         , "'Memories of my Grandfather' by Rhoda Knight Kalt",
     2 , "Alexander_Sherman", "'Beloved Muralist' by Alexander Sherman"          ,
     2 , "David_Brown"      , "'Great News for Mesa' by David Brown"             ,
     2 , "Marquetry"        , "A Rendition in Marquetry"                         ,
     2 , "Mike_O_Sullivan"  , "'Ice Age Los Angeles' by Mike O'Sullivan"         ,
     2 , "Michelle_Mills"   , "'A Brush With Life' by Michelle Mills"            ,
//  1  , "Museums"          , "Where to See Knight's Work Today"                 ,
     2 , "MesaPressRelease" , "Mesa Southwest Museum Press Release"              ,
    1  , "Gallery"          , "A Little Knight Gallery"                          ,
     2 , "Contemporary"     , "Contemporary Wildlife"                            ,
     2 , "Prehistoric"      , "Prehistoric Animals"                              ,
      3, "AMNH"             , "American Museum of Natural History"               ,
      3, "FMNH"             , "Field Museum of Natural History"                  ,
      3, "NHMLAC"           , "Natural History Museum of Los Angeles County"     ,
      3, "Early"            , "Early Prehistoric Restorations"                   ,
     2 , "Search"           , "Search Form"                                      ,
     2 , "Slides"           , "Slide Show"                                       ,
   "END"
);

/*--------------------------------------------------------------------*/
/*                         crk_pictures array                         */
/*--------------------------------------------------------------------*/
var crk_pictures = new Array
(
// used newcol width height ftype   gallery                       copyright                                              fname and title
// ---- ------ ----- ------ ------- ----------------------------- ------------------------------------------------------ ---------------
     0,     0,  368,   475, ".jpg", ""                          , ""                                                   , "", "A Dinosaur Named SUE",
     0,     0,  180,   193, ".jpg", ""                          , ""                                                   , "", "A Dinosaur Named SUE (detail)",
     0,     0,  280,   383, ".jpg", ""                          , ""                                                   , "", "Brontosaurus (Society of Illustrators)",
     0,     0,  420,   268, ".jpg", ""                          , ""                                                   , "", "American Museum of Natural History",
     0,     0,  200,   200, ".jpg", ""                          , ""                                                   , "", "Dinosaur Secrets Revealed",
     0,     0,  187,   257, ".gif", ""                          , ""                                                   , "", "Dinosaurs and Other Monsters (cover)",
     0,     0,  600,  1000, ".jpg", ""                          , ""                                                   , "", "Fatalis, by Jeff Rovin",
     0,     0,  300,   400, ".jpg", ""                          , "&copy; The Dinosaur Museum"                         , "", "Feathered Dinosaurs",
     0,     0,  319,   435, ".jpg", ""                          , "&copy; 1931 Field Museum"                           , "", "Field Museum News, March 1931",
     0,     0, 1036,   880, ".jpg", ""                          , ""                                                   , "", "Life Through the Ages (Amazon)",
     0,     0,  282,   690, ".jpg", ""                          , "Photo: Chait Galleries"                             , "Marquetry", "Cro Magnon Man - 25,000 Years Ago",
     0,     0,  282,   111, ".jpg", ""                          , "Photo: Chait Galleries"                             , "Marquetry-1", "Triceratops and Tyrannosaurus - 90,000,000 Years Ago",
     0,     0,  282,   162, ".jpg", ""                          , "Photo: Chait Galleries"                             , "Marquetry-2", "Dimetrodon and Nausaurus - 215,000,000 Years Ago",
     0,     0,  282,   163, ".jpg", ""                          , "Photo: Chait Galleries"                             , "Marquetry-3", "Stegosaurus - 125,000,000 Years Ago",
     0,     0,  282,   112, ".jpg", ""                          , "Photo: Chait Galleries"                             , "Marquetry-4", "Brontosaurus - 125,000,000 Years Ago",
     0,     0,  100,    94, ".gif", ""                          , ""                                                   , "", "Mesa Southwest Museum",
     0,     0,  189,    68, ".gif", ""                          , ""                                                   , "", "National Geographic (logo)",
     0,     0,  373,   106, ".gif", ""                          , ""                                                   , "", "NHMLAC (logo)",
     0,     0,  168,   187, ".jpg", ""                          , ""                                                   , "", "Ornithelestes Capturing Archeopteryx",
     0,     0,  366,   475, ".jpg", ""                          , ""                                                   , "", "Paleoimagery (Amazon)",
     0,     0,  111,    64, ".gif", ""                          , ""                                                   , "", "Peabody Museum",
     0,     0,  550,   648, ".jpg", ""                          , ""                                                   , "", "Ray Harryhausen, An Animated Life (Barnes and Noble)",
     0,     0,  555,   566, ".jpg", ""                          , "&copy; 1969 Field Museum (Negative GN81615_2)"      , "", "Rhoda Kalt with her daughter Melissa",
     0,     0,  640,   480, ".jpg", ""                          , "Photo: David M. Brown (Valley Publishing)"          , "", "Rhoda with Tyrannosaurus",
     0,     0,  188,   186, ".gif", ""                          , ""                                                   , "", "Science Museum of Minnesota",
     0,     0,  266,   345, ".gif", ""                          , "&copy; Rhoda Knight Kalt"                           , "", "Self-Portrait, by Charles R. Knight",
     0,     0,  296,   409, ".jpg", ""                          , ""                                                   , "", "Sketchbook III (Stout)",
     0,     0,  656,   949, ".jpg", ""                          , "Century Magazine, November 1897"                    , "", "Strange Creatures of the Past",
     0,     0,   95,   105, ".jpg", ""                          , ""                                                   , "", "Sue (front view)",
     0,     0,  150,   125, ".jpg", ""                          , "Courtesy: Page Museum"                              , "VOA_Cat"         , "The fossilized skeleton of a sabre-tooth cat",
     0,     0,  150,   150, ".jpg", ""                          , "VOA Photo - M. O'Sullivan"                          , "VOA_Mark_Hallett", "Mark Hallett",
     0,     0,  150,   150, ".jpg", ""                          , "VOA Photo - M. O'Sullivan"                          , "VOA_Pit_91"      , "Workers look for fossils in Pit 91 at the La Brea Tar Pits",
     0,     0,  150,   150, ".jpg", ""                          , "VOA Photo - M. O'Sullivan"                          , "VOA_Rhoda"       , "Rhoda Knight Kalt",
     0,     0,  150,   119, ".jpg", ""                          , "Courtesy: Page Museum"                              , "VOA_Sculptures"  , "Visitors look at the Charles R. Knight sculptures at the Page Museum",

//   0,     0,  400,   496, ".jpg", "/Knight/Contemporary"      , "&copy; Rhoda Knight Kalt"                           , "", "African Lion - Sultan",
     0,     0,  320,   400, ".jpg", "/Knight/Contemporary"      , "&copy; Rhoda Knight Kalt"                           , "", "African Lioness with Cub",
     0,     0,  327,   400, ".jpg", "/Knight/Contemporary"      , "&copy; Rhoda Knight Kalt"                           , "", "Bald Eagle",
     0,     0,  255,   400, ".jpg", "/Knight/Contemporary"      , "&copy; Rhoda Knight Kalt"                           , "", "Bald Eagle Attacking a Trumpeter Swan",
     0,     0,  400,   213, ".jpg", "/Knight/Contemporary"      , "&copy; Rhoda Knight Kalt"                           , "", "Bengal Tiger",
     0,     0,  400,   292, ".jpg", "/Knight/Contemporary"      , "&copy; Rhoda Knight Kalt"                           , "", "Bengal Tiger (Head)",
     0,     0,  888,   660, ".jpg", "/Knight/Contemporary"      , "&copy; Rhoda Knight Kalt"                           , "", "Bengal Tiger with Peacock",
     0,     0,  311,   400, ".jpg", "/Knight/Contemporary"      , "&copy; Rhoda Knight Kalt"                           , "", "Bird of Paradise",
     0,     0,  400,   273, ".jpg", "/Knight/Contemporary"      , "&copy; Rhoda Knight Kalt"                           , "", "Clouded Leopard and Pheasant",
     0,     0,  400,   261, ".jpg", "/Knight/Contemporary"      , "&copy; Rhoda Knight Kalt"                           , "", "Clouded Leopard Walking in Forest",
     0,     0,  399,   274, ".jpg", "/Knight/Contemporary"      , "&copy; Rhoda Knight Kalt"                           , "", "Golden Pheasants",
     0,     0,  400,   275, ".jpg", "/Knight/Contemporary"      , "&copy; Rhoda Knight Kalt"                           , "", "Golden Pheasants 2",
     0,     1,  289,   400, ".jpg", "/Knight/Contemporary"      , "&copy; Rhoda Knight Kalt"                           , "", "Great Pied Hornbill",
     0,     0,  321,   400, ".jpg", "/Knight/Contemporary"      , "&copy; Rhoda Knight Kalt"                           , "", "Greater Bird of Paradise",
     0,     0,  400,   299, ".jpg", "/Knight/Contemporary"      , "&copy; Rhoda Knight Kalt"                           , "", "Jaguar in Forest",
     0,     0,  400,   298, ".jpg", "/Knight/Contemporary"      , "&copy; Rhoda Knight Kalt"                           , "", "Jaguar Walking through Forest",
//   0,     0,  400,   250, ".jpg", "/Knight/Contemporary"      , "&copy; Rhoda Knight Kalt"                           , "", "Leopard Family with Flamingo",
     0,     0,  400,   331, ".jpg", "/Knight/Contemporary"      , "&copy; Rhoda Knight Kalt"                           , "", "Male Drill",
     0,     0,  459,   400, ".jpg", "/Knight/Contemporary"      , "&copy; Rhoda Knight Kalt"                           , "", "Male Mandrill",
     0,     0,  888,   496, ".jpg", "/Knight/Contemporary"      , "&copy; Rhoda Knight Kalt"                           , "", "Hunters Holding Tiger at Bay",
     0,     0,  302,   400, ".jpg", "/Knight/Contemporary"      , "&copy; Rhoda Knight Kalt"                           , "", "Mountain Lion",
     0,     0,  400,   271, ".jpg", "/Knight/Contemporary"      , "&copy; Rhoda Knight Kalt"                           , "", "Mountain Lion with Club",
     0,     0,  400,   321, ".jpg", "/Knight/Contemporary"      , "&copy; Rhoda Knight Kalt"                           , "", "North American Moose",
     0,     0,  299,   400, ".jpg", "/Knight/Contemporary"      , "&copy; Rhoda Knight Kalt"                           , "", "The Lynx",

     0,     0,  600,   474, ".jpg", "/Knight/Prehistoric"       , "&copy; Rhoda Knight Kalt"                           , "", "Allosaurus, from 'Life Through the Ages'",
     0,     0,  400,   262, ".jpg", "/Knight/Prehistoric"       , "&copy; Rhoda Knight Kalt"                           , "", "Archelon (Giant Sea Turtle)",
     0,     0,  600,   472, ".jpg", "/Knight/Prehistoric"       , "&copy; Rhoda Knight Kalt"                           , "", "Brontosaurus, from 'Life Through the Ages'",
     0,     0,  400,   142, ".jpg", "/Knight/Prehistoric"       , "&copy; Rhoda Knight Kalt"                           , "", "Brontotherium, Toxodon and Horses",
     0,     0,  400,   158, ".jpg", "/Knight/Prehistoric"       , "&copy; Rhoda Knight Kalt"                           , "", "Carcharadon and Rays",
     0,     0,  400,   252, ".jpg", "/Knight/Prehistoric"       , "&copy; Rhoda Knight Kalt"                           , "", "Carcharadon with Rays",
     0,     0,  600,   479, ".jpg", "/Knight/Prehistoric"       , "&copy; Rhoda Knight Kalt"                           , "", "Cats, from 'Life Through the Ages'",
     0,     0,  400,   144, ".jpg", "/Knight/Prehistoric"       , "&copy; Rhoda Knight Kalt"                           , "", "Coelodanta - Woolly Rhinoceras in Snow, Pleistocene Period",
     0,     0,  400,   434, ".jpg", "/Knight/Prehistoric"       , "&copy; Rhoda Knight Kalt"                           , "", "Early Man Fighting Prehistoric Cave Bear",
     0,     0,  295,   400, ".jpg", "/Knight/Prehistoric"       , "&copy; Rhoda Knight Kalt"                           , "", "Early Man",
     0,     0,  400,   326, ".jpg", "/Knight/Prehistoric"       , "&copy; Rhoda Knight Kalt"                           , "", "Giant Moas - New Zealand Landscape",
     0,     0,  400,   314, ".jpg", "/Knight/Prehistoric"       , "&copy; Rhoda Knight Kalt"                           , "", "Glyptodon with Giant Beavers",
     0,     0,  400,   223, ".jpg", "/Knight/Prehistoric"       , "&copy; Rhoda Knight Kalt"                           , "", "Glyptodon, Camels and South American Pampean Mammals",
     0,     0,  400,   143, ".jpg", "/Knight/Prehistoric"       , "&copy; Mesa Southwest Museum"                       , "", "Glyptodon, Horses and Mastodon",
     0,     0,  400,   354, ".jpg", "/Knight/Prehistoric"       , "&copy; Rhoda Knight Kalt"                           , "", "Great Irish Elk",
     0,     0,  400,   243, ".jpg", "/Knight/Prehistoric"       , "&copy; Rhoda Knight Kalt"                           , "", "Grizzly Bear with Salmon",
     0,     0,  400,   276, ".jpg", "/Knight/Prehistoric"       , "&copy; Rhoda Knight Kalt"                           , "", "Horses, Toxodon and Proboscidean Mastodon",
     0,     1,  400,   432, ".jpg", "/Knight/Prehistoric"       , "&copy; Rhoda Knight Kalt"                           , "", "Hunter Returns",
     0,     0,  400,   144, ".jpg", "/Knight/Prehistoric"       , "&copy; Rhoda Knight Kalt"                           , "", "Megatherium, Glyptodon and Camels, Pleistocene Period",
     0,     0,  190,   400, ".jpg", "/Knight/Prehistoric"       , "&copy; Rhoda Knight Kalt"                           , "", "Miocene Deer and Elephant Family",
     0,     0,  191,   400, ".jpg", "/Knight/Prehistoric"       , "&copy; Rhoda Knight Kalt"                           , "", "Miocene Horse",
     0,     0,  400,   428, ".jpg", "/Knight/Prehistoric"       , "&copy; Rhoda Knight Kalt"                           , "", "Neanderthal Man Defending Family Against Wolves",
     0,     0,  400,   312, ".jpg", "/Knight/Prehistoric"       , "&copy; Rhoda Knight Kalt"                           , "", "Plesiosaur and Pteradactyls",
     0,     0,  400,   148, ".jpg", "/Knight/Prehistoric"       , "&copy; George C. Page Museum"                       , "", "Rancho La Brea Tar Pit - California",
     0,     0,  400,   156, ".jpg", "/Knight/Prehistoric"       , "&copy; Rhoda Knight Kalt"                           , "", "Rhinoceros, Camels and Horses, Miocene Period",
     0,     0,  336,   400, ".jpg", "/Knight/Prehistoric"       , "&copy; Rhoda Knight Kalt"                           , "", "Smilodon with Megatherium",
     0,     0,  400,   306, ".jpg", "/Knight/Prehistoric"       , "&copy; Rhoda Knight Kalt"                           , "", "Two Grizzly Bears Fighting",
     0,     0,  600,   472, ".jpg", "/Knight/Prehistoric"       , "&copy; Rhoda Knight Kalt"                           , "", "Tyrannosaurus, from 'Life Through the Ages'",
     0,     0,  400,   198, ".jpg", "/Knight/Prehistoric"       , "&copy; Rhoda Knight Kalt"                           , "", "Uintatherium, Toxodon and Hyracotherium",
     0,     0,  266,   400, ".jpg", "/Knight/Prehistoric"       , "&copy; Rhoda Knight Kalt"                           , "", "Vikings Sailing Into Sunset",
     0,     0,  400,   142, ".jpg", "/Knight/Prehistoric"       , "&copy; Rhoda Knight Kalt"                           , "", "Woolly Mammoths Walking in Snow",
     0,     0,  400,   310, ".jpg", "/Knight/Prehistoric"       , "&copy; Rhoda Knight Kalt"                           , "", "Woolly Mammoths",
     0,     0,  296,   400, ".jpg", "/Knight/Prehistoric"       , "&copy; Rhoda Knight Kalt"                           , "", "Woolly Rhinoceros Tossing Caveman into Air",

     0,     0,  823,   575, ".jpg", "/Knight/Prehistoric/AMNH"  , "&copy; American Museum (Negative 2419)"             , "", "Agathaumus",
     0,     0,  824,   541, ".jpg", "/Knight/Prehistoric/AMNH"  , "&copy; American Museum (Negative 2417)"             , "", "Brontosaur",
     0,     0,  823,   541, ".jpg", "/Knight/Prehistoric/AMNH"  , "&copy; American Museum (Negative 1776)"             , "", "Dimetrodon and Edaphosaurus",
     0,     0,  749,   518, ".jpg", "/Knight/Prehistoric/AMNH"  , "&copy; American Museum of Natural History"          , "", "Leaping Laelops",
     0,     0,  824,   490, ".jpg", "/Knight/Prehistoric/AMNH"  , "&copy; American Museum (Negative 2435)"             , "", "Smilodon",
     0,     0,  749,   565, ".jpg", "/Knight/Prehistoric/AMNH"  , "&copy; American Museum (Negative 1774)"             , "", "Trachodon",
     0,     0,  823,   559, ".jpg", "/Knight/Prehistoric/AMNH"  , "&copy; American Museum (Negative 2425)"             , "", "Tylosaurus",

// These 3 images were superseded by the next 28 on 5/4/2004:
//   0,     0,  920,   312, ".jpg", "/Knight/Prehistoric/FMNH1" , "&copy; Field Museum (Negative CK5T)"                , "", "Brontosaur and Crocodilians",
//   0,     0,  888,   300, ".jpg", "/Knight/Prehistoric/FMNH1" , "&copy; Field Museum (Negative CK13_1T)"             , "", "Trachodon, Parasaurolophus",
//   0,     0,  917,   313, ".jpg", "/Knight/Prehistoric/FMNH1" , "&copy; Field Museum (Negative CK9T)"                , "", "Triceratops and Tyrannosaur",

     0,     0,  804,   276, ".jpg", "/Knight/Prehistoric/FMNH"  , "&copy; Field Museum (Negative CK23T)"               , "CK23T",   "Nearly two billion years ago. Volcanic activity was widespread, but the surface of the earth had cooled enough so that oceans could form. In this scene, life has not yet begun.", // The World Before Life
     0,     0,  514,   407, ".jpg", "/Knight/Prehistoric/FMNH"  , "&copy; Field Museum (Negative CK23AT)"              , "CK23AT",  "Earliest records of earth life. Proterozoic era deposited sediments one and one half billion years ago. Fossils are believed to be lime secretions of minute single celled plants, similar to some of the algae that live in hot springs today. Precambrian time.",
     0,     0,  514,   369, ".jpg", "/Knight/Prehistoric/FMNH"  , "&copy; Field Museum (Negative CK23BT)"              , "CK23BT",  "Ordovician Sea Life. 500 to 440 million years ago. Shows beached seaweeds, trilobites and cephalopods from the ocean. Paleozoic era.",
     0,     0,  489,   386, ".jpg", "/Knight/Prehistoric/FMNH"  , "&copy; Field Museum (Negative CK50T)"               , "CK50T",   "Corals once flourished where Chicago now stands. Large reefs existed here in the Mid-Silurian time, 365 million years ago. Paleozoic era. Photographer: Ron Testa, 1980.",
     0,     0,  804,   266, ".jpg", "/Knight/Prehistoric/FMNH"  , "&copy; Field Museum (Negative CK49T)"               , "CK49T",   "Devonian Forest. Plants had covered the land by the middle of the Paleozoic era, 320 million years ago.",
     0,     0,  804,   277, ".jpg", "/Knight/Prehistoric/FMNH"  , "&copy; Field Museum (Negative CK45T)"               , "CK45T",   "Three variant types of pelycosaur of the Permian period of Texas. Carnivorous fin-back Dimetrodon, plant-eating Edaphosaurus, and lizard-shaped Casea. Paleozoic era.",
     0,     0,  617,   455, ".jpg", "/Knight/Prehistoric/FMNH"  , "&copy; Field Museum (Negative CK22T)"               , "CK22T",   "Mammal-like reptiles. Carnivorous Cynognathus and Kannemeyeria. Karroo beds of South Africa's Triassic period; Mesozoic era.",
     0,     0,  804,   283, ".jpg", "/Knight/Prehistoric/FMNH"  , "&copy; Field Museum (Negative CK5T)"                , "CK5T",    "Apatosaurus (Brontosaurus), end of Jurassic, Mesozoic era. At the time Knight painted this mural, the skull of Apatosaurus was not known and the head was restored based on the skull of the Camarasaurus, another sauropod dinosaur.",
     0,     0,  514,   350, ".jpg", "/Knight/Prehistoric/FMNH"  , "&copy; Field Museum (Negative CK31T)"               , "CK31T",   "Jurassic dinosaur Stegosaurus.",
     0,     0,  514,   411, ".jpg", "/Knight/Prehistoric/FMNH"  , "&copy; Field Museum (Negative CK39T)"               , "CK39T",   "Archaeopteryx, Compsognathus and Rhamphorhynchus. Germany, Mesozoic, Lower Jurassic era.",
     0,     0,  804,   265, ".jpg", "/Knight/Prehistoric/FMNH"  , "&copy; Field Museum (Negative CK341T)"              , "CK341T",  "Plesiosaurus and Stenopterygius (fish shaped ichthyosaur). Mesozoic, Jurassic era.",
     0,     0,  514,   400, ".jpg", "/Knight/Prehistoric/FMNH"  , "&copy; Field Museum (Negative CK10T)"               , "CK10T",   "Protoceratops, Mesozoic era. Primitive ceratopsian dinosaur with its eggs, found in the Gobi desert of Mongolia, 1922.",
     0,     0,  516,   217, ".jpg", "/Knight/Prehistoric/FMNH"  , "&copy; Field Museum (Negative CK13AT)"              , "CK13AT",  "Late Cretaceous Dinosaurs, Mesozoic era. Helmet-crested Corythosaurus, submerged in water, a herd of long-crested Parasaurolophus, heavily armored Palaeoscincus, based on a specimen of Panoplosaurus, ostrichlike Struthiomimus, and flat-headed hadrosaur Edmontosaurus.",
     0,     0,  804,   277, ".jpe", "/Knight/Prehistoric/FMNH"  , "&copy; Field Museum (Negative CK9T)"                , "CK9T",    "Tyrannosaurus and Triceratops. This is unequivocally Knight's most influential work, the classic confrontation between the horned dinosaur Triceratops and its deadly adversary Tyrannosaurus. Mesozoic era.",
     0,     0,  804,   279, ".jpg", "/Knight/Prehistoric/FMNH"  , "&copy; Field Museum (Negative CK24_1T)"             , "CK24_1T", "Late or Upper Cretaceous Seas, Mesozoic era. Marine reptile Tylosaur; giant turtle Protostega, flying reptile Pteranodon.",
     0,     0,  500,   398, ".jpg", "/Knight/Prehistoric/FMNH"  , "&copy; Field Museum (Negative CK26T)"               , "CK26T",   "Whales of the Eocene Seas. Basilosaurus (Zeuglodon).",
     0,     0,  514,   407, ".jpg", "/Knight/Prehistoric/FMNH"  , "&copy; Field Museum (Negative CK46T)"               , "CK46T",   "Small four-toed horses of the genus Orohippus, and Uintatherium. Eocene.",
     0,     0,  804,   260, ".jpg", "/Knight/Prehistoric/FMNH"  , "&copy; Field Museum (Negative CK12T)"               , "CK12T",   "Oligocene Titanotheres. A team of flesh-eating Hyaenodon hope to bring down a Brontotherium. Also shown is the tortoise (turtle) Stylemys. Cenozoic era.",
     0,     0,  804,   265, ".jpg", "/Knight/Prehistoric/FMNH"  , "&copy; Field Museum (Negative CK41T)"               , "CK41T",   "An Early Pliocene panorama. Showing the swamp-dwelling rhinoceros Teleoceras, the mastodont Gomphotherium, and the pig-like oreodont Ustatochoetus. Cenozoic era.",
     0,     0,  624,   225, ".jpg", "/Knight/Prehistoric/FMNH"  , "&copy; Field Museum (Negative CK19TA)"              , "CK19TA",  "Miocene Plains Mammals, Cenozoic era. Long-necked camel Oxydactylus; two-horned rhinoceros Menoceras; three-toed horse Parahippus; giant pig Dinohyus; mammal with claws, Moropus.",
     0,     0,  500,   389, ".jpg", "/Knight/Prehistoric/FMNH"  , "&copy; Field Museum (Negative CK27T)"               , "CK27T",   "Giant Kangaroos and Wombats. Palorchestes and Diprotodon. Marsupials predominated in isolated Queensland Australia throughout the Cenozoic. Late Pleistocene time, 100,000 years ago.",
     0,     0,  804,   390, ".jpg", "/Knight/Prehistoric/FMNH"  , "&copy; Field Museum (Negative CK8T)"                , "CK8T",    "Rancho La Brea Tar Pools, Cenozoic era. A Pleistocene panorama set at a pitch pool in California. Shown: large bird Teratornis, saber-tooth cat Smilodon, and an extinct species of horse.",
     0,     0,  633,   290, ".jpg", "/Knight/Prehistoric/FMNH"  , "&copy; Field Museum (Negative CK21T)"               , "CK21T",   "Nearly elephant-sized Great Ground Sloth (left panel). Also Megatherium, and two types of armadillo-like animals, spike-tailed Doedicurus and Glyptodon.",
     0,     0,  613,   456, ".jpg", "/Knight/Prehistoric/FMNH"  , "&copy; Field Museum (Negative CK20T)"               , "CK20T",   "Nearly elephant-sized Great Ground Sloth (right panel). Also Megatherium, and two types of armadillo-like animals, spike-tailed Doedicurus and Glyptodon.",
     0,     0,  802,   284, ".jpe", "/Knight/Prehistoric/FMNH"  , "&copy; Field Museum (Negative CK30T)"               , "CK30T",   "Woolly Mammoths and Rhinoceros, Cenozoic era. Europe in Late Pleistocene time, 100,000 years ago.",
     0,     0,  620,   442, ".jpg", "/Knight/Prehistoric/FMNH"  , "&copy; Field Museum (Negative CK29T)"               , "CK29T",   "American Mastodons, Cenozoic era.",
     0,     0,  588,   455, ".jpg", "/Knight/Prehistoric/FMNH"  , "&copy; Field Museum (Negative CK32T)"               , "CK32T",   "Restoration of the great extinct bird, Dinornis. Also Giant Moas, Cenozoic era.",
     0,     0,  514,   351, ".jpg", "/Knight/Prehistoric/FMNH"  , "&copy; Field Museum (Negative CK1T)"                , "CK1T",    "Irish Deer, Megaloceros, Cenozoic era.",
     0,     0,  493,   396, ".jpg", "/Knight/Prehistoric/FMNH"  , "&copy; Field Museum (Negative CK28T)"               , "CK28T",   "Cave Bear, Cenozoic era.",

     0,     0,  616,   931, ".jpg", "/Knight/Prehistoric/NGS"   , "&copy; 1942 National Geographic Society"            , "ngs01", "Earliest Life - Spineless Underwater Creatures of 500,000,000 Years Ago",
     0,     0,  931,   616, ".jpg", "/Knight/Prehistoric/NGS"   , "&copy; 1942 National Geographic Society"            , "ngs02", "Fantastic Scorpionlike Eurypterids, Some Eight Feet Long, Spent Most of Their Time Half Buried in Mud",
     0,     0,  931,   616, ".jpg", "/Knight/Prehistoric/NGS"   , "&copy; 1942 National Geographic Society"            , "ngs03", "With Its Powerful Jaws, the Armored Dinichthys (Terrible Fish) Crushed Luckless Prey",
     0,     0,  616,   931, ".jpg", "/Knight/Prehistoric/NGS"   , "&copy; 1942 National Geographic Society"            , "ngs04", "Ungainly Eryops Lived in Slimy Pools When Earth's Coal Beds Were Forming",
     0,     0,  616,   931, ".jpg", "/Knight/Prehistoric/NGS"   , "&copy; 1942 National Geographic Society"            , "ngs05", "Why the Dimetrodon Carried a Sail-like Crest Is Still a Puzzle To Science",
     0,     0,  931,   616, ".jpg", "/Knight/Prehistoric/NGS"   , "&copy; 1942 National Geographic Society"            , "ngs06", "Harmless and Stupid, the Grotesque Diplodocus Asked Only to Be Left in Peace",
     0,     0,  931,   616, ".jpg", "/Knight/Prehistoric/NGS"   , "&copy; 1942 National Geographic Society"            , "ngs07", "Plate Armor of the Roofed Lizard Protected It from the Sparp Teeth of a Flesh-eating Assailant",
     0,     0,  616,   931, ".jpg", "/Knight/Prehistoric/NGS"   , "&copy; 1942 National Geographic Society"            , "ngs08", "Two of Nature's First Attempts in Aviation",
     0,     0,  616,   931, ".jpg", "/Knight/Prehistoric/NGS"   , "&copy; 1942 National Geographic Society"            , "ngs09", "King-tyrant Lizards, Most Terrible of the Dinosaurs, Lock in Mortal Combat",
     0,     0,  931,   616, ".jpg", "/Knight/Prehistoric/NGS"   , "&copy; 1942 National Geographic Society"            , "ngs10", "Egg-laying Dinosaurs of Mongolia Grew Broad, Bony Collars to Save Their Own Necks",
     0,     0,  931,   616, ".jpg", "/Knight/Prehistoric/NGS"   , "&copy; 1942 National Geographic Society"            , "ngs11", "Six Feet of Head, Horns, Spines, and Collar Look Ferocious, But on the Mild-mannered Crowned Lizard It Was All Bluff",
     0,     0,  616,   931, ".jpg", "/Knight/Prehistoric/NGS"   , "&copy; 1942 National Geographic Society"            , "ngs12", "Mosasaurus Ruled the Waves When They Rolled Over Western Kansas",
     0,     0,  616,   931, ".jpg", "/Knight/Prehistoric/NGS"   , "&copy; 1942 National Geographic Society"            , "ngs13", "Time Marches On - Huge Warm-blooded Mammals Replace the Vanishing Dinosaurs",
     0,     1,  931,   616, ".jpg", "/Knight/Prehistoric/NGS"   , "&copy; 1942 National Geographic Society"            , "ngs14", "Long Before the Pyramids Were Built, Mighty Arsinotherium Fought Prehistoric Hyaenodons in Egypt",
     0,     0,  931,   616, ".jpg", "/Knight/Prehistoric/NGS"   , "&copy; 1942 National Geographic Society"            , "ngs15", "Titanotherium, Last of the Horny-Headed Giants, Once Roamed North America Like the Buffalo",
     0,     0,  616,   931, ".jpg", "/Knight/Prehistoric/NGS"   , "&copy; 1942 National Geographic Society"            , "ngs16", "Prehistoric Denizons of South America",
     0,     0,  616,   931, ".jpg", "/Knight/Prehistoric/NGS"   , "&copy; 1942 National Geographic Society"            , "ngs17", "No Match for the Sabre-toothed Tiger Was the Stupid Giant Ground Sloth",
     0,     0,  616,   931, ".jpg", "/Knight/Prehistoric/NGS"   , "&copy; 1942 National Geographic Society"            , "ngs18", "When the Age of Man Began, the Mastodon Still Inhabited the United States",
     0,     0,  616,   931, ".jpg", "/Knight/Prehistoric/NGS"   , "&copy; 1942 National Geographic Society"            , "ngs19", "Close Relative of Modern Elephants is the Woolly Mammoth",
     0,     0,  931,   616, ".jpg", "/Knight/Prehistoric/NGS"   , "&copy; 1942 National Geographic Society"            , "ngs20", "Early Man May Have Annihilated the Moas, Huge Flightless Birds of New Zealand",
     0,     0,  931,   616, ".jpg", "/Knight/Prehistoric/NGS"   , "&copy; 1942 National Geographic Society"            , "ngs21", "Early American Hunters, Folsom Men, Attack a Giant Bison with Darts and Arrows",
     0,     0,  616,   931, ".jpg", "/Knight/Prehistoric/NGS"   , "&copy; 1942 National Geographic Society"            , "ngs22", "With Flint-tipped Spear, Stone Ax, and Rocks, Neanderthal Men Repel an Invader",
     0,     0,  616,   931, ".jpg", "/Knight/Prehistoric/NGS"   , "&copy; 1942 National Geographic Society"            , "ngs23", "Ten Thousand Years Ago, Cro-Magnon Men Drew Pictures on the Walls of Their Caves",
     0,     0,  616,   931, ".jpg", "/Knight/Prehistoric/NGS"   , "&copy; 1942 National Geographic Society"            , "ngs24", "Lake Dwellers of the Early Bronze Age Relentlessly Pursue an Irish Elk",

     0,     0,  771,   596, ".jpg", "/Knight/Prehistoric/NHMLAC", "&copy; Natural History Museum of Los Angeles County", "", "Archeopteryx",
     0,     0,  823,   606, ".jpg", "/Knight/Prehistoric/NHMLAC", "&copy; Natural History Museum of Los Angeles County", "", "Brontosaurus",
     0,     0,  801,   601, ".jpg", "/Knight/Prehistoric/NHMLAC", "&copy; Natural History Museum of Los Angeles County", "", "Dimetrodon",
     0,     0,  801,   603, ".jpg", "/Knight/Prehistoric/NHMLAC", "&copy; Natural History Museum of Los Angeles County", "", "Pteranodon",
//
// Entries in the Early gallery that are commented out
// are already represented in color in other galleries:
//
     0,     0,  517,   279, ".jpg", "/Knight/Prehistoric/Early" , ""                                                   , "", "Allosaurus Feeding",
     0,     0,  676,   388, ".jpg", "/Knight/Prehistoric/Early" , ""                                                   , "", "Allosaurus Feeding (study)",
     0,     0,  288,   348, ".jpg", "/Knight/Prehistoric/Early" , ""                                                   , "", "Baluchitherium",
//   0,     0,  524,   350, ".jpg", "/Knight/Prehistoric/Early" , ""                                                   , "", "Brontosaurus",
     0,     0,  421,   334, ".jpg", "/Knight/Prehistoric/Early" , ""                                                   , "", "Crovalces",
//   0,     0,  517,   341, ".jpg", "/Knight/Prehistoric/Early" , ""                                                   , "", "Deinonychus",
//   0,     0,  498,   360, ".jpg", "/Knight/Prehistoric/Early" , ""                                                   , "", "Dimetrodon",
     0,     0,  431,   655, ".jpg", "/Knight/Prehistoric/Early" , ""                                                   , "", "Diplodocus (standing)",
     0,     0,  696,   392, ".jpg", "/Knight/Prehistoric/Early" , ""                                                   , "", "Diplodocus (walking)",
     0,     0,  496,   336, ".jpg", "/Knight/Prehistoric/Early" , ""                                                   , "", "Elasmosaurus",
     0,     0,  431,   360, ".jpg", "/Knight/Prehistoric/Early" , ""                                                   , "", "Eohippus",
     0,     0,  594,   372, ".jpg", "/Knight/Prehistoric/Early" , ""                                                   , "", "Hadrosaurus (front view)",
//   0,     0,  520,   341, ".jpg", "/Knight/Prehistoric/Early" , ""                                                   , "", "Hadrosaurus (side view)",
     0,     0,  477,   663, ".jpg", "/Knight/Prehistoric/Early" , ""                                                   , "", "Icthyosaur",
     0,     0,  430,   323, ".jpg", "/Knight/Prehistoric/Early" , ""                                                   , "", "Megaceras",
//   0,     0,  685,   449, ".jpg", "/Knight/Prehistoric/Early" , ""                                                   , "", "Mosasaur",
     0,     0,  258,   352, ".jpg", "/Knight/Prehistoric/Early" , ""                                                   , "", "Phororhacos",
//   0,     0,  416,   224, ".jpg", "/Knight/Prehistoric/Early" , ""                                                   , "", "Sabretooth Tiger",
     0,     0,  526,   350, ".jpg", "/Knight/Prehistoric/Early" , ""                                                   , "", "Stegosaurus",
     0,     0,  509,   331, ".jpg", "/Knight/Prehistoric/Early" , ""                                                   , "", "Triceratops",
     0,     0,  430,   297, ".jpg", "/Knight/Prehistoric/Early" , ""                                                   , "", "Tricophodon",
     0,     0,  515,   237, ".gif", "/Knight/Prehistoric/Early" , ""                                                   , "", "Tyrannosaurus",
     0,     0,  430,   360, ".jpg", "/Knight/Prehistoric/Early" , ""                                                   , "", "Uintatherium",
     0,     0,  431,   311, ".jpg", "/Knight/Prehistoric/Early" , ""                                                   , "", "Woolly Rhinoceros"
);
var ROWS = crk_pictures.length / COLUMNS;

x_log("\n\nJS_CRK = '" + JS_CRK + "'.");
x_log_exp('ROWS', ROWS);

/*--------------------------------------------------------------------*/
/*                        CrkFname() function                         */
/*--------------------------------------------------------------------*/
function CrkFname(a_rx)
{
//  x_log("\n\nCrkFname('" + a_rx + "');");
    var result = crk_pictures[(rx * COLUMNS) + FNAME];
    if (result == '')
    {
        var result = crk_pictures[(rx * COLUMNS) + TITLE];
        result = new String(result.replace(/ /g , '_'));
        result = new String(result.replace(/\n/g, ' '));
    }
    return result;
}

/*--------------------------------------------------------------------*/
/*                       CrkGallery() function                        */
/*                                                                    */
/*    This function serves three purposes. If a_arg2 is '-count',     */
/*    it returns the number of images in the gallery specified.       */
/*                                                                    */
/*    If a_arg2 is '-list', it returns a list of titles of that       */
/*    gallery's images.                                               */
/*                                                                    */
/*    Otherwise, it returns HTML for displaying the entire gallery.   */
/*    In that case, a_arg2 can specify a maximum effective width.     */
/*                                                                    */
/*--------------------------------------------------------------------*/
function CrkGallery(a_gallery, a_arg2)
{
    x_log("\n\nCrkGallery('" + a_gallery + "', '" + a_arg2 + "');");

    var gallery = new String('');
    if (typeof a_gallery != 'undefined') gallery = new String(a_gallery);
    x_log_exp('gallery', gallery);

    var regex = new RegExp('');
    if (gallery) regex = new RegExp(gallery);
    x_log_exp('regex.source', regex.source);

    var result = new String();

    if (a_arg2 == '-count')
    {
        var result = 0;
        for (rx = 0; rx < ROWS; rx++)
        {
            if (regex.test(crk_pictures[(rx * COLUMNS) + GALLERY]))
            {
                result++;
            }
        }
    }
    else if (a_arg2 == '-list')
    {
        var num_images = 0;
        for (rx = 0; rx < ROWS; rx++)
        {
            if (regex.test(crk_pictures[(rx * COLUMNS) + GALLERY]))
            {
                num_images++;
                var title = new String(CrkTitle(rx));
// FMNH has multi-sentence captions.
// Use only the first sentence and lose the period.
                title = title.replace(/\..*/, '');
                result += title + '; ';
            }
        }
        result = result.substr(0, result.length - 2)
            + '. (' + num_images + ' images)';
    }
    else
    {
// cellspacing=0 keeps the border 1-line, not 2
        var max_eff_width = a_arg2;
        var pictures = new String();
        for (rx = 0; rx < ROWS; rx++)
        {
            if (regex.test(crk_pictures[(rx * COLUMNS) + GALLERY]))
            {
                if (crk_pictures[(rx * COLUMNS) + NEWCOL]
                &&  x_wide_screen())
                {
                    pictures += "</TD><TD VALIGN='TOP'>";
                }
                pictures += CrkPicture(rx, 'CENTER', max_eff_width);
            }
        }
        result += new String("<DIV ALIGN='CENTER'>"
            + "<TABLE BORDER='0' BORDERCOLOR='ORANGE' "
            + "CELLSPACING='0' CELLPADDING='7'>"
            + "<TR ALIGN='CENTER'><TD VALIGN='TOP'>"
            + pictures
            + '</TD></TR></TABLE></DIV>');
    }
    return result;
}

/*--------------------------------------------------------------------*/
/*                        CrkGoNext() function                        */
/*--------------------------------------------------------------------*/
function CrkGoNext(a_url)
{
    x_log("\n\nCrkGoNext('" + a_url + "');");
    var url = new String(a_url + ".htm");
//    var url = eval(a_url);
//    x_log_exp('url', url);
//alert("CrkGoNext('" + url + "');");
    window.location = url;
}

/*--------------------------------------------------------------------*/
/*                      CrkLanguages() function                       */
/*--------------------------------------------------------------------*/
function CrkLanguages()
{
    x_log("\n\nCrkLanguages();");
    var crktexts  = new Array('English', 'Chinese', 'French', 'German',
        'Italian', 'Japanese', 'Korean', 'Portuguese', 'Spanish');

    var crkvalues = new Array('', 'zh', 'fr',
        'de', 'it', 'ja', 'ko', 'pt', 'es');

    var lp_value = '';
    if  (typeof document.forms.CrkTranslationForm    == 'object'
    &&   typeof document.forms.CrkTranslationForm.lp == 'object')
    {
        lp_value = document.forms.CrkTranslationForm.lp.value;
    }

    var result = new String();
    for (vx = 0; vx < crkvalues.length; vx++)
    {
        this_value = crkvalues[vx];
        if (this_value != '') this_value = 'en_' + this_value;
        result = "<OPTION VALUE='" + this_value + "'";
        if (this_value == lp_value)
        {
            result += " SELECTED";
        }
        result += "> &nbsp; " + crktexts[vx] + " &nbsp; </OPTION>";
        document.write(result);
    }
}

/*--------------------------------------------------------------------*/
/*                      CrkNextAlign() function                       */
/*--------------------------------------------------------------------*/
function CrkNextAlign(a_next_align)
{
    x_log("\n\nCrkNextAlign('" + a_next_align + "');");
    crk_next_align = a_next_align;
}

/*--------------------------------------------------------------------*/
/*                     CrkNextCaption() function                      */
/*--------------------------------------------------------------------*/
function CrkNextCaption(a_next_caption)
{
    x_log("\n\nCrkNextCaption('" + a_next_caption + "');");
    crk_next_caption = a_next_caption;
}

/*--------------------------------------------------------------------*/
/*                    CrkNextCopyright() function                     */
/*--------------------------------------------------------------------*/
function CrkNextCopyright(a_next_copyright)
{
    x_log("\n\nCrkNextCopyright('" + a_next_copyright + "');");
    crk_next_copyright = a_next_copyright;
}

/*--------------------------------------------------------------------*/
/*                       CrkNextLink() function                       */
/*--------------------------------------------------------------------*/
function CrkNextLink(a_next_link)
{
    x_log("\n\nCrkNextLink('" + a_next_link + "');");
    crk_next_link = a_next_link;
}

/*--------------------------------------------------------------------*/
/*                     CrkPictureIndex() function                     */
/*--------------------------------------------------------------------*/
function CrkPictureIndex(a_id)
{
// a_id can be an index, an fname or a title
    x_log("\n\nCrkPictureIndex('" + a_id + "');");
    if (typeof a_id == 'number')
    {
        rx = a_id;
    }
    else
    {
        for (rx = 0; rx < ROWS; rx++)
        {
            if (a_id == CrkFname(rx)) break;
            if (a_id == CrkTitle(rx)) break;
        }
        if (rx >= ROWS)
        {
            rx = a_id; // The '23' in Early.htm?23 is a 'string'!
//             x_log("\nCan't find '" + a_id + "' in my table!");
//             return "<P><B>CrkPictureIndex(): Invalid rx or title: '<I>"
//                 + a_id + "</I>'.</B></P>";
        }
    }
    x_log("\n... returning " + rx + ".");
    return rx;
}

/*--------------------------------------------------------------------*/
/*                       CrkPicture() function                        */
/*--------------------------------------------------------------------*/
function CrkPicture(a_id, a_align, a_max_eff_width, a_max_eff_height)
{
    x_log("\n\nCrkPicture('" + a_id + "', '" + a_align + "', '" + a_max_eff_width + "', '" + a_max_eff_height + "');");
    x_log_exp('crk_next_align'    , crk_next_align);
    x_log_exp('crk_next_caption'  , crk_next_caption);
    x_log_exp('crk_next_copyright', crk_next_copyright);
    x_log_exp('crk_next_link'     , crk_next_link);

    rx = CrkPictureIndex(a_id);
    x_log_exp('rx', rx);

                    crk_pictures[(rx * COLUMNS) + USED     ] = 1;
    var used      = crk_pictures[(rx * COLUMNS) + USED     ];
    var newcol    = crk_pictures[(rx * COLUMNS) + NEWCOL   ];
    var width     = crk_pictures[(rx * COLUMNS) + WIDTH    ];
    var height    = crk_pictures[(rx * COLUMNS) + HEIGHT   ];
    var ftype     = crk_pictures[(rx * COLUMNS) + FTYPE    ];
    var gallery   = crk_pictures[(rx * COLUMNS) + GALLERY  ];
//  var fname     = crk_pictures[(rx * COLUMNS) + FNAME    ];
//  var title     = crk_pictures[(rx * COLUMNS) + TITLE    ];
    var copyright = crk_pictures[(rx * COLUMNS) + COPYRIGHT];

    fname = CrkFname(rx);
    title = CrkTitle(rx);

    x_log_exp('used'     , used     );
    x_log_exp('newcol'   , newcol   );
    x_log_exp('width'    , width    );
    x_log_exp('height'   , height   );
    x_log_exp('ftype'    , ftype    );
    x_log_exp('gallery'  , gallery  );
    x_log_exp('fname'    , fname    );
    x_log_exp('title'    , title    );
    x_log_exp('copyright', copyright);


    var align     = new String(crk_next_align);
    var alt       = new String(crk_next_caption);
    var border    = 0;
    var caption   = new String(crk_next_caption);
    var clickhelp = new String('');
    var link      = new String(crk_next_link);

// Copyright can be overridden:
    if (crk_next_copyright != '[default]') copyright = crk_next_copyright;

//
// The title may have newlines to indicate where the lines should break.
// These should be replaced with blanks in the filespec.
//
// All blanks in the title are replaced by underscores in the filespec
// so that saved graphics will not contain '%20' sequences.
//
    var filespec = new String("Gallery" + gallery + "/" + fname + ftype);
    x_log_exp('filespec', filespec);

// Default alignment is to switch from right to left and back:
    if (typeof a_align != 'undefined' && a_align != '') align = a_align;
    if (align == 'RIGHT') crk_next_align = 'LEFT';
    else crk_next_align = 'RIGHT';

// Derive effective width and effective height:
    var effective_width = width;
    var width_shrinkage = 1.0;
    if (typeof a_max_eff_width == 'number')
    {
        if (a_max_eff_width < width)
        {
            width_shrinkage = a_max_eff_width / width;
            x_log_exp('width_shrinkage', width_shrinkage);
        }
    }

    var effective_height = height;
    var height_shrinkage = 1.0;
    if (typeof a_max_eff_height == 'number')
    {
        if (a_max_eff_height < height)
        {
            height_shrinkage = a_max_eff_height / height;
            x_log_exp('height_shrinkage', height_shrinkage);
        }
    }

// If shrinking, use maximum effective dimensions. Also,
// if link not already set, link to the enlargement:
    if (width_shrinkage < 1.0 || height_shrinkage < 1.0)
    {
        if (width_shrinkage  < height_shrinkage) shrinkage = width_shrinkage;
        if (height_shrinkage <= width_shrinkage) shrinkage = height_shrinkage;
        x_log_exp('shrinkage', shrinkage);
        effective_width  = Math.floor(width  * shrinkage);
        effective_height = Math.floor(height * shrinkage);
        x_log_exp('effective_width', effective_width);
        x_log_exp('effective_height', effective_height);
        if (link == '[default]')
        {
            link = "Enlarge.htm?" + rx;

//          clickhelp = "&#x025f; Click to enlarge";
//          clickhelp = "<img src='u02295.png'> Click to enlarge";
//          clickhelp = "<img src='Enlarge.gif' valign='top'> Click to enlarge";
            clickhelp = "(Click to enlarge)";
//          var percent = Math.floor
//          (
//              100 * ((width - effective_width) / effective_width)
//          );
//          x_log_exp('percent', percent);
//          clickhelp = "(Click to enlarge by " + percent + "%)";

            x_log_exp('clickhelp', clickhelp);
            x_log_exp('link', link);
        }
    }

// If not shrinking, and no link override, then don't link:
    if (link == '[default]') link = '';

//
// Assemble the HTML:
//
    var result = new String();
    result += "\n<TABLE BORDER='00' CELLSPACING='0' CELLPADDING='0'"
        + " ALIGN='" + align + "'"
        + " WIDTH='" + effective_width + "'>"
        + "\n<TR><TD ALIGN='CENTER'>"; // This 'centers' the caption

    if (clickhelp != '') clickhelp = "\n" + clickhelp;
    if (alt == '[default]')
    {
        alt = new String(title + clickhelp);
    }
    if (caption == '[default]')
    {
        caption = new String(title + clickhelp);
    }
    if (caption != '')
    {
        caption = new String("\n" + caption.replace(/\n/g, "\n<BR>"));
    }

    if  (link != '')
    {
        border = 3;
        result += "\n<A "
//          + "TARGET='_BLANK'\n"
            + "HREF='" + link + "'>";
    }

// Use "" to quote SRC= and ALT= operands in
// case they contain embedded apostrophes:

    result += "\n<IMG SRC=\"" + filespec + "\" "
        + "\nBORDER='" + border           + "'"
        + " WIDTH='"   + effective_width  + "'"
        + " HEIGHT='"  + effective_height + "'";

    if (alt != '')
    {
        result += "\nALT=\"" + alt + "\"";
    }

    result += ">";

    if (link != '') result += "</A>";

    if (caption != '')
    {
        result += caption + "\n<HR SIZE='1' WIDTH='95%'>";
    }

    if (copyright != '')
    {
        result += "\n</TD><TD STYLE='writing-mode: tb-rl'><SMALL>\n"
            + copyright + "</SMALL>";
    }
    result += "</TD></TR></TABLE>";

    crk_next_caption   = '[default]';
    crk_next_copyright = '[default]';
    crk_next_link      = '[default]';

    x_log("\n... returning \"" + result + "\".");
    return result;
}

/*--------------------------------------------------------------------*/
/*                    CrkRandomPicture() function                     */
/*--------------------------------------------------------------------*/
function CrkRandomPicture(a_gallery, a_align, a_max_eff_width, a_max_eff_height)
{
    x_log("\n\nCrkRandomPicture('" + a_gallery + "', '" + a_align + "', '" + a_max_eff_width + "', '" + a_max_eff_height + "');");
    return CrkPicture(CrkRandomPictureIndex(a_gallery),
        a_align, a_max_eff_width, a_max_eff_height);
}

/*--------------------------------------------------------------------*/
/*                  CrkRandomPictureIndex() function                  */
/*--------------------------------------------------------------------*/
function CrkRandomPictureIndex(a_gallery)
{
    x_log("\n\nCrkRandomPictureIndex('" + a_gallery + "');");

    var gallery = new String('');
    if (typeof a_gallery != 'undefined') gallery = new String(a_gallery);
    x_log_exp('gallery', gallery);

    var regex = new RegExp('');
    if (gallery) regex = new RegExp(gallery);
    x_log_exp('regex.source', regex.source);

//
// If all pix have been used in this gallery, reset them all so they can be reused:
//
    num_avail = num_unavail = 0;
    avail = new String();
    for (rx = 0; rx < ROWS; rx++)
    {
        if (regex.test(crk_pictures[(rx * COLUMNS) + GALLERY]))
        {
            if (crk_pictures[(rx * COLUMNS) + USED] == 0)
            {
                num_avail++;
                avail += ' ' + rx;
            }
            else
            {
                num_unavail++;
            }
        }
    }
    x_log("\n" + num_avail + " pictures available:" + avail + ".");
    if (num_avail == 0)
    {
//      alert("Resetting " + num_unavail + " pictures for gallery '" + gallery + "'.\n");
        x_log("\nResetting " + num_unavail + " pictures for gallery '" + gallery + "'.");
        var num_reset = 0;
        var reset = new String();
        for (rx = 0; rx < ROWS; rx++)
        {
            if (regex.test(crk_pictures[(rx * COLUMNS) + GALLERY]))
            {
                num_reset++;
                reset += ' ' + rx;
                crk_pictures[(rx * COLUMNS) + USED] = 0;
            }
        }
        x_log("\n" + num_reset + " pictures reset:" + reset + ".");
    }

    x_log("\nSearching for random picture in gallery '" + gallery + "'.");
    var num_tried = 0;
    var tried = new String();
    while (1)
    {
        num_tried++;
        rx = Math.floor(Math.random() * ROWS);
        tried += ' ' + rx;
        if (crk_pictures[(rx * COLUMNS) + USED]) continue;
        if (regex.test(crk_pictures[(rx * COLUMNS) + GALLERY])) break;
if (num_tried > 1000) break; // BUG: This can happen when only 1 or 2 pics are left!
    }
    x_log("\nPicture '" + rx + "' selected after " + num_tried + " tried:" + tried + ".");

    return rx;
}

/*--------------------------------------------------------------------*/
/*                       CrkSiteMap() function                        */
/*--------------------------------------------------------------------*/
function CrkSiteMap()
{
//  x_log("\n\nCrkSiteMap();");
    var result = new String("\n<OPTION SELECTED>"
        + "\n&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;"
        + "\n&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;"
        + "\n&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;"
        + "\n&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;"
        + "\nWhere do you want to go next?"
        + "\n&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;"
        + "\n&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;"
        + "\n&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;"
        + "\n&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;"
        + "</OPTION>");
    for (smx = 0; crk_site_map[smx] != 'END'; smx += 3)
    {
        level = crk_site_map[smx + 0];
        fname = crk_site_map[smx + 1];
        title = crk_site_map[smx + 2];
        result += "\n<OPTION VALUE='" + fname + "'>";
        for (lx = 0; lx < level; lx++)
        {
            result += "&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;";
        }
        result += title + "</OPTION>";
    }
//  alert(result);
    return result;
}

/*--------------------------------------------------------------------*/
/*                         CrkTest() function                         */
/*--------------------------------------------------------------------*/
function CrkTest(a_id)
{
    alert("typeof a_id == '" + typeof a_id + "'.\n"
        + "a_id == '" + a_id + "'.")
}

/*--------------------------------------------------------------------*/
/*                        CrkTitle() function                         */
/*--------------------------------------------------------------------*/
function CrkTitle(a_rx)
{
//  x_log("\n\nCrkTitle('" + a_rx + "');");
    var result = crk_pictures[(rx * COLUMNS) + TITLE];
    if (result == '')
    {
        var fname = crk_pictures[(rx * COLUMNS) + FNAME];
        var result = new String(fname.replace(/_/g, ' '));
    }
    return result;
}

/*--------------------------------------------------------------------*/
/*                      CrkTranslate() function                       */
/*--------------------------------------------------------------------*/
function CrkTranslate()
{
    x_log("\n\nCrkTranslate();");
    var oldurl = new String("http://www.charlesrknight.com/" + x_page() + ".htm");
    var lang_x = document.CrkTranslationForm.CrkLanguage.options[
                 document.CrkTranslationForm.CrkLanguage.selectedIndex
                 ].value;
    if (lang_x == '')
    {
        newurl = oldurl;
    }
    else
    {
        newurl = "http://world.altavista.com/urltrurl"
            + "?lp=" + lang_x + "&url=" + oldurl;
    }
    x_log_exp('newurl', newurl);
    window.location = newurl;
}

/*--------------------------------------------------------------------*/
/*                         CrkUrl() function                          */
/*--------------------------------------------------------------------*/
function CrkUrl(a_filename)
{
    alert("\n\nCrkUrl('" + a_filename + "');");
//  result = "http://www.charlesrknight.com/" + a_filename + ".htm";
    var result = new String(a_filename + ".htm");
    if  (typeof document.forms.CrkTranslationForm.lp != 'undefined')
    {
        result = new String("http://world.altavista.com/urltrurl"
            + "?lp=" + document.forms.CrkTranslationForm.lp.value
            + "&url=" + my_url);
    }
// alert("CrkUrl('" + a_filename + "') => '" + result + "'.");
    return result;
}

/**********************************************************************/
/*                               E N D                                */
/**********************************************************************/
