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('../Small-town_choices_files/colusa902.jpg', '433', '482', 'PRINCESS. Made by Hoenes & Kirschner, Colusa, according to the overprint, Factory 211, 1890. Four of these boxes with minor variations, indicating different printing lots were found.\n[9002]');
slides[1] = new Slide('../Small-town_choices_files/colusa908.jpg', '433', '463', 'MANUEL GARCIA ALONSO brand name and a Cuban address and design, but made by Hoenes & Kirschner, Colusa, c1890, in Fact. 211.\n[9008]');
slides[2] = new Slide('../Small-town_choices_files/colusa9014.jpg', '433', '572', 'SILVER QUEEN  Ordinary “pretty girl” label used on yet another brand by Hoenes & Kirschner sold in Colusa in the 1880s.\n[9014]');
slides[3] = new Slide('../Small-town_choices_files/colusa9015.jpg', '407', '600', 'KEY WEST  Ordinary “Spanish pretty girl” label used on yet another brand by Hoenes & Kirschner sold in Colusa in the 1880s. Cigars made in Key West were regarded as the best outside Havana, with the benefit of being cheaper...so the name appears\neverywhere, even in a small farm town.  [9015]');
slides[4] = new Slide('../Small-town_choices_files/colusa9012.jpg', '426', '600', ' LA ESTRELLA  This Fact. 211, Colusa, brand was a direct knock-off of the well-known LA ESTRELLA brand made by Eduardo Gato in Key West, FL, which was also sold in Colusa. See next.\n[9012]');
slides[5] = new Slide('../Small-town_choices_files/colusa9045.jpg', '369', '600', 'LA ESTRELLA  The original, one of the few brands famous enough to have coast to coast distribution. Cigars by Eduardo H. Gato, Fact. 38, Key West, Florida, in the very early 1890s.\n[9045]');
slides[6] = new Slide('../Small-town_choices_files/colusa9013.jpg', '417', '600', 'AEOLIAN  Semi-languishing “pretty girl” label used on yet another brand by Hoenes & Kirschner \nsold in Colusa in the 1880s. \n[9013]');
slides[7] = new Slide('../Small-town_choices_files/colusa9024.jpg', '433', '439', 'ROUGH & READY  “Pretty girl” label doesn’t fit the brand name. Cigars made at 730 Pacific St. in San Francisco by Wong, White & Co. were sold in Colusa during the 1890s. Name was a knock-off of the well-known Cuban READY & ROUGH.\n[9024]');
slides[8] = new Slide('../Small-town_choices_files/colusa9023.jpg', '428', '600', 'MORNING GLORY  “Pretty girl” and flowers label for cigars made at 219 Battery St. in San Francisco by E. Goslinski & Co. in 1876. Fact. 71, 1st Calif was one of SF’s fifteen cigar factories employing 100 or more rollers in the 1880’s.\n[9023]');
slides[9] = new Slide('../Small-town_choices_files/colusa9027.jpg', '347', '600', 'RED TAPE  Early and rare box with cigars by Beverleigh & Co. [n.p.] and label printed by Korbel of later wine fame. 1876 cancelation, two years before some historians have Korbel opening. \nTiny CN. Crude drawing of Indian Wars. \n[9027]');
slides[10] = new Slide('../Small-town_choices_files/colusa9022.jpg', '433', '435', 'LA NATIVIDAD  Earliest example yet found of this long-lived important California brand. Only one made by Frankel, Gerdts & Co. in Fact. 124, 1st CA, located at 244 Fremont, in San Francisco. 1904\n[9022]');
slides[11] = new Slide('../Small-town_choices_files/colusa9031.jpg', '433', '514', 'The Dixie Chicks, 1902 version. Attractive box made by D. Eisner, 404 Clay St., San Francisco in\nFact. 26, 1st CA, and sold in Colusa.\n[9031]');
slides[12] = new Slide('../Small-town_choices_files/colusa9030.jpg', '433', '543', 'SULTANA  Box canceled 1891 was made in Factory 309, 1st Calif, which is unlisted in 1886 and 1893, suggesting it was very short-lived, typical of cigar\nfactories and many other businesses.\n[9030]');
slides[13] = new Slide('../Small-town_choices_files/colusa9032.jpg', '433', '547', 'MATADOR  Stock label with incongruent brand name added later.  Cigars made in Chinese factory owned by Hing Yee at 649 Clay St. in San Francisco, whose company is listed in 1893, not in 1886.\n[9032]');
slides[14] = new Slide('../Small-town_choices_files/colusa9033.jpg', '354', '600', 'VALLE Y SUAREZ  Important Cuban company, makers of FLOR DE CUBA and JOCKEY CLUB in Havana. Did they own this factory or license the name or were they victims of identity-theft. \nSan Francisco factory 380 in 1881.\n[9033]');
slides[15] = new Slide('../Small-town_choices_files/colusa9066.jpg', '433', '519', 'BOUQUET DE TOBACOS de F. PEREZ DEL RIO.\nOne of 1870’s Cuba’s more important makers licensed factories in San Francisco, including numbers 71, 175 and 349 to make his brands.\n[9066]');
slides[16] = new Slide('../Small-town_choices_files/colusa9044.jpg', '433', '485', 'LA ESTRELLA  The original, one of the few brands famous enough to have coast to coast distribution. Cigars by Eduardo H. Gato, Fact. 38, Key West, Florida, in the very early 1890s.\n[9044]');
slides[17] = new Slide('../Small-town_choices_files/colusa9050.jpg', '587', '433', 'LA ESTRELLA boxes showing a selection of the vitolas (front marks) sold in Colusa.  \n[9050]');
slides[18] = new Slide('../Small-town_choices_files/colusa9036.jpg', '433', '510', 'FLOR DE MANUEL GARCIA was made in Key West, Florida, by Sideman, Lachman & Co. in their\nFactory 157, FL, bonded for 100 rollers.\n[9036]');
slides[19] = new Slide('../Small-town_choices_files/colusa9034.jpg', '345', '600', 'OPTIMO  A. Santaella y Ca.’s long lived brand was among those rescued from Colusa. c1907.\nFactory 114, Tampa, Florida.  \n[9034]');
slides[20] = new Slide('../Small-town_choices_files/colusa9041.jpg', '432', '523', 'Another Florida cigar, made for Seidenberg & Co. in the factory of Fernandez, Wodiska & Ca. (that later became Corral Wodiska, famous maker of BERING.)\nFact. 8, Tampa, Florida. 1898.   [9041]');
slides[21] = new Slide('../Small-town_choices_files/colusa9053.jpg', '433', '441', 'One of many brands with this name, these were made by Cook, Strickland & Co., a Binghamton, NY factory that rolled 90,000 cigars a day. Fact. 548, 21st Dist. Open in 1886, shut down by 1893.\n[9053]');
slides[22] = new Slide('../Small-town_choices_files/colusa9056.jpg', '433', '464', 'Cuban scene, nail tag reads: Juan Enriquez Cerrojo but the cigars were made in the 200 roller factory\nof Boltz-Clymer Co., 15th & Lehigh in Philadelphia.\nFactory Number 2715, 1st Dist. PA  1898.\n[9056]');
slides[23] = new Slide('../Small-town_choices_files/colusa9060.jpg', '433', '505', 'No surprise to find giant cigar maker Kerbs, Wertheim & Schiffer’s heavily advertised GENERAL ARTHUR among the brands being sold in 1897. Made in Fact. 1116, 3rd New York City.\n[9060]');
slides[24] = new Slide('../Small-town_choices_files/colusa9063.jpg', '433', '483', 'Robert Mantell joined the ranks of hundreds of stage actors and actresses honored with a cigar box appearance. Cigars made by T.J. Dunn & Co.,\n210 N. Broad St., Philadelphia mid 1890’s.\n[9063]');
slides[25] = new Slide('../Small-town_choices_files/colusa9075.jpg', '433', '491', 'Very rare Cuban H. UPMANN from 1893 with newly required hand stamped place of origin on the front.\nUnusual Castelares frontmark. [9075]');
slides[26] = new Slide('../Small-town_choices_files/colusa9080.jpg', '378', '600', 'Pre 1893 BOCK Y CA. El AGUILA de ORO, another important Cuban brand being smoked in Colusa. \n[9080]');
slides[27] = new Slide('../Small-town_choices_files/colusa9070.jpg', '432', '494', 'Rare and desirable Cuban ALEXANDER HUMBOLDT brand created for the California market\nand annexed by Joaquin Arguelles who \nmade the brand in the 1870’s and 80’s..\nIn addition to a cigar, a county and college were named for this scientist-explorer. [9070]');
slides[28] = new Slide('../Small-town_choices_files/colusa9087.jpg', '388', '600', 'Made by Tomas Diaz, this Cuban brand enjoyed international success for a few decades, including\nbeing sold in Colusa, 1887. Later (1901) made by Diaz, Valdez y Ca.\n[9087]');
slides[29] = new Slide('../Small-town_choices_files/colusa9082.jpg', '384', '600', 'LA TRAVIATA was a minor Cuban export brand of Fernandez, Garcia y Hijos when this was made (1901-1904). \n[9082]');
slides[30] = new Slide('../Small-town_choices_files/colusa9084.jpg', '433', '536', 'LA SUPERIOR Conchas  finas. The maker of this minor 1887 Cuban brand is not known. \nMarca contains a RC monogram.\n[9084]');
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");
    adjustLineHeightIfTooBig("id4");
    adjustFontSizeIfTooBig("id4");
    fixupAllIEPNGBGs();
    fixupIEPNG("id1", "Small-town_choices_files/transparent.gif");
    fixupIEPNG("id5", "Small-town_choices_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;
    }
}


