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('../Railroads_files/bj6224.jpg', '460', '534', 'Beautiful example of a railroad box from the late 1890’s. Cigars made in Fact. 1521, 21st NY, a small short-lived Union factory in the Southern Tier of NY.\n[6224]');
slides[1] = new Slide('../Railroads_files/bm6225.jpg', '461', '535', 'Another late 1890’s railroad box, these made by Doyle & Smith, Oneonta, NY, in Fact. 424, 21st Dist.\n[6225]');
slides[2] = new Slide('../Railroads_files/bf6222.jpg', '378', '600', 'Dramatic full color label appeared on a box of cigars made in Fact. 48, Massachusetts, in the late 1870’s,\n[6222]');
slides[3] = new Slide('../Railroads_files/thirties8560.jpg', '591', '800', 'Perhaps the finest, most detailed, gold on black label was printed by an unidentified Dayton, OH, printer (only the first name John is readable) in the 1880s for the Lenox Cigar Factory number 202, 10th District of Ohio. A stunning curator’s favorite.\n[8560]');
slides[4] = new Slide('../Railroads_files/bd6221.jpg', '461', '599', 'Box of 100 offered by Charles & Co. in the early 1880s. Cigars made by one of the 1,000+ small factories in Brooklyn, that of W.W. Haslam, whose 4 rollers worked in Fact. 999, 1st tax District located at 51 Myrtle Ave.\n[6221]');
slides[5] = new Slide('../Railroads_files/62themeCj37.jpg', '365', '800', 'According to the label D.H. McAlpin & Co. made these cheap cheroots packed in boxes of 250 some time between 1898-1901, though Directories of 1893 and 1905 don’t list the company or their \nFact. 22, 3rd District NYC. \n[6237]');
slides[6] = new Slide('../Railroads_files/62themeCj32.jpg', '600', '780', 'Beautiful 1900 style label depicting a parlor car was still being used by William Knoch in 1926. One more example why style of label is not a reliable indicator of the actual age of a box.\n[6232]');
slides[7] = new Slide('../Railroads_files/bh6239.jpg', '400', '600', 'Most desirable to many collectors are those boxes which name and picture a particular railroad. The owner of Fact. 2310 in the 9th tax district of PA \nis unknown. Box, label and edging style suggest \na mid 1880 use.\n[6239]\n\n');
slides[8] = new Slide('../Railroads_files/64vanity92.jpg', '600', '704', 'Vanity label used by Ferguson & Co. of Waverly, NY, depicts the Lehigh Valley Railroad that roared through that Southern Tier town. Fact. 239, 21st NY.\nThe train got the “black diamond express” nickname because of its anthracite coal cargo.\n[6492]');
slides[9] = new Slide('../Railroads_files/62themeCj40.jpg', '600', '713', 'This photo-like depiction honors the line that passed near the Albany, NY, factory of prominent cigar maker G.Van Slyke & Horton. Fact. 219, \n14th tax Dist., NY, in 1896.\n[6240]');
slides[10] = new Slide('../Railroads_files/62themeCj52.jpg', '600', '678', 'This 1943 tri-color box with its small vignette honors the Michigan Central’s “Niagara Falls Route” Cigars by W.R. Pettet in Saginaw, Michigan’s Factory 282. \n[6252]');
slides[11] = new Slide('../Railroads_files/62themeCj42.jpg', '600', '602', 'One of the nation’s better known railroads thanks to Penn Station, this rather plain box featuring the line’s logo. Cigars by Powell & Goldstein, Oneida, NY, whose 100+ rollers were responsible for dozens of brands. Unused pre 1910 box.\n[6242]');
slides[12] = new Slide('../Railroads_files/62themeCj50.jpg', '600', '740', 'California giant A. Sensenbrenner, packed their popular 15¢ SANTA FE Patties under a number of brand names including this railroad. \nFact. 110, 6th Dist. Calif, 1945.\n[6250]');
slides[13] = new Slide('../Railroads_files/62themeCj47.jpg', '600', '619', 'A. Sensenbrenner packed cigars for more than one California railroad. Fact. 110, 6th Dist. Calif, 1954.\n[6247]');
slides[14] = new Slide('../Railroads_files/62themeCj65.jpg', '800', '582', 'One of the three most common railroad brands, these were originally made by Binghamton’s \nHull Grummond Factory 227, 21st Dist. NY. \nThis 25/up paper label can is from 1923.\n[6265]');
slides[15] = new Slide('../Railroads_files/62themeCj67.jpg', '428', '800', 'The most frequently seen box versions are the NW12/4s and the NW10/5s. The 12 box was made by Hull, Grummond in 1913. The box on the right was made in the late 1920’s under contract by PA factory 583 in East Prospect, PA. Note the\ndropping of the hyphen on the later box. [6267]');
slides[16] = new Slide('../Railroads_files/CanOverland.jpg', '275', '354', 'Earliest type of engine depicted on an OVERLAND box, this from Canada. Very rare and desirable, this was made in Factory 12, IRD 17 by J.A. Hirsch\nin Montreal sometime between 1909 and 1911.  \nNot in the NCM collection.');
slides[17] = new Slide('../Railroads_files/d558_1.jpg', '300', '400', 'Another very rare version of the brand.\nDates and users unknown.\nNot in the NCM collection.');
slides[18] = new Slide('../Railroads_files/62themeCj55.jpg', '600', '678', 'In the U.S. the brand was made by D. Emil Klein Fact. 63, 2nd NYC, for Boston specialty retail chain \nS.S. Pierce. This steam train flanked by vignettes of Western scenes is the oldest known US version\nof the brand.  1923.\n[6255]');
slides[19] = new Slide('../Railroads_files/62themeCj58.jpg', '600', '678', 'Vignettes were dropped in later versions. This is one of the most common of all railroad brands. Still made by Klein at 444 E. 91st Street in NYC. 1946.\n[6258}');
slides[20] = new Slide('../Railroads_files/P1080081.jpg', '639', '501', 'Tin tri-color sign depicting the second of the OVERLAND trains is distinctive. 18” x 24”.\n[P80081]');
slides[21] = new Slide('../Railroads_files/cigtrain.jpg', '366', '513', 'Colorful 1920’s cardboard 5 pack without vignettes.\nNot in the NCM collection.');
slides[22] = new Slide('../Railroads_files/62themeCj59.jpg', '594', '800', 'By the mid 1950’s a diesel engine graced the label. Klein was out of business. Cigars were made in Waitt & Bond’s Scranton factory #1031.  1954.\n[6259]');
slides[23] = new Slide('../Railroads_files/62themeCj45.jpg', '600', '744', 'J. Whorley Neff & Co., Red Lion, PA, produced this nice looking railroad box in the mid-1930’s in \nFact. 533. 1st Dist. PA.  Nice looking presentation for cheap cigars. \n[6245]');
slides[24] = new Slide('../Railroads_files/62themeCj46.jpg', '536', '800', 'Top brand of previous. Horseshoe Curve is an engineering marvel through the Allegheny Mountains west of Altoona PA built by the Pennsylvania Railroad in the 1850s and now a National Historic Landmark.\n[6246]');
slides[25] = new Slide('../Railroads_files/P1080039_2.jpg', '477', '639', 'Cigar poster featuring Round Knob Cigars named for a mountain peak in North Carolina. Poster measures 16” x 20” and dates from the last quarter of the 19th century. \n[P80039]');
slides[26] = new Slide('../Railroads_files/P1080037_2.jpg', '359', '639', 'Round Knob was part of the scenery on the Western North Carolina Railroad “Land of the Sky” route. \nThe train is depicted on the cigar poster. \n[P80037]');
slides[27] = new Slide('../Railroads_files/62themeCj31.jpg', '600', '681', 'Attractive mid-1880’s box in beautiful condition honors the head of the Brotherhood of Locomotive Engineers, credited as being the oldest national labor union in the U.S.\n[6231]');
slides[28] = new Slide('../Railroads_files/62themeCj35.jpg', '600', '672', 'The Brotherhood of Railway Trainmen is featured on this 1917 box made by Frey & Conway, in Newark, NY, Factory 842, 21st District. These two boxes honor two of eight separate unions covering \nvarious railroad employees.\n[6235]');
slides[29] = new Slide('../Railroads_files/62themeCj61.jpg', '600', '699', 'One of the three common railroad brands. I don’t know when the brand was created, but this one was made in 1938 in Fact. 1171, Dallastown 1st PA by Druck & Co. Note the edging pictures a train.\n[6261]');
slides[30] = new Slide('../Railroads_files/62themeCj64.jpg', '600', '681', 'New versions are box wrapped, easily recognizable by the different edging. Made under contract in 1954 in Fact. 1289, Dallastown 1st PA by Peeler & Son.  \n[6264]');
slides[31] = new Slide('../Railroads_files/trainmaster.jpg', '356', '517', 'Not particularly interesting 1920’s packaging.\nNot in the NCM collection.\n[0000]');
slides[32] = new Slide('../Railroads_files/tintoo45.jpg', '800', '694', 'This tin 50/up is the more common version of \nthis brand’s tin packaging.\n[3145]');
slides[33] = new Slide('../Railroads_files/e96c_1.jpg', '335', '400', 'Cigar label for a railroad line. A box for this brand is not known. Not in the NCM collection.');
slides[34] = new Slide('../Railroads_files/62themeCj70.jpg', '720', '600', 'Small shallow glass ashtray lifted from one of the Southwest’s most famous rail lines.\n[6270]');
slides[35] = new Slide('../Railroads_files/12099.jpg', '392', '548', 'Metal rail shipping trunks for BUCK, CREMO, KING HERALD and others turn up regularly in the antiques market. Property of the Company (usually American Tobacco) to be returned, they were abandoned as the brands were discontinued. Roughly 1910-1938.\n[12099]');
slides[36] = new Slide('../Railroads_files/12262.jpg', '523', '571', 'Interior of previous. Trunks were designed\nto hold a few thousand cigars.\nNot in the NCM collection. \n[12262]');
slides[37] = new Slide('../Railroads_files/12261.jpg', '420', '523', 'The end of the CREMO trunk showing American Tobacco’s claim that the brand was the\n“Largest seller in the world.”\n[12261]');
slides[38] = new Slide('../Railroads_files/100059_1_md.jpg', '217', '282', 'More than 2,000 cigars could be shipped in one of these trunks. Neither of the two trunks seen here\nis in the NCM collection.\n[w0098]');
slides[39] = new Slide('../Railroads_files/62themeCj27.jpg', '605', '600', 'Beautiful condition 1884 box depicting a railroad map of the day (pictured in the introduction above). Cigars made in Fact. 32 (state obliterated). \nA gem of a box.  [6227]');
slides[40] = new Slide('../Railroads_files/62themeCj53.jpg', '600', '672', 'The famous Pullman car was depicted on this 1953 box holding cigars by the Pullman Cigar Co. in Roslindale, Mass., Fact. 347 Massachusetts.\n[6253]');
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");
    adjustLineHeightIfTooBig("id4");
    adjustFontSizeIfTooBig("id4");
    adjustLineHeightIfTooBig("id5");
    adjustFontSizeIfTooBig("id5");
    adjustLineHeightIfTooBig("id6");
    adjustFontSizeIfTooBig("id6");
    adjustLineHeightIfTooBig("id7");
    adjustFontSizeIfTooBig("id7");
    adjustLineHeightIfTooBig("id8");
    adjustFontSizeIfTooBig("id8");
    adjustLineHeightIfTooBig("id9");
    adjustFontSizeIfTooBig("id9");
    adjustLineHeightIfTooBig("id10");
    adjustFontSizeIfTooBig("id10");
    adjustLineHeightIfTooBig("id11");
    adjustFontSizeIfTooBig("id11");
    adjustLineHeightIfTooBig("id12");
    adjustFontSizeIfTooBig("id12");
    adjustLineHeightIfTooBig("id13");
    adjustFontSizeIfTooBig("id13");
    adjustLineHeightIfTooBig("id14");
    adjustFontSizeIfTooBig("id14");
    adjustLineHeightIfTooBig("id15");
    adjustFontSizeIfTooBig("id15");
    adjustLineHeightIfTooBig("id16");
    adjustFontSizeIfTooBig("id16");
    adjustLineHeightIfTooBig("id17");
    adjustFontSizeIfTooBig("id17");
    adjustLineHeightIfTooBig("id18");
    adjustFontSizeIfTooBig("id18");
    adjustLineHeightIfTooBig("id20");
    adjustFontSizeIfTooBig("id20");
    fixupAllIEPNGBGs();
    fixupIEPNG("id2", "Railroads_files/transparent.gif");
    fixupIEPNG("id19", "Railroads_files/transparent.gif");
    fixupIEPNG("id21", "Railroads_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;
    }
}

