slideShowURL = 'SlideShow_assets/SlideShow.html';       // parameter from openSlideShowWindow.js
slideShowNS4URL = 'SlideShow_assets/SlideShowNS4.html'; // parameter from openSlideShowWindow.js

slides = new Array();
slides[0] = new Slide('../Paleontology_files/Paleo black tie desert dinner.jpg', '576', '800', 'Denver paleontology formal dinner in the Utah desert. I’m front-center with the remote camera release.');
slides[1] = new Slide('../Paleontology_files/Paleo-barbarian-Horde.jpg', '531', '800', 'Denver paleontology dinner featuring the Barbarian Horde from the East in Utah.');
slides[2] = new Slide('../Paleontology_files/KC-digging.jpg', '600', '800', 'The Principal Investigator, Ken Carpenter, working in the Utah desert.');
slides[3] = new Slide('../Paleontology_files/Paleo-work-gully-of-death.jpg', '534', '800', 'Paleontology work in the Arroyo del Muerto (Gully of Death).');
slides[4] = new Slide('../Paleontology_files/Cedar-Mountain-desert-butte.jpg', '534', '800', 'Cedar Mountain (Kcm) desert butte');
slides[5] = new Slide('../Paleontology_files/Spotted-lizard-Kcm-May-2007.jpg', '600', '800', 'Spotted lizard in Kcm desert May 2007');
slides[6] = new Slide('../Paleontology_files/Clearing-Pit-9-dino-quarry.jpg', '600', '800', 'Clearing Pit 9 of a dinosaur quarry');
slides[7] = new Slide('../Paleontology_files/Pit-24-quarry-work-May-2004.jpg', '585', '800', 'Pit 24 dinosaur quarry work May 2004');
slides[8] = new Slide('../Paleontology_files/Dino-Hill-prospecting-group.jpg', '541', '800', 'Part of the Dino Hill prospecting group');
slides[9] = new Slide('../Paleontology_files/Dakota-outcrop-Kcm-desert.jpg', '600', '800', 'Dakota outcrop in Kcm desert');
slides[10] = new Slide('../Paleontology_files/Dino-Hill-with-Brenda.jpg', '541', '800', 'Dinosaur prospector at Dino Hill');
slides[11] = new Slide('../Paleontology_files/Dave-and-Tim-dino-quarry.jpg', '800', '534', 'Dave and Tim dino quarry');
slides[12] = new Slide('../Paleontology_files/Dave-and-Tim-quarrying-02.jpg', '800', '534', 'Dave and Tim quarrying 2');
slides[13] = new Slide('../Paleontology_files/Dave-and-Tim-quarrying-03.jpg', '800', '534', 'Dave andTim quarrying 3');
slides[14] = new Slide('../Paleontology_files/Deer-Valley-3.jpg', '541', '800', 'Deer Valley 3');
slides[15] = new Slide('../Paleontology_files/Kcm-cook-tent.jpg', '600', '800', 'Kcm cook tent');
slides[16] = new Slide('../Paleontology_files/Shaded-dinosaur-quarry.jpg', '534', '800', 'Shaded dinosaur quarry');
slides[17] = new Slide('../Paleontology_files/Desert-camp-in-evening.jpg', '600', '800', 'Desert camp in evening');
slides[18] = new Slide('../Paleontology_files/Dinosaur-quarry-with-shade.jpg', '534', '800', 'Dinosaur quarry pit with sun shade');
slides[19] = new Slide('../Paleontology_files/Dinosaur-work-site.jpg', '534', '800', 'Dinosaur work site');
slides[20] = new Slide('../Paleontology_files/Kcm-desert-May-2007-01.jpg', '600', '800', 'Kcm desert May 2007 1');
slides[21] = new Slide('../Paleontology_files/East-central-Utah-at-corral.jpg', '534', '800', 'East central Utah desert corral');
slides[22] = new Slide('../Paleontology_files/East-Utah-desert.jpg', '534', '800', 'Eastern Utah desert');
slides[23] = new Slide('../Paleontology_files/Homesteader-cabin-in-Utah.jpg', '541', '800', 'Homesteader cabin in Cedar Mountain formation desert in Utah');
slides[24] = new Slide('../Paleontology_files/Kcm-prospectors-working.jpg', '600', '800', 'Kcm prospectors working');
slides[25] = new Slide('../Paleontology_files/Fossil-log-Poison-Strip-9.jpg', '541', '800', 'Fossil log about 110 MY old, burned in a Cretraceous forest fire');
slides[26] = new Slide('../Paleontology_files/Fossil-log-Kcm-with-Chris.jpg', '800', '541', 'Fossil log about 110 MY old (Kcm), part of a whole forest that burned and fell.');
slides[27] = new Slide('../Paleontology_files/Chris-S-Indian-chert-mine.jpg', '541', '800', 'At a chert location. Deserts are full of cool stuff.');
slides[28] = new Slide('../Paleontology_files/JC-paleo-pic.jpg', '800', '661', 'Happy paleo worker');
slides[29] = new Slide('../Paleontology_files/Cute-paleo-girl-01.jpg', '800', '534', 'A paleo girl');
slides[30] = new Slide('../Paleontology_files/Kcm-cook-tents-May-2004.jpg', '600', '800', 'Kcm cook tents May 2004');
slides[31] = new Slide('../Paleontology_files/Dust-devil-damage-paleo-cmp.jpg', '600', '800', 'Dust devil damage at the Cedar Mountain paleontology camp');
slides[32] = new Slide('../Paleontology_files/Kcm-desert-butte.jpg', '800', '600', 'Kcm desert butte');
slides[33] = new Slide('../Paleontology_files/Kcm-desert-May-2007-16.jpg', '600', '800', 'Kcm desert 110 million-year-old exhumed river channel May 2007');
slides[34] = new Slide('../Paleontology_files/Kcm-sunrise-3.jpg', '579', '800', 'Kcm sunrise 03');
slides[35] = new Slide('../Paleontology_files/Kcm-sunrise-rays.jpg', '600', '800', 'Kcm sunrise rays');
slides[36] = new Slide('../Paleontology_files/Kcm-surreal-sunrise.jpg', '600', '800', 'Kcm surreal sunrise');
slides[37] = new Slide('../Paleontology_files/Kcm-rainbow.jpg', '600', '800', 'Kcm rainbow over a dinosaur quarry--our version of a pot of (scientific) gold');
slides[38] = new Slide('../Paleontology_files/Cedar-Mountain-(Kcm)-sunset.jpg', '600', '800', 'Kcm desert sunset');
slides[39] = new Slide('../Paleontology_files/Kcm-Yellowcat-Rd-sunset.jpg', '547', '800', 'Kcm Yellowcat Road sunset');
slides[40] = new Slide('../Paleontology_files/Lightning-at-Moab.jpg', '554', '800', 'Lightning near Moab during dinosaur work');
slides[41] = new Slide('../Paleontology_files/Kcm-KC-&-FHS-bivouac-cots.jpg', '600', '800', 'Kcm desert bivouac cots for KC & Frank (barely visible in the background)');
slides[42] = new Slide('../Paleontology_files/How-Frank-sleeps-in-desert.jpg', '600', '800', 'How Frank sleeps in the desert');
slides[43] = new Slide('../Paleontology_files/Kcm-vista-06.jpg', '589', '800', 'Kcm desert vista 06');
slides[44] = new Slide('../Paleontology_files/Kcm-vista-01.jpg', '600', '800', 'Kcm  desert vista 01');
slides[45] = new Slide('../Paleontology_files/Making-small-plaster-jacket.jpg', '534', '800', 'Making a small plaster jacket. Some of our jackets have weighed 3/4 of a ton.');
slides[46] = new Slide('../Paleontology_files/Prospecting-in-the-desert.jpg', '534', '800', 'Prospecting for dinosaurs in the desert. The Kcm is very difficult to prospect..');
slides[47] = new Slide('../Paleontology_files/Kcm-desert-flowerbed-01.jpg', '800', '600', 'Kcm desert flowerbed 01');
slides[48] = new Slide('../Paleontology_files/Kcm-desert-flowerbed-02.jpg', '601', '800', 'Kcm desert flowerbed 02');
slides[49] = new Slide('../Paleontology_files/Deer-Valley-cactus-flowers.jpg', '541', '800', 'Deer Valley cactus flowers');
slides[50] = new Slide('../Paleontology_files/Kcm-desert-flowers-01.jpg', '800', '600', 'Kcm desert paintbrush flowers 01');
slides[51] = new Slide('../Paleontology_files/Kcm-desert-flowers-02.jpg', '600', '800', 'Kcm desert paintbrush flowers 02');
slides[52] = new Slide('../Paleontology_files/Desert-flowers.jpg', '534', '800', 'Desert paintbrush flowers');
slides[53] = new Slide('../Paleontology_files/Purple-cactus-flowers.jpg', '513', '800', 'Purple cactus flowers');
slides[54] = new Slide('../Paleontology_files/Sheltering-from-the-wind.jpg', '600', '800', 'Waiting for the wind to die. This captures perfectly our need to bend with conditions.');
slides[55] = new Slide('../Paleontology_files/Swift-&-Seeber-quarry.jpg', '600', '800', 'Sandy & Tim probing for bones at a potential hot-spot while prospecting.');
slides[56] = new Slide('../Paleontology_files/View-of-Jm-Kcm-Book-Cliffs.jpg', '600', '800', 'View of Morrison (Jm), Cedar Mountain (Kcm) and distant Utah Book Cliffs');
slides[57] = new Slide('../Paleontology_files/Tim-with-Cadillac-bumper.jpg', '600', '800', 'Tim with a dead Cadillac bumper. Deserts are full of ancient & recent human detritus.');
slides[58] = new Slide('../Paleontology_files/Frank-in-east-Utah-desert.jpg', '534', '800', 'Frank prospecting for dinosaurs in eastern Utah near old uranium claim (foreground).');
slides[59] = new Slide('../Paleontology_files/Utah-desert-cliffs-B&W.jpg', '534', '800', 'Utah desert cliffs B&W');
slides[60] = new Slide('../Paleontology_files/Working-Pc-horizon.jpg', '600', '800', 'Working at the Permian Cutler (Pc) horizon in Colorado');
slides[61] = new Slide('../Paleontology_files/Crew-working-Permian-quarry.jpg', '539', '800', 'Museum crew working in a Permian-age quarry in western Colorado');
slides[62] = new Slide('../Paleontology_files/Paleo-insect-prepared-3.jpg', '600', '800', 'Paleo insect that I prepared under a microscope at the paleo lab');
isPureISOLatin1 = true;
contentEncodingConstant = 4;
feedbackURL = "TODO";
showFeedbackButton = false;
feedbackEnabled = true;

var MINIMUM_FONT = "10";
var UNITS = "";

function elementFontSize(element)
{
    var fontSize = MINIMUM_FONT; 

    if (document.defaultView)
    {
        var computedStyle = document.defaultView.getComputedStyle(element, null);
        if (computedStyle)
        {
            fontSize = computedStyle.getPropertyValue("font-size");
        }
    }
    else if (element.currentStyle)
    {
        fontSize = element.currentStyle.fontSize;
    }

    if ((UNITS.length == 0) && (fontSize != MINIMUM_FONT))
    {
        UNITS = fontSize.substring(fontSize.length - 2, fontSize.length)
    }

    return parseFloat(fontSize);
}

function adjustFontSizeIfTooBig(idOfElement)
{
    var oTextBoxOuterDiv;
    var oTextBoxMiddleDiv;
    var oTextBoxInnerDiv;
    var oTextBoxOuterDiv = document.getElementById(idOfElement);
    
    if (oTextBoxOuterDiv)
    {
        oTextBoxMiddleDiv = getChildOfType(oTextBoxOuterDiv, "DIV", 0);
        if (oTextBoxMiddleDiv)
        {
            oTextBoxInnerDiv = getChildOfType(oTextBoxMiddleDiv, "DIV", 0);
            if (oTextBoxInnerDiv)
            {
                var offsetHeight = oTextBoxInnerDiv.offsetHeight;
                var specifiedHeight = offsetHeight;
                if (oTextBoxMiddleDiv.style.height != "")
                {
                    specifiedHeight = parseFloat(oTextBoxMiddleDiv.style.height);
                }
                else if (oTextBoxOuterDiv.style.height != "")
                {
                    specifiedHeight = parseFloat(oTextBoxOuterDiv.style.height);
                }
                if (offsetHeight > specifiedHeight)
                {
                    var smallestFontSize = 200;
                    
                    var aParaChildren = getParaDescendants(oTextBoxInnerDiv);
                    var oneLine = false;
                    for (i = 0; i < aParaChildren.length; i++)
                    {
                        var oParagraphDiv = aParaChildren[i];
                        var lineHeight = elementLineHeight(oParagraphDiv);
                        oneLine = oneLine || (lineHeight * 1.5 >= specifiedHeight);
                        if (oParagraphDiv.nodeName == "DIV")
                        {
                            var fontSize = elementFontSize(oParagraphDiv);
                            smallestFontSize = Math.min( smallestFontSize, fontSize );
                            for (j = 0; j < oParagraphDiv.childNodes.length; j++)
                            {
                                var oSpan = oParagraphDiv.childNodes[j];
                                if ((oSpan.nodeName == "SPAN") || (oSpan.nodeName == "A"))
                                {
                                    fontSize = elementFontSize(oSpan);
                                    smallestFontSize = Math.min( smallestFontSize, fontSize );
                                }
                            }
                        }
                    }
                    var minimum = parseFloat(MINIMUM_FONT);
                    
                    var count = 0
                    while ((smallestFontSize > minimum) && (offsetHeight > specifiedHeight) && (count < 10))
                    {
                        ++ count;
                        if (oneLine)
                        {
                            var oldWidth = parseInt(oTextBoxOuterDiv.style.width);
                            oTextBoxInnerDiv.style.width =
                                "" + oldWidth * Math.pow(1.05, count) + "px";
                        }
                        else
                        {
                            var scale = Math.max(0.95, minimum / smallestFontSize);
                            
                            for (i = 0; i < aParaChildren.length; i++)
                            {
                                var oParagraphDiv = aParaChildren[i];
                                if (oParagraphDiv.nodeName == "DIV")
                                {
                                    var paraFontSize = elementFontSize(oParagraphDiv) * scale;
                                    var paraLineHeight = elementLineHeight(oParagraphDiv) * scale;
                                    for (j = 0; j < oParagraphDiv.childNodes.length; j++)
                                    {
                                        var oSpan = oParagraphDiv.childNodes[j];
                                        if ((oSpan.nodeName == "SPAN") || (oSpan.nodeName == "A"))
                                        {
                                            var spanFontSize = elementFontSize(oSpan) * scale;
                                            var spanLineHeight = elementLineHeight(oSpan) * scale;
                                            oSpan.style.fontSize = spanFontSize + UNITS;
                                            oSpan.style.lineHeight = spanLineHeight + UNITS;
                                            smallestFontSize = Math.min( smallestFontSize, spanFontSize );
                                        }
                                    }
                                    oParagraphDiv.style.fontSize = paraFontSize + UNITS;
                                    oParagraphDiv.style.lineHeight = paraLineHeight + UNITS;
                                    smallestFontSize = Math.min( smallestFontSize, paraFontSize );
                                }
                            }
                        }
                        
                        offsetHeight = oTextBoxInnerDiv.offsetHeight;
                    }
                }
            }
        }
    }
}


function elementLineHeight(element)
{
    var lineHeight = MINIMUM_FONT; 
    
    if (document.defaultView)
    {
        var computedStyle = document.defaultView.getComputedStyle(element, null);
        if (computedStyle)
        {
            lineHeight = computedStyle.getPropertyValue("line-height");
        }
    }
    else if (element.currentStyle)
    {
        lineHeight = element.currentStyle.lineHeight;
    }
    
    if ((UNITS.length == 0) && (lineHeight != MINIMUM_FONT))
    {
        UNITS = lineHeight.substring(lineHeight.length - 2, lineHeight.length)
    }
    
    return parseFloat(lineHeight);
}

function adjustLineHeightIfTooBig(idOfElement)
{
    var oTextBoxOuterDiv;
    var oTextBoxMiddleDiv;
    var oTextBoxInnerDiv;
    var oTextBoxOuterDiv = document.getElementById(idOfElement);
    
    if (oTextBoxOuterDiv)
    {
        oTextBoxMiddleDiv = getChildOfType(oTextBoxOuterDiv, "DIV", 0);
        if (oTextBoxMiddleDiv)
        {
            oTextBoxInnerDiv = getChildOfType(oTextBoxMiddleDiv, "DIV", 0);
            if (oTextBoxInnerDiv)
            {
                var offsetHeight = oTextBoxInnerDiv.offsetHeight;
                var specifiedHeight = offsetHeight;
                if (oTextBoxMiddleDiv.style.height != "")
                {
                    specifiedHeight = parseFloat(oTextBoxMiddleDiv.style.height);
                }
                else if (oTextBoxOuterDiv.style.height != "")
                {
                    specifiedHeight = parseFloat(oTextBoxOuterDiv.style.height);
                }
                if (offsetHeight > specifiedHeight)
                {
                    var adjusted = true;
                    var count = 0;
                    while ((adjusted) && (offsetHeight > specifiedHeight) && (count < 10))
                    {
                        adjusted = false;
                        ++ count;
                        
                        var aParaChildren = getParaDescendants(oTextBoxInnerDiv);
                        for (i = 0; i < aParaChildren.length; i++)
                        {
                            var oParagraphDiv = aParaChildren[i];
                            if (oParagraphDiv.nodeName == "DIV")
                            {
                                var fontSize = elementFontSize(oParagraphDiv);
                                var lineHeight = elementLineHeight(oParagraphDiv) * 0.95;
                                if (lineHeight >= (fontSize * 1.1))
                                {
                                    oParagraphDiv.style.lineHeight = lineHeight + UNITS;
                                    adjusted = true;
                                }
                                
                                
                                
                                for (j = 0; j < oParagraphDiv.childNodes.length; j++)
                                {
                                    var oSpan = oParagraphDiv.childNodes[j];
                                    if ((oSpan.nodeName == "SPAN") || (oSpan.nodeName == "A"))
                                    {
                                        var fontSize = elementFontSize(oSpan);
                                        var lineHeight = elementLineHeight(oSpan) * 0.95;
                                        if (lineHeight >= (fontSize * 1.1))
                                        {
                                            oSpan.style.lineHeight = lineHeight + UNITS;
                                            var adjusted = true;
                                        }
                                    }
                                }
                            }
                        }
                        
                        offsetHeight = oTextBoxInnerDiv.offsetHeight;
                    }
                }
            }
        }
    }
}

var smallTransparentGif = "";
function fixupIEPNG(strImageID, transparentGif) 
{
    smallTransparentGif = transparentGif;
    if (windowsInternetExplorer && (browserVersion < 7))
    {
        var img = document.getElementById(strImageID);
        if (img)
        {
            var src = img.src;
            img.style.filter = "progid:DXImageTransform.Microsoft.AlphaImageLoader(src='" + src + "', sizingMethod='scale')";
            img.src = transparentGif;
            img.attachEvent("onpropertychange", imgPropertyChanged);
        }
    }
}

function fixupIEPNGBG(oBlock) 
{
    if (oBlock)
    {
        var currentBGImage = oBlock.currentStyle.backgroundImage;
        var currentBGRepeat = oBlock.currentStyle.backgroundRepeat;
        var urlStart = currentBGImage.indexOf('url(');
        var urlEnd = currentBGImage.indexOf(')', urlStart);
        var imageURL = currentBGImage.substring(urlStart + 4, urlEnd);

        if (imageURL.charAt(0) == '"')
        {
            imageURL = imageURL.substring(1);
        }
        
        if (imageURL.charAt(imageURL.length - 1) == '"')
        {
            imageURL = imageURL.substring(0, imageURL.length - 1);
        }

        var overrideRepeat = false;

        var filterStyle =
            "progid:DXImageTransform.Microsoft.AlphaImageLoader(src='" +
            imageURL +
            "', sizingMethod='crop');";

        if (RegExp("/C[0-9A-F]{8}.png$").exec(imageURL) != null)
        {
            filterStyle =
                "progid:DXImageTransform.Microsoft.AlphaImageLoader(src='" +
                imageURL +
                "', sizingMethod='scale');";

            overrideRepeat = true;
        }

        var backgroundImage = new Image();
        backgroundImage.src = imageURL;
        var tileWidth = backgroundImage.width;
        var tileHeight = backgroundImage.height; 
        
        var blockWidth = 0;
        var blockHeight = 0;
        if (oBlock.style.width)
        {
            blockWidth = parseInt(oBlock.style.width);
        }
        else
        {
            blockWidth = oBlock.offsetWidth;
        }
        if (oBlock.style.height)
        {
            blockHeight = parseInt(oBlock.style.height);
        }
        else
        {
            blockHeight = oBlock.offsetHeight;
        }

        if ((blockWidth == 0) || (blockHeight == 0))
        {
            return;
        }
        
        var wholeRows = 1;
        var wholeCols = 1;
        var extraHeight = 0;
        var extraWidth = 0;
        
        if ((currentBGRepeat.indexOf("no-repeat") != -1) ||
              ((tileWidth == 0) && (tileHeight == 0)) ||
              overrideRepeat)
        {
            tileWidth = blockWidth;
            tileHeight = blockHeight;

        }
        else if ((currentBGRepeat.indexOf("repeat-x") != -1) ||
              (tileHeight == 0))
        {
            wholeCols = Math.floor(blockWidth / tileWidth);
            extraWidth = blockWidth - (tileWidth * wholeCols);
            tileHeight = blockHeight;

        }
        else if (currentBGRepeat.indexOf("repeat-y") != -1)
        {
            wholeRows = Math.floor(blockHeight / tileHeight);
            extraHeight = blockHeight - (tileHeight * wholeRows);
            tileWidth = blockWidth;

        }
        else
        {
            wholeCols = Math.floor(blockWidth / tileWidth);
            wholeRows = Math.floor(blockHeight / tileHeight);
            extraWidth = blockWidth - (tileWidth * wholeCols);
            extraHeight = blockHeight - (tileHeight * wholeRows);
        }
        
        var wrappedContent = document.createElement("div");
        wrappedContent.style.position = "relative";
        wrappedContent.style.zIndex = "1";
        wrappedContent.style.left = "0px";
        wrappedContent.style.top = "0px";
        if (!isNaN(parseInt(oBlock.style.width)))
        {
            wrappedContent.style.width = "" + blockWidth + "px";
        }
        if (!isNaN(parseInt(oBlock.style.height)))
        {
            wrappedContent.style.height = "" + blockHeight + "px";
        }
        var pngBGFixIsWrappedContentEmpty = true;
        while (oBlock.hasChildNodes())
        {
            if (oBlock.firstChild.nodeType == 3)
            {
                if (RegExp("^ *$").exec(oBlock.firstChild.data) == null)
                {
                    pngBGFixIsWrappedContentEmpty = false;
                }
            }
            else
            {
                pngBGFixIsWrappedContentEmpty = false;
            }
            wrappedContent.appendChild(oBlock.firstChild);
        }
        if (pngBGFixIsWrappedContentEmpty)
        {
            wrappedContent.style.lineHeight = "0px";
        }
        
        var newMarkup = "";
        for (var currentRow = 0; 
             currentRow < wholeRows; 
             currentRow++)
        {
            for (currentCol = 0; 
                 currentCol < wholeCols; 
                 currentCol++)
            {
                newMarkup += "<div style=" +
                        "\"position: absolute; line-height: 0px; " +
                        "width: " + tileWidth + "px; " +
                        "height: " + tileHeight + "px; " +
                        "left:" + currentCol *  tileWidth + "px; " +
                        "top:" + currentRow *  tileHeight + "px; " +
                        "filter:" + filterStyle + 
                        "\" > </div>";
            }
            
            if (extraWidth != 0)
            {
                newMarkup += "<div style=" +
                        "\"position: absolute; line-height: 0px; " +
                        "width: " + extraWidth + "px; " +
                        "height: " + tileHeight + "px; " +
                        "left:" + currentCol *  tileWidth + "px; " +
                        "top:" + currentRow *  tileHeight + "px; " +
                        "filter:" + filterStyle + 
                        "\" > </div>";
            }
        }
        
        if (extraHeight != 0)
        {
            for (currentCol = 0; 
                 currentCol < wholeCols; 
                 currentCol++)
            {
                newMarkup += "<div style=" +
                        "\"position: absolute; line-height: 0px; " +
                        "width: " + tileWidth + "px; " +
                        "height: " + extraHeight + "px; " +
                        "left:" + currentCol *  tileWidth + "px; " +
                        "top:" + currentRow *  tileHeight + "px; " +
                        "filter:" + filterStyle + 
                        "\" > </div>";
            }
            
            if (extraWidth != 0)
            {
                newMarkup += "<div style=" +
                        "\"position: absolute; line-height: 0px; " +
                        "width: " + extraWidth + "px; " +
                        "height: " + extraHeight + "px; " +
                        "left:" + currentCol *  tileWidth + "px; " +
                        "top:" + currentRow *  tileHeight + "px; " +
                        "filter:" + filterStyle + 
                        "\" > </div>";
            }
        }
        oBlock.innerHTML = newMarkup;

        oBlock.appendChild(wrappedContent);
        oBlock.style.background= "";
    }
}

function fixupAllIEPNGBGs()
{
    if (windowsInternetExplorer && (browserVersion < 7))
    {
        try
        {
            var oDivNodes = document.getElementsByTagName('DIV');
            for (var iIndex=0; iIndex<oDivNodes.length; iIndex++)
            {
                var oNode = oDivNodes.item(iIndex);
                if (oNode.currentStyle &&
                    oNode.currentStyle.backgroundImage &&
                    (oNode.currentStyle.backgroundImage.indexOf('url(') != -1) &&
                    (oNode.currentStyle.backgroundImage.indexOf('.png")') != -1))
                {
                    fixupIEPNGBG(oNode);
                }
            }
        }
        catch (e)
        {
        }
    }
}

function getChildOfType(oParent, sNodeName, requestedIndex)
{
    var childrenOfType = oParent.getElementsByTagName(sNodeName);
    return (requestedIndex < childrenOfType.length) ?
           childrenOfType.item(requestedIndex) : null;
}

function getParaDescendants(oAncestor)
{
    var oParaDescendants = new Array();
    var oPotentialParagraphs = oAncestor.getElementsByTagName('DIV');
    for (var iIndex=0; iIndex<oPotentialParagraphs.length; iIndex++)
    {
        var oNode = oPotentialParagraphs.item(iIndex);
        if (oNode.className.lastIndexOf('paragraph') != -1)
        {
            oParaDescendants.push(oNode);
        }
    }
    return oParaDescendants;
}

function onPageLoad()
{
    detectBrowser();
    adjustLineHeightIfTooBig("id1");
    adjustFontSizeIfTooBig("id1");
    adjustLineHeightIfTooBig("id4");
    adjustFontSizeIfTooBig("id4");
    fixupIEPNG("id2", "Paleontology_files/transparent.gif");
    fixupIEPNG("id3", "Paleontology_files/transparent.gif");
    fixupAllIEPNGBGs();
    fixupIEPNG("id5", "Paleontology_files/transparent.gif");
    fixupIEPNG("id6", "Paleontology_files/transparent.gif");
    fixupIEPNG("id7", "Paleontology_files/transparent.gif");
    fixupIEPNG("id8", "Paleontology_files/transparent.gif");
    fixupIEPNG("id9", "Paleontology_files/transparent.gif");
    fixupIEPNG("id10", "Paleontology_files/transparent.gif");
    return true;
}

function NBmouseover(index)
{
    var normal = document.getElementById("navbar_"+index+"_normal");
    var rollover = document.getElementById("navbar_"+index+"_rollover");
    if (normal && rollover)
    {
        normal.style.visibility = "hidden";
        rollover.style.visibility = "visible";
    }
    return true;
}

function NBmouseout(index)
{
    var normal = document.getElementById("navbar_"+index+"_normal");
    var rollover = document.getElementById("navbar_"+index+"_rollover");
    if (normal && rollover)
    {
        normal.style.visibility = "visible";
        rollover.style.visibility = "hidden";
    }
    return true;
}

var windowsInternetExplorer = false;
var browserVersion = 0;
function detectBrowser()
{
    windowsInternetExplorer = false;
    var appVersion = navigator.appVersion;
    if ((appVersion.indexOf("MSIE") != -1) &&
        (appVersion.indexOf("Macintosh") == -1))
    {
        var temp = appVersion.split("MSIE");
        browserVersion = parseFloat(temp[1]);
        windowsInternetExplorer = true;
    }
}

var inImgPropertyChanged = false;
function imgPropertyChanged()
{
    if ((window.event.propertyName == "src") && (! inImgPropertyChanged))
    {
        inImgPropertyChanged = true;
        var el = window.event.srcElement;
        if (el.src != smallTransparentGif)
        {
            el.filters.item(0).src = el.src;
            el.src = smallTransparentGif;
        }
        inImgPropertyChanged = false;
    }
}

