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('../Tin_Boxes_1900-1960_files/tin59.jpg', '422', '551', 'Square 25, not the most common form. Unknown whether it is packed 8-9-8 or 9-9-7 by Factory 2, \n5th tax district of  New Jersey.  c1905\nRare to see a design that incorporates the tax\nstamp’s position into the design.  [2959]');
slides[1] = new Slide('../Tin_Boxes_1900-1960_files/31tintoo8.jpg', '411', '570', 'Early “sample” box of 12 with finely done portrait\ncreated around 1905 before the advent of \nboxes packed 10/5. Fact. 268, 1st PA.\n[3108]');
slides[2] = new Slide('../Tin_Boxes_1900-1960_files/31tintoo15.jpg', '421', '570', 'One of Florida’s better known turn-of-the-century brands from Factory 166 Florida. No city \nseal on the bottom.\n[3115]');
slides[3] = new Slide('../Tin_Boxes_1900-1960_files/tin34.jpg', '392', '570', 'Nice looking pre 1910 ten popular with collectors.\nFact. 89,  1st Ohio  c1905.\n[2934]');
slides[4] = new Slide('../Tin_Boxes_1900-1960_files/bookbox3375.jpg', '310', '570', 'Fact. 55, 6th Missouri, used a stock box and stock label and came up with a reusable cigar box.\n[3375]');
slides[5] = new Slide('../Tin_Boxes_1900-1960_files/bookbox3378.jpg', '310', '570', 'This 13” long box of 250 is another example\nof turning a stock item in a box maker’s\ncatalog into a cigar box. \n[3378]');
slides[6] = new Slide('../Tin_Boxes_1900-1960_files/bookbox3380.jpg', '307', '570', 'Inside copy promises the box to the purchaser of the last pack of cigars. “Useful as a cash box, lunch box, cake box or for fishing tackle, valuable papers, etc. Watch the box and buy the last package.” Made\nfor Tinkham Bros, Jamestown NY distributors.[3380]');
slides[7] = new Slide('../Tin_Boxes_1900-1960_files/bookbox3379.jpg', '401', '570', 'Barnes, Smith & Co. (Fact. 1239, 21st Dist/ NY) In Binghamton used this utility box to hold 200 cigars, making a lightweight but usable box when emptied.\n[3379]');
slides[8] = new Slide('../Tin_Boxes_1900-1960_files/bookbox3376.jpg', '389', '570', 'S.Davis & Sons (Fact.6, IRD 17 Montreal) was one of Canada’s more inventive marketers, offering\nthe strongest and most intricately constructed\ncash box to someone buying a box of\nLORD TENNYSON cigars in 1905. [3376]');
slides[9] = new Slide('../Tin_Boxes_1900-1960_files/bookbox3377.jpg', '467', '422', 'The hinged double-lidded top tray lifts off to \nreveal another compartment underneath.\n[3377]');
slides[10] = new Slide('../Tin_Boxes_1900-1960_files/cdb80.jpg', '422', '422', 'At the other end of the size spectrum, is the small cigarette-size 10/10 or “flat ten.”\n Flat 10’s are exhibited elsewhere.\n[3580]');
slides[11] = new Slide('../Tin_Boxes_1900-1960_files/tin73.jpg', '322', '570', 'American Tobacco Co. bought the brand from Thos. H. Hall, and in the 1911 dissolution of the Trust, passed it  on to P.Lorillard. This dates from the first\ndecade of 1900’s, the American Tobacco period.\nEmbossed.  [2973]');
slides[12] = new Slide('../Tin_Boxes_1900-1960_files/mixpolitics796.jpg', '422', '519', 'Lunch boxes were most commonly used to\nhold smoking and chewing tobacco but a few\ncigar ones can be found. This box from 1909 \nuses paper labels inside, outside and on top.\n[7906]');
slides[13] = new Slide('../Tin_Boxes_1900-1960_files/tin54.jpg', '428', '422', 'One of the two most common cigar lunch boxes, \nthe ad copy is lithoed onto the tin on this\nsquare box used by Eisenlohr around 1910.\nCINCO sold well enough retailers were willing to put up with the awkward hard-to-stack design. [2954]');
slides[14] = new Slide('../Tin_Boxes_1900-1960_files/tin50.jpg', '570', '671', 'A gem of a lunch box, much like those used for tobacco products. Packed with cigars by\nP.Lorillard, a tobacco company for whom\ncigars were somewhat of a sideline.\n[2950]');
slides[15] = new Slide('../Tin_Boxes_1900-1960_files/bookbox3397.jpg', '382', '570', 'Another important Canadian cigar company, Simon & Sons, sold 25 cigars in this unusual tin designed to be a desk accessory when emptied. Top had a place for a slip-in label and clamp to hold a pad of paper. 1920’s.   [3397]');
slides[16] = new Slide('../Tin_Boxes_1900-1960_files/boxtype - 28.jpg', '217', '195', 'LA SUCRENA tin octagon c1915. Fact. 1101 1st PA.\nSince the 1700’s cigars have been packed standing on end in boxes called uprights. Tin is the most common material for uprights. Uprights are featured in an exhibit elsewhere. ');
slides[17] = new Slide('../Tin_Boxes_1900-1960_files/30tincan86.jpg', '677', '570', 'Tin cans were used extensively from 1910 to 1930.\nTin cans are featured in two exhibits elsewhere.\nThe P.Lorillard and Tin exhibit contains numerous cans exclusive to that exhibit.\n[3086]');
slides[18] = new Slide('../Tin_Boxes_1900-1960_files/cdb67.jpg', '422', '551', 'Fact. 1054, 3rd NYC used this hinged 10/5 box for 4.25” cigars in 1913. Black printing on simulated\nwood grain. The brand lasted for 40 years.\n[3567]');
slides[19] = new Slide('../Tin_Boxes_1900-1960_files/tincan89.jpg', '331', '570', 'Copyrighted 1914, but used in 1917, this distinctive package was popular for a decade or more. \nAlso found with a glass lid. Cigars by Penn Cigar Co., Reading  (Fact. 3, 1st PA).\n[3089]');
slides[20] = new Slide('../Tin_Boxes_1900-1960_files/cdb97.jpg', '308', '570', 'Tin 10/5 hinged box used by Gans Bros., Fact. 293, 3rd NY City, for their 6.5” long fellows in the 1920’s.\nLike Cuban boxes in the 1840’s, black ink on dark colored hard to read background. “Economical Smoke of Quality” suggests priced at 25¢.    [3597]');
slides[21] = new Slide('../Tin_Boxes_1900-1960_files/tin80.jpg', '244', '570', 'Top and inside of unusually large 16” long 100/25 tin box. Space-hogging distinctive design was probably effective attention getter if retailers were willing to give a 3¢ cigar double space in their  counter.\nAn under-rated gem.  [2980]');
slides[22] = new Slide('../Tin_Boxes_1900-1960_files/tin81.jpg', '315', '570', 'At less than 3” long, this is one of the smallest commercial tin cigar boxes.  Fact. 493 Maryland\nabout 1920. That’s a nickel. A box may have\nsold for no more than that.\n[2981]');
slides[23] = new Slide('../Tin_Boxes_1900-1960_files/boxtype4324.jpg', '270', '570', 'A distinctively shaped 1920’s  tin slide box used\nby a handful of brands, SAY-SO and AS YOU LIKE IT being the most often found.\n[4324]');
slides[24] = new Slide('../Tin_Boxes_1900-1960_files/cdb60.jpg', '422', '566', 'Barnes, Smith Co. added a match striker to the\nback of their 50¢ hinged 10/5 tin of Junior size (c4”) cigars made in Fact. 324, 21st NY (Binghamton) around 1920.\n[3560]');
slides[25] = new Slide('../Tin_Boxes_1900-1960_files/tin70.jpg', '734', '485', 'Clever hinged tin 5/5 bulbous in the middle to accommodate similarly shaped cigars made by \nW.K. Gresh (Fact.1839, 1st PA) around 1915.\n[2970]');
slides[26] = new Slide('../Tin_Boxes_1900-1960_files/tintoo67.jpg', '612', '800', 'Its poor condition would normally preclude display, but this odd once-lovely mid 1920’s tin was used by General Cigar to hold 50 of their ROBT BURNS\nmaking it of some note.\n[3167]');
slides[27] = new Slide('../Tin_Boxes_1900-1960_files/tintoo68.jpg', '800', '711', 'Two dividers, three compartments, fifty cigars.\nHow would you have packed them?\n[3168]');
slides[28] = new Slide('../Tin_Boxes_1900-1960_files/tin23.jpg', '337', '570', 'Wow.  A lovely portrayal of Julia Marlowe playing Juliet on broadway. I don’t know what it has to do with cigars but it’s a good looking tin.  \n[2923] Curator’s favorite.\n');
slides[29] = new Slide('../Tin_Boxes_1900-1960_files/tin24.jpg', '370', '570', 'Lithoed inside as well. Cigars were made in \nFact. 24, IRD 17. The guarantee is signed\nGranda Hermanos y Ca.  c1920.\n[2924]');
slides[30] = new Slide('../Tin_Boxes_1900-1960_files/tin55.jpg', '408', '570', 'Very colorful hinged tin 50/13 lithoed inside as well.\nUsed in the 1920’s by Nathan Elson & Co. in \nNew Orleans (Fact. 44 Louisiana). \nFairly common, and very lovely.\n[2955]');
slides[31] = new Slide('../Tin_Boxes_1900-1960_files/tin56.jpg', '422', '447', '\n[2956]');
slides[32] = new Slide('../Tin_Boxes_1900-1960_files/tin58.jpg', '422', '558', 'Same theme on the  hinged 10/5, but without the gun toting rider.  Same maker.\n[2958]');
slides[33] = new Slide('../Tin_Boxes_1900-1960_files/tin57.jpg', '422', '462', 'The rider is inside, an extravagance if these are marketed by the box, but ideal if the intent was\nto display them open on a countertop.\nMarketing genius or wastefulness?\n[2957]');
slides[34] = new Slide('../Tin_Boxes_1900-1960_files/tintoo83.jpg', '800', '565', '1928 American Can Company ad featuring\none of the late 1920’s more popular cigars\nand box designs. \n[3183]');
slides[35] = new Slide('../Tin_Boxes_1900-1960_files/71cincoAJG79.jpg', '541', '800', 'Eisenlohr’s best selling brand had been packed in\ntin before. Major brand, major player, late 1920’s.\n[7179]');
slides[36] = new Slide('../Tin_Boxes_1900-1960_files/tin77.jpg', '297', '570', 'Similar tin using the same dies held cigars given\naway at a convention in 1931.\n[2977]');
slides[37] = new Slide('../Tin_Boxes_1900-1960_files/tin28.jpg', '373', '570', 'Lovely 11.5” wide Canco tin used  by \nFact. 1288, 1st District of PA in the 1920’s\nto retail 100 cigars, they hoped by the box.\n[2928]');
slides[38] = new Slide('../Tin_Boxes_1900-1960_files/tin60.jpg', '535', '734', 'Effective use of three colors on a hinged tin 25/5 box from the 1920’s. “Hand production means perfection” is the slogan. Fact. 435 Boston Mass.\n[2960]');
slides[39] = new Slide('../Tin_Boxes_1900-1960_files/tincan95.jpg', '422', '530', 'Arts and literature have been themes since the 1830’s. Authors, performers and characters all made it onto cigar labels. More often than not, paper labels were used on rather plain stock boxes, this time by Fact. 1726, 1st PA in the 1920’s.  [3095]');
slides[40] = new Slide('../Tin_Boxes_1900-1960_files/tintoo57.jpg', '786', '800', 'The most famous most recognizable brand ever packed in tin boxes of 50. To visit an exhibit of Bayuk PHILLIES click at the top of the page.\nTin use fell dramatically in the 1930’s and 40’s\ntho Bayuk continued up to WWII. [3157]');
slides[41] = new Slide('../Tin_Boxes_1900-1960_files/100059_1_md.jpg', '217', '282', 'BUCK, CREMO, HERALD are among the giant trunks that turn up regularly. These railroad shipping containers held 5000 cigars and were supposed to be returned, but when the brands were discontinued\nin the 1930’s wholesalers and retailers kept them. ');
slides[42] = new Slide('../Tin_Boxes_1900-1960_files/tintoo41.jpg', '626', '600', 'BERING Admirals attractive 25/5 chest is in\nan old tradition, but done with a modern flair.\nOne of three distinctive tins the company used\nin the late 1950’s and early 60’s.\n[3141]');
slides[43] = new Slide('../Tin_Boxes_1900-1960_files/tintoo43.jpg', '497', '668', 'BERING Regal from after 1960.\nAnother attractive package.\n[3143]\n');
slides[44] = new Slide('../Tin_Boxes_1900-1960_files/tintoo44.jpg', '668', '578', 'BERING Regal from after 1960.\nVery attractive in my opinion.\n[3144]\n');
slides[45] = new Slide('../Tin_Boxes_1900-1960_files/tintoo42.jpg', '484', '668', 'BERING Galleons is a worthy late 1950’s addition into the cigar box hall of fame. \nI bought this box new. Corrosion is the result of living 50 feet from the Pacific and forces me to \nde-accession all tin, leather and brass.  [3142]');
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");
    adjustLineHeightIfTooBig("id3");
    adjustFontSizeIfTooBig("id3");
    fixupAllIEPNGBGs();
    fixupIEPNG("id4", "Tin_Boxes_1900-1960_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;
    }
}

