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('../Dutch_Tin_after_WWI_files/01-9862.jpg', '800', '600', 'Bob Hommes');
slides[1] = new Slide('../Dutch_Tin_after_WWI_files/02-9751.jpg', '800', '600', 'Peter Lingg');
slides[2] = new Slide('../Dutch_Tin_after_WWI_files/DSC03-9859.jpg', '600', '800', 'Bob’s unique wall-o-tins, attached with \ntwo-sided carpet tape.\n[DSC03-9859]');
slides[3] = new Slide('../Dutch_Tin_after_WWI_files/04-9857.jpg', '585', '800', 'Bob’s walls go on and on, a museum of\npost WWI Dutch cigar boxes.\n[04-9857');
slides[4] = new Slide('../Dutch_Tin_after_WWI_files/07 9891.jpg', '539', '800', 'Smoking is always a popular them, but these guys are smoking pipes on a cigar tin.\n07 9891');
slides[5] = new Slide('../Dutch_Tin_after_WWI_files/08-9914.jpg', '441', '800', 'A personal favorite.\n08-9914');
slides[6] = new Slide('../Dutch_Tin_after_WWI_files/09-9832.jpg', '600', '763', '09-9832');
slides[7] = new Slide('../Dutch_Tin_after_WWI_files/10-9887.jpg', '530', '800', '10-9887');
slides[8] = new Slide('../Dutch_Tin_after_WWI_files/11-9774.jpg', '581', '800', '11-9774');
slides[9] = new Slide('../Dutch_Tin_after_WWI_files/12-9845.jpg', '600', '775', '12-9845');
slides[10] = new Slide('../Dutch_Tin_after_WWI_files/13-9777.jpg', '600', '752', '13-9777');
slides[11] = new Slide('../Dutch_Tin_after_WWI_files/14-9776.jpg', '600', '748', '14-9776');
slides[12] = new Slide('../Dutch_Tin_after_WWI_files/15-9831.jpg', '600', '761', 'Famous men were popular among \nadvertisers around the world.\n15-9831');
slides[13] = new Slide('../Dutch_Tin_after_WWI_files/16-9809.jpg', '599', '755', '16-9809');
slides[14] = new Slide('../Dutch_Tin_after_WWI_files/17-9833.jpg', '555', '800', '17-9833');
slides[15] = new Slide('../Dutch_Tin_after_WWI_files/18-9839.jpg', '555', '800', '18-9839');
slides[16] = new Slide('../Dutch_Tin_after_WWI_files/19-9843.jpg', '608', '600', 'Women did not appear on tobacco products\nproportionally as often in Europe as in the U.S.\n19-9843');
slides[17] = new Slide('../Dutch_Tin_after_WWI_files/20-9864.jpg', '648', '600', '20-9864');
slides[18] = new Slide('../Dutch_Tin_after_WWI_files/21-9812.jpg', '594', '800', 'Everybody loves dogs.\n21-9812');
slides[19] = new Slide('../Dutch_Tin_after_WWI_files/22-9844.jpg', '600', '728', '22-9844');
slides[20] = new Slide('../Dutch_Tin_after_WWI_files/23-9830.jpg', '577', '800', 'Birds were popular in advertising art\non both continents as well.\n23-9830');
slides[21] = new Slide('../Dutch_Tin_after_WWI_files/24-9918.jpg', '600', '745', '24-9918');
slides[22] = new Slide('../Dutch_Tin_after_WWI_files/25-9915.jpg', '633', '600', 'Owls seem to show up on Dutch tins\nmore often than in the U.S.\n25-9915');
slides[23] = new Slide('../Dutch_Tin_after_WWI_files/26-9917.jpg', '600', '796', '26-9917');
slides[24] = new Slide('../Dutch_Tin_after_WWI_files/27-9886.jpg', '550', '800', '27-9886');
slides[25] = new Slide('../Dutch_Tin_after_WWI_files/28-9823.jpg', '593', '800', '28-9823');
slides[26] = new Slide('../Dutch_Tin_after_WWI_files/29-9884.jpg', '600', '716', 'Cowboys, Indians and the American old west\nare surprisingly popular themes.\n29-9884');
slides[27] = new Slide('../Dutch_Tin_after_WWI_files/30-9827.jpg', '600', '799', '30-9827');
slides[28] = new Slide('../Dutch_Tin_after_WWI_files/31-9829.jpg', '600', '756', '31-9829');
slides[29] = new Slide('../Dutch_Tin_after_WWI_files/32-9840.jpg', '555', '800', '32-9840');
slides[30] = new Slide('../Dutch_Tin_after_WWI_files/33-9916.jpg', '429', '800', '33-9916');
slides[31] = new Slide('../Dutch_Tin_after_WWI_files/34-9841.jpg', '600', '787', '34-9841');
slides[32] = new Slide('../Dutch_Tin_after_WWI_files/35-9837.jpg', '600', '749', '35-9837');
slides[33] = new Slide('../Dutch_Tin_after_WWI_files/36-9821.jpg', '381', '800', '36-9821');
slides[34] = new Slide('../Dutch_Tin_after_WWI_files/37-9865.jpg', '600', '610', '37-9865');
slides[35] = new Slide('../Dutch_Tin_after_WWI_files/38-9846.jpg', '600', '789', '38-9846');
slides[36] = new Slide('../Dutch_Tin_after_WWI_files/39-9889.jpg', '380', '800', 'A tiny cigarette tin, too good not to include.\n39-9889');
slides[37] = new Slide('../Dutch_Tin_after_WWI_files/40-9842.jpg', '600', '763', '40-9842');
slides[38] = new Slide('../Dutch_Tin_after_WWI_files/41-9834.jpg', '507', '800', 'Ethnic stereotypes and caricatures seem to\nbe prevalent in collections if not in general.\n41-9834');
slides[39] = new Slide('../Dutch_Tin_after_WWI_files/42-9885.jpg', '600', '777', '42-9885');
slides[40] = new Slide('../Dutch_Tin_after_WWI_files/43-9826.jpg', '520', '800', 'Custom tins for events are seen far more often in Europe than in the U.S. where they are very rare. “Niew Stationsgebouw Utrecht \nSpoorjubileum  1839 - 1939”\n43-9826');
slides[41] = new Slide('../Dutch_Tin_after_WWI_files/44-9836.jpg', '600', '778', '“Neerland’s Onaphankelijkheid  1813 - 1913”\n44-9836');
slides[42] = new Slide('../Dutch_Tin_after_WWI_files/45-9778.jpg', '432', '661', '45-9778');
slides[43] = new Slide('../Dutch_Tin_after_WWI_files/46-9779.jpg', '400', '537', '46-9779');
slides[44] = new Slide('../Dutch_Tin_after_WWI_files/47-9811.jpg', '600', '757', 'Americans weren’t the only people to name cigars\nafter weather phenomenon.\n47-9811');
slides[45] = new Slide('../Dutch_Tin_after_WWI_files/48-9888.jpg', '600', '747', '48-9888');
slides[46] = new Slide('../Dutch_Tin_after_WWI_files/47-9824.jpg', '600', '791', '47-9824');
slides[47] = new Slide('../Dutch_Tin_after_WWI_files/48-9825.jpg', '600', '765', '48-9825');
slides[48] = new Slide('../Dutch_Tin_after_WWI_files/49-9817.jpg', '585', '800', 'You could spend a lifetime collecting and never find all the HOFNAR tins. There are more than 110 varieties of the American EDGEWORTH and many more than that of these...and they’re a lot prettier.\n49-9817');
slides[49] = new Slide('../Dutch_Tin_after_WWI_files/50-9818.jpg', '586', '800', '50-9818');
slides[50] = new Slide('../Dutch_Tin_after_WWI_files/51-9820.jpg', '470', '800', '51-9820');
slides[51] = new Slide('../Dutch_Tin_after_WWI_files/52-9816.jpg', '600', '770', '52-9816');
slides[52] = new Slide('../Dutch_Tin_after_WWI_files/53-9815.jpg', '563', '800', '53-9815');
slides[53] = new Slide('../Dutch_Tin_after_WWI_files/54-9819.jpg', '576', '800', '54-9819');
slides[54] = new Slide('../Dutch_Tin_after_WWI_files/55-9814.jpg', '600', '677', 'I’ve always thought this a strange brand name.\n55-9814');
slides[55] = new Slide('../Dutch_Tin_after_WWI_files/56-9838.jpg', '788', '600', '56-9838');
slides[56] = new Slide('../Dutch_Tin_after_WWI_files/DSCN9780.jpg', '600', '744', 'Any relation to the ship lines?\n57-9780');
slides[57] = new Slide('../Dutch_Tin_after_WWI_files/DSCN9810.jpg', '600', '768', '58-9810');
slides[58] = new Slide('../Dutch_Tin_after_WWI_files/DSCN0032001.jpg', '547', '800', 'PL-DSCN0032');
slides[59] = new Slide('../Dutch_Tin_after_WWI_files/DSCN0034001.jpg', '550', '800', 'PL-DSCN0034');
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("id2");
    adjustFontSizeIfTooBig("id2");
    fixupAllIEPNGBGs();
    fixupIEPNG("id3", "Dutch_Tin_after_WWI_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;
    }
}


