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_1870-1900_files/events6.jpg', '409', '734', 'Hand-soldered tin box with printed edging, latch, wooden bottom, ventilation holes and a paper inner label.  Shipped March 1877 by Sutro & Newmark, one of the NY City giants with 300+ rollers.\n[2206]');
slides[1] = new Slide('../Tin_Boxes_1870-1900_files/events7.jpg', '570', '680', 'Pictures Tilden, loser in 1876, supported by Irish and Hayes pushed by blacks. See the Exhibit of Election boxes for more information about this.\n[2207]');
slides[2] = new Slide('../Tin_Boxes_1870-1900_files/events8.jpg', '479', '734', 'Some tin boxes made 1870-1880 had wood bottoms  providing place for ID, color mark and Caution Notice. March 8, 1877 cancellation makes this the earliest accurately dated tin box I’ve seen.\n[2208]');
slides[3] = new Slide('../Tin_Boxes_1870-1900_files/boxpatents5249.jpg', '422', '734', '1877 patent for providing ventilation in tin boxes \nso that cigars packed moist don’t rot. Also removes “the objectionable appearance there is to the common sheet tin cigar boxes” and provides\nwooden bottom for application of the ID.  [5249]');
slides[4] = new Slide('../Tin_Boxes_1870-1900_files/10985.jpg', '414', '600', 'Despite the patent and all the efforts to lithograph on tin, the “objectionable appearance” of sheet tin cigar boxes remained common in 1887. The ID is hand die stamped into the lower right corner of the lid.\n[10985]');
slides[5] = new Slide('../Tin_Boxes_1870-1900_files/10982.jpg', '553', '600', 'Lee H. Stump of Avon, Illinois, used his name as a design theme. Paper label in an all tin box. Fact. 124, 8th Dist. Ill, had 5 rollers during peak months.\n[10982]');
slides[6] = new Slide('../Tin_Boxes_1870-1900_files/tin35.jpg', '570', '642', 'Hand soldered Dutch cigar box probably from early 1880’s depicting two negro youth smokers with the flag as background, perhaps celebrating the end of slavery. The brand NEGERTIES lasted for decades.\n[2935]');
slides[7] = new Slide('../Tin_Boxes_1870-1900_files/thirties8567.jpg', '570', '630', 'Thos. H. Hall’s BETWEEN THE ACTS “all-tobacco cigarettes” were sold in tin 10/5 boxes long before legal by packing them in larger boxes of 100 or 200 upon which tax stamps could be affixed.\n[8567]');
slides[8] = new Slide('../Tin_Boxes_1870-1900_files/thirties8565.jpg', '623', '570', 'What could be more logical than picturing an actress on BETWEEN THE ACTS?  Entertainers like Minnie Cummings have been featured on cigar labels since Fanny Elssler graced a Cuban label in the 1840’s.\nThat’s a 5¢ coin to show size. [8565]');
slides[9] = new Slide('../Tin_Boxes_1870-1900_files/thirties8566.jpg', '734', '469', 'This exquisite Ginna tin demonstrates how fine tin boxes were in the 1880’s. ID and Caution Notice was not required as it wasn’t a box allowed by law. All Tobacco cigarettes was a euphemism for cigars.\nCurator’s favorite   [8566]');
slides[10] = new Slide('../Tin_Boxes_1870-1900_files/tin26.jpg', '553', '734', 'Large tobacco-bale shaped tin box patented 1875 used in 1894 by S. Jacoby Fact. 3, 3rd NY City.\nTin boxes of 250 are very rare, especially in fine condition. Box measures 9” x 8” x 4.5”\n[2926]');
slides[11] = new Slide('../Tin_Boxes_1870-1900_files/tin27.jpg', '484', '734', 'Decorated bottoms are typical of early tin boxes.\nHigh quality tin made by Somers Bros.\n[2927]');
slides[12] = new Slide('../Tin_Boxes_1870-1900_files/tin16.jpg', '453', '734', 'Finely detailed 3-color printing job by Isley & Co., NYC, on this 50/13 tin for Steinecke & Kerr Fact. 120, 3rd NY City in 1888.  An exquisite box.\n[2916]');
slides[13] = new Slide('../Tin_Boxes_1870-1900_files/tin19.jpg', '465', '734', 'Lengthy explanation about why the company\nchose to pack in tin boxes.\n[2919]');
slides[14] = new Slide('../Tin_Boxes_1870-1900_files/tin17.jpg', '441', '734', 'Mind-blowing example of 19th century cigar box design by an unknown tin company, c1895, for Haas Bros. Cigar Co. in Cincinnati, a major cigar center.\n[2217]');
slides[15] = new Slide('../Tin_Boxes_1870-1900_files/tin18.jpg', '434', '734', 'Multi-color printed inside label in classic 1870’s style in perfect condition. The tin printers of the 19th century were exceptionally good.\n[2918]');
slides[16] = new Slide('../Tin_Boxes_1870-1900_files/31tintoo6.jpg', '375', '425', 'Cigar giant Straiton & Storm began using these charming tin boxes of 25 around 1890. At least a half dozen different brands were packed this way. \nS & S created ROBT. BURNS and OWL brands\nand eventually became General Cigar Co.  [3106]');
slides[17] = new Slide('../Tin_Boxes_1870-1900_files/9272.jpg', '570', '634', 'Sadly, the reds and blues on these tins are very subject to sun damage. One hour outdoors can be sufficient to ruin the original color. They were never printed in pink and grey.\n[9272]');
slides[18] = new Slide('../Tin_Boxes_1870-1900_files/cdb92.jpg', '668', '570', 'These lovely tin 25’s are found with paper label inners and with lithographed interiors. There \nappear to be a number of variations of both, generally involving young girls.\n[3592]');
slides[19] = new Slide('../Tin_Boxes_1870-1900_files/cdb93.jpg', '303', '800', 'Factory 11, 3rd District of New York (Central and lower Manhattan) was the main factory of Straiton & Storm, employers of 1,000+ people, including \nlabor leader Samuel Gompers. \nStandard 1880-1957 Caution Notice.  [3593]\n');
slides[20] = new Slide('../Tin_Boxes_1870-1900_files/tin15.jpg', '385', '734', 'Unusual box of 25 jumbo-size 11” long cigars. \nOversize novelty cigars were taxed as tobacco, \na tax law still in effect in the 1950’s. Cigars laid\ncrossways, side to side, in the box. \n[2915]');
slides[21] = new Slide('../Tin_Boxes_1870-1900_files/tin21.jpg', '371', '734', 'Cigars by Detroit Cigar Mfg. Co., Factory 2, 1st MI located at 48 E. Congress. Made for local retailer.\nRare tin by Norton Bros. Press, Chicago.\n[2921]');
slides[22] = new Slide('../Tin_Boxes_1870-1900_files/tin20.jpg', '220', '734', 'The Cation Notice refers to the “tobacco herein contained” rather than cigars, proof they were\noversize novelties.\n[2920]');
slides[23] = new Slide('../Tin_Boxes_1870-1900_files/tin38.jpg', '373', '734', 'Distinctive, but not especially attractive, box \nwith no less than  six slogans!  \nFact. 145, 8th Illinois.  c1900\n[2938]');
slides[24] = new Slide('../Tin_Boxes_1870-1900_files/tin37.jpg', '425', '734', 'Stickers of any type are dangerous on early tin.\n[2937]');
slides[25] = new Slide('../Tin_Boxes_1870-1900_files/tin36.jpg', '425', '734', 'The stamp did a near perfect job of lifting the ink.\nInk adhesion was the printer’s greatest difficulty.\n[2936]');
slides[26] = new Slide('../Tin_Boxes_1870-1900_files/misc8860.jpg', '717', '570', 'Unusual lithographed slip-cover for cardboard boxes\nof 10 small cigars. If you have an ad showing how these were obtained by smokers please\ncontact me via the NCM.\n[8860]');
slides[27] = new Slide('../Tin_Boxes_1870-1900_files/tin25.jpg', '467', '734', 'Some of the world’s finest tin cigar boxes come from the Netherlands, 19th century center of European cigar production. You’ll enjoy the exhibits of \nDutch tin.\n[2925]');
slides[28] = new Slide('../Tin_Boxes_1870-1900_files/30tincan91.jpg', '734', '483', 'Construction detail of 1880’s tin box. Joints slid together very sturdily. Over-engineered.\n[3091]');
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("id3");
    adjustFontSizeIfTooBig("id3");
    fixupAllIEPNGBGs();
    fixupIEPNG("id2", "Tin_Boxes_1870-1900_files/transparent.gif");
    fixupIEPNG("id4", "Tin_Boxes_1870-1900_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;
    }
}


