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('../Boxes_of_250_files/11036.jpg', '644', '800', 'One of the most common 250’s, here with nailed dropfront. P.Whitlock sold to American Tobacco Co. mid 1890’s who transferred it to American Cigar Co. c.1905 who passed the brand to P.Lorillard in 1911.\nLorillard offered the brand until WWII.  [11036]');
slides[1] = new Slide('../Boxes_of_250_files/11038.jpg', '550', '800', 'Few 250’s had end labels, since boxes this large were rarely stacked on shelves in such a way they could be seen. The cigar industry was never one for unnecessary expense.  This is by American\nTobacco Co. in 1898. [11038]');
slides[2] = new Slide('../Boxes_of_250_files/10726.jpg', '399', '594', 'Named after a popular political issue of the day.\nVery typical simple text B/W inner and drop labels. Cigars by Shearer & Co., Windsor, PA \nFactory 738, 9th PA, 1901.\n[10726]');
slides[3] = new Slide('../Boxes_of_250_files/biglittle445.jpg', '607', '800', 'Pictorial B/W inner of children smoking while sledding makes this a prize for collectors.\nCigars by Heed Bros., Barnesville, Ohio\nFactory 17, 18th tax district Ohio, 1893.\n[4405]');
slides[4] = new Slide('../Boxes_of_250_files/biglittle442.jpg', '519', '800', 'First 250 I owned (1955). Cigars by large (200 roller) Cincinnati factory specializing in cheap cigars, \nRoth, Bruner & Feist, Fact. 387, 1st Ohio, c1888.\nCigars cost 3/5¢.\n[4402]');
slides[5] = new Slide('../Boxes_of_250_files/biglittle443.jpg', '534', '800', 'Another Roth, Bruner & Feist brand. Label printed in red, blue and silver, late 1890’s. Box of 200. Smaller (25) boxes of these were given away when dealers\nbought WAR EAGLE cheroots. These were bundled\n5 to a package for a dime.  [4403]');
slides[6] = new Slide('../Boxes_of_250_files/tintoo20.jpg', '537', '800', 'Dramatic full color label depicting the just completed Spanish-American War highlights these cheroots. \nAnother Roth, Bruner & Feist 3/5¢ brand made in \ntheir Fact. 387 in Cincinnati. 1899\n[3120]');
slides[7] = new Slide('../Boxes_of_250_files/biglittle447.jpg', '356', '800', 'Roth, Bruner & Feist box of 250, 1890’s.\nWhen a number is part of a brand name it almost always means the cigars were sold in bundles that size. The 3/5¢ pricing confirms it in this case.\n[4407]');
slides[8] = new Slide('../Boxes_of_250_files/biglittle4431.jpg', '483', '800', 'W.H. Kildow of Tiffin, Ohio, was another good-sized maker of cheap cigars in the 1890’s.\nFact. 215, 10th Ohio\n[4431]');
slides[9] = new Slide('../Boxes_of_250_files/biglittle4422.jpg', '560', '800', 'A classic American advertising theme. Simple but strong graphic appeal. Cheap B/W label.\nSwisher Bros., Fact. 59, 11th Columbus, OH, 1899.\nA curator’s favorite.\n[4422]');
slides[10] = new Slide('../Boxes_of_250_files/biglittle449.jpg', '535', '800', 'Another Swisher Bros. product, these made in \nFact. 15, 11th Ohio (Newark) c1895.\nNote the cute pricing: 345 (3/5¢).\n[4409]');
slides[11] = new Slide('../Boxes_of_250_files/biglittle448.jpg', '521', '800', 'Distinctive label printed in only three colors. Cigars by J.F. Cherry, Newark, Ohio Fact. 143 10th OH.\n3/5¢ cigars, c.1905.\n[4408]');
slides[12] = new Slide('../Boxes_of_250_files/073106.jpg', '269', '390', 'A lovely Ohio dropfront that’s been nailed shut.\nIn my opinion one of the most attractive\n250 boxes ever marketed. 1898\nNot in the NCM collection.\n[w73106]');
slides[13] = new Slide('../Boxes_of_250_files/DSC08634.jpg', '492', '589', 'Another of the more colorful Ohio 250’s.\nNot in the NCM collection.\n[w08634]');
slides[14] = new Slide('../Boxes_of_250_files/Roadmen.jpg', '237', '314', 'Hoboes and salesmen, two kinds of roadmen\nfeatured on this 250 dropfront with an\ninexpensive three color label.\nNot in the NCM collection.\n[w0250]');
slides[15] = new Slide('../Boxes_of_250_files/bad11.jpg', '377', '661', 'Deserving to be included in the exhibit of bad brand names, loose labels for 250 boxes are rarely found because of their size. The word “Segarros” is a meaningless misspelling. The packs of 3 cigars are a good example of cheap cigar packing. [1611]');
slides[16] = new Slide('../Boxes_of_250_files/biglittle4418.jpg', '369', '800', 'Down town Pittsburgh and the confluence of the two rivers. The catalog illus of this box is pictured\nin the introduction to this exhibit. Pittsburgh was home to many stogie and toby makers.\nFact. 231, 23rd PA.  [4418]');
slides[17] = new Slide('../Boxes_of_250_files/biglittle4416.jpg', '383', '800', 'Another Pittsburgh cheapie, this made by Collins Cigar Co., Pittsburgh, Fact. 6, 23rd PA. This same dramatic, but monochromatic, graphic appears with names of other cities.\n[4416]');
slides[18] = new Slide('../Boxes_of_250_files/biglittle4419.jpg', '511', '800', 'Another Pittsburgh box with plain monochromatic label typical of boxes of 250 cigars. Monochromes don’t dominate this exhibit only because the NCM rarely buys them. Fact. 470, 23rd PA. Floto Bros, Meyersdale, PA 1900     [4419]');
slides[19] = new Slide('../Boxes_of_250_files/bad69.jpg', '644', '800', 'This box is covered, front, back, top and inside with this monochromatic racist label of boys chasing a cigar butt lying in the street. Another Collins Cigar made in Fact. 6, 23rd PA. 3/5¢ 1899.\n[1669]');
slides[20] = new Slide('../Boxes_of_250_files/bad78.jpg', '465', '800', 'J.H. Lucke, one of Cincinnati’s largest factories, used this racist monochromatic box for its 3/5¢\ncigars in 1903.  Fact. 567, 1st Dist. Ohio.\n[1678]');
slides[21] = new Slide('../Boxes_of_250_files/frog 250.jpg', '528', '800', 'Keystone Cheroot Co., Fact. 2230, 9th PA, in Hanover used this around 1902. Note how a label designed for a 50 box doesn’t fit a 250, emphasizing the difference in counter space they take up.\n[N0250]');
slides[22] = new Slide('../Boxes_of_250_files/biglittle4412.jpg', '363', '800', 'A standard 50 box inner looks lonely on this extra long 16” wide 250. Cigars by Sutro & Newmark, whose 1000 roller Fact. 412 in NYC was one of the nation’s largest, 1880’s.\n[4412]');
slides[23] = new Slide('../Boxes_of_250_files/64vanity58.jpg', '454', '800', 'Another example of the loneliness of a 50 box label on a 250 box. Vanity labels are rare on large boxes.\nJ.H. Lucke’s 100 roller Fact 567 in Cincinnati, 1st tax Dist. OH, c1904.\n[6458]');
slides[24] = new Slide('../Boxes_of_250_files/64vanity94.jpg', '276', '800', 'Very long at 18+ inches, the box is unusual in using a real photo on photo paper as a label. Pictures hotel, staff, and station-vehicles. Rare too as it’s not a dropfront. Fact. 11, 9th PA (Warren Beck) c1890. The 2nd 250 box in the NCM.  [6494]');
slides[25] = new Slide('../Boxes_of_250_files/biglittle4424.jpg', '601', '800', 'Important maker W.H. Lucke’s knockoff of the popular OLD VIRGINIA CHEROOTS sold for 3/5¢.\nDropfront is larger than most, demanding space in front of the box. A “space hog” disliked by retailers.\nFact. 567, 1st OH Cincinnati, c1905.  [4424]');
slides[26] = new Slide('../Boxes_of_250_files/UnNamed71.jpg', '590', '800', 'Unusual dropfront that lies flat would have been hated by retailers, most of them ripped off to avoid giving up wasted space in a counter. Early 1880’s. Patented box with catches at both top corners.\n[3371]');
slides[27] = new Slide('../Boxes_of_250_files/biglittle4421.jpg', '418', '800', 'This colorful patriotic 250 held 5¢ cigars made by S. Hernsheim’s La Belle Creole cigar factory in New Orleans who claimed in 1894 to have the nation’s largest output.  Fact. 511 Louisiana made for Chicago wholesaler Durand & Kasper.  [4421]');
slides[28] = new Slide('../Boxes_of_250_files/biglittle4414.jpg', '471', '800', 'Extra large box and label highlight this box.\nFact. 1396. 9th PA, c1903.  Cigars possibly made\nby W.H. Riddle, Holtz, and sold for 5 for 10¢.\n[4414]');
slides[29] = new Slide('../Boxes_of_250_files/biglittle4413.jpg', '422', '800', 'Cheroots in this two color labeled box were made in Fact. 61, 2nd Virginia by the Try-Angle Cigar & Cheroot Co, Richmond, VA.  c1890. Cheroots and stogies are specific types of cigar, not accurate synonyms for cigar, though used that way.  [4413]');
slides[30] = new Slide('../Boxes_of_250_files/biglittle4410.jpg', '582', '800', 'Plain two color label used by the Orrison Cigar Co.\nof Bethesda, Ohio, Fact. 865, 18th OH, c.1915.\n[4410]');
slides[31] = new Slide('../Boxes_of_250_files/biglittle4490.jpg', '544', '800', 'Early (c1885) dropfront with simple Black/Gold label.\nExtra large dropfront panel is almost full size, making it one of those retailers hate. Metal clasps on front corners. Fact. 1795, 9th PA.\n[4490]');
slides[32] = new Slide('../Boxes_of_250_files/biglittle4415.jpg', '353', '800', 'Two color label used by unknown owner of Fact. 704, 23rd PA (Pittsburgh?} in late 1890’s, perhaps to celebrate the coming of electricity to a small town.\nNot a dropfront.\n[4415]');
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 onPageLoad()
{
    detectBrowser();
    adjustLineHeightIfTooBig("id2");
    adjustFontSizeIfTooBig("id2");
    adjustLineHeightIfTooBig("id3");
    adjustFontSizeIfTooBig("id3");
    fixupAllIEPNGBGs();
    fixupIEPNG("id1", "Boxes_of_250_files/transparent.gif");
    fixupIEPNG("id4", "Boxes_of_250_files/transparent.gif");
    return true;
}

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 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;
    }
}


