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('../You_cant_say_that_files/titles01.jpg', '597', '801', '\n\n\n');
slides[1] = new Slide('../You_cant_say_that_files/biglittle4413.jpg', '422', '800', 'X-Rated products are popular today, but not openly in showcases.\n\nTry-Angle Cigar & Cheroot Co., Richmond. Fact. 61, 2nd VA. 1880’s.  [4413]');
slides[2] = new Slide('../You_cant_say_that_files/bad47.jpg', '610', '800', 'Name your cigar after things men like.\n\nJohn Fischer, Chicago, Fact. 241, 1st IL. \n1940’s.  [1647]');
slides[3] = new Slide('../You_cant_say_that_files/bad44.jpg', '739', '800', 'Most men liked this brand.\n\nK.H. Jacobs, Windsor  Fact. 492, 9th PA.\n[1644]');
slides[4] = new Slide('../You_cant_say_that_files/bad46.jpg', '668', '800', 'Every man likes this brand.\n\nGeo. P. Lies, Fact. 200, 3rd NYC  c1890\n[1646]');
slides[5] = new Slide('../You_cant_say_that_files/for web5.jpg', '328', '600', 'This brand wouldn’t last long today.\n\nC.W. Saunders Fact. 43, 1st (Coldwater) Mich.\nc1905.  [10224]');
slides[6] = new Slide('../You_cant_say_that_files/bad50.jpg', '748', '801', 'They say once you try one, you’re hooked.\n\nUncataloged. Ibold & Co., c.1950 [1650]');
slides[7] = new Slide('../You_cant_say_that_files/f6c6_1.jpg', '204', '310', 'Ibold’s cop out in later years; their gentrification, \nif you prefer.\nNot in the NCM collection.');
slides[8] = new Slide('../You_cant_say_that_files/bad48.jpg', '800', '708', '“You want a WHAT...?” \nIs this proof they’re made not born?\n\nHomo Cigar M’f’g Co., East Chicago, Indiana.\nFact. 32, 6th Dist. IN.  1918  [1648]');
slides[9] = new Slide('../You_cant_say_that_files/bad51.jpg', '662', '800', '“Who you calling a...?”\n\nYorkana Cigar Co., Fact. 1050, 9th (Yorkana) PA.\nc1905  [1651]');
slides[10] = new Slide('../You_cant_say_that_files/misc8810.jpg', '800', '520', '“Who you calling a ....?”\n\nBritish trade card for brand you won’t find today.\n[8810]');
slides[11] = new Slide('../You_cant_say_that_files/bad45.jpg', '600', '800', 'Today, the whole country gets their panties in a wad\nwhen two female singers peck on TV.\n\nFact. 249, 1st PA.  1917\n[1645]');
slides[12] = new Slide('../You_cant_say_that_files/for web3.jpg', '386', '600', 'Brand refers to both the horses and the women.  \n\n J.W. Minnich, Dallastown, Fact. 2411, 9th PA 1905. Bang has meant copulate since the 1600’s.    [10222]');
slides[13] = new Slide('../You_cant_say_that_files/26missed9.jpg', '587', '800', 'Niche marketing gives everyone his own brand. Once thought normal, it can put you in jail today. \n\nClarke, Smith & Co., Binghamton,  \nFact 1239, 21st NY   c1890   [2609]');
slides[14] = new Slide('../You_cant_say_that_files/bad52.jpg', '528', '800', 'How well would a brand called The Molester do today?  \nMarcelino Perez, Tampa, Fact. 176, Florida  c1920.   [1652]');
slides[15] = new Slide('../You_cant_say_that_files/10004.jpg', '631', '800', 'If you sew wild oats...\n\nA.P. Snader, Ephrata  Fact. 2319, 9th PA [10004]');
slides[16] = new Slide('../You_cant_say_that_files/bad38.jpg', '741', '800', '...you might get a hickey.\n\nPeter Jacobsen Cigar Co., Davenport, Fact. 203 IA for Hickey Bros Cigar Store Chain. [1638]');
slides[17] = new Slide('../You_cant_say_that_files/26missed8.jpg', '487', '800', 'Even better, you might get a ....\n\nHenry Haines, Maytown, Fact. 792, 9th PA., c1900. \n[2608]');
slides[18] = new Slide('../You_cant_say_that_files/26missed7.jpg', '447', '801', '...or a ...\n\nA. Lewis, Rensselaer, Fact. 69, 6th IN  c1890\n[2607]');
slides[19] = new Slide('../You_cant_say_that_files/labels4089.jpg', '489', '800', '...or better yet.\n\nPrinter’s stock label from catalog. [4089]');
slides[20] = new Slide('../You_cant_say_that_files/26missed14.jpg', '495', '800', 'Ta-ta meant good-bye but enuff of us old folks remember when it was part of a girl’s anatomy.\n\nSutro & Newmark, Fact. 723, 3rd NYC 1875  [2614]');
slides[21] = new Slide('../You_cant_say_that_files/biglittle4490.jpg', '544', '800', 'Only one? I think this word would be taboo just\nbecause every late night comedian would make fun.\n\nFact. 1745, 9th PA.  1880’s.   [4490]');
slides[22] = new Slide('../You_cant_say_that_files/77women25.jpg', '679', '800', 'White slave? As un-PC as can be. How long \ncould this be sold today?\n\nGeo. Oaks, Fact. 273, 1st Oshkosh, Wisconsin.\n[7725]');
slides[23] = new Slide('../You_cant_say_that_files/53629650_o.jpg', '480', '800', 'A woman served as dessert? Another brand that would raise more than a few hackles today.\n\nNot in the NCM collection.\nw0000');
slides[24] = new Slide('../You_cant_say_that_files/titles02.jpg', '598', '800', '');
slides[25] = new Slide('../You_cant_say_that_files/61mixA64.jpg', '462', '800', 'This brand was “Manufactured for the drug trade” \na claim not likely to win favor today.\n \nD.H. Salinger, Fact. 16, 3rd NYC    c1880  [6164]');
slides[26] = new Slide('../You_cant_say_that_files/26missed11.jpg', '530', '800', '“I want a fix” is not what manufacturers want to hear.\n\nLouis Thomas, Fact. 33, 3rd NYC  c.1884   [2611]');
slides[27] = new Slide('../You_cant_say_that_files/0857.jpg', '381', '599', 'Every drug used today had its cigar namesake which wouldn’t appear as a modern brand.\n\nFactory 302, 9th Dist. PA  c1915  [0857]');
slides[28] = new Slide('../You_cant_say_that_files/bad53.jpg', '690', '800', 'This might be a big seller today.\n\nJos. Bucher, Dayton, Fact. 604, 1st Ohio, 1898 [1653]');
slides[29] = new Slide('../You_cant_say_that_files/bad54.jpg', '800', '636', 'This one would probably sell well too.\n\nAlex Riston, Reynoldsville, Fact. 59, 23rd PA\nc1893   [1654]');
slides[30] = new Slide('../You_cant_say_that_files/10292.jpg', '566', '600', 'As would this.\n[10292]');
slides[31] = new Slide('../You_cant_say_that_files/bad55.jpg', '800', '599', 'Looks like the guy who designed this box was\nsampling the product.\n\nGlobe Tobacco, Detroit, Fact 832, MI c1885  [1655]');
slides[32] = new Slide('../You_cant_say_that_files/bad56.jpg', '504', '800', 'A brand the DEA wants to find.\n\nO.E. Diehl, Felton, Fact. 608, 9th PA c1904  [1656]');
slides[33] = new Slide('../You_cant_say_that_files/bad57.jpg', '800', '652', 'A stash-box package, but not publicly usable today.\n\nA.C. Henschel, Fact. 600 Minn. c1905  [1657]');
slides[34] = new Slide('../You_cant_say_that_files/bad58.jpg', '800', '529', 'Opium poppies would not find favor today.\n\nBarnes, Smith Co., Binghamton, Fact. 1239, \n21st NY  1912  [1658]');
slides[35] = new Slide('../You_cant_say_that_files/bad59.jpg', '593', '800', 'Kids dancing naked on extasy. Hmmm?\nIs there a less likely image to be used today?\n\nUncataloged lid only. c1876   [1659]');
slides[36] = new Slide('../You_cant_say_that_files/titles03.jpg', '600', '800', '');
slides[37] = new Slide('../You_cant_say_that_files/bad60.jpg', '800', '653', 'The Nazis ruined a great Indian symbol.\n\nLouis Heitman, Dayton, Fact. 701, 1st Ohio\nSalesman’s sample 12 box,  c.1905.  [1660]');
slides[38] = new Slide('../You_cant_say_that_files/10252.jpg', '800', '620', 'Some daring soul might name his cigar after sex or drugs, but this brand will never be seen again!\n\nH.J. Max, Quaker City, Fact. 202, 11th Ohio, c1900    [10252]');
slides[39] = new Slide('../You_cant_say_that_files/bad79.jpg', '545', '800', '“Smoke the WHITE CAP CIGAR or leave town.”\nThis qualifies as a 3rd brand you won’t see today. There’s no proof it was ever used. The only examples are found in printer’s catalogs; the label has never been found on a box. [1679]');
isPureISOLatin1 = true;
contentEncodingConstant = 4;
feedbackURL = "TODO";
showFeedbackButton = false;
feedbackEnabled = true;

var MINIMUM_FONT = "10";
var UNITS = "";

function elementFontSize(element)
{
    var fontSize = MINIMUM_FONT; 

    if (document.defaultView)
    {
        var computedStyle = document.defaultView.getComputedStyle(element, null);
        if (computedStyle)
        {
            fontSize = computedStyle.getPropertyValue("font-size");
        }
    }
    else if (element.currentStyle)
    {
        fontSize = element.currentStyle.fontSize;
    }

    if ((UNITS.length == 0) && (fontSize != MINIMUM_FONT))
    {
        UNITS = fontSize.substring(fontSize.length - 2, fontSize.length)
    }

    return parseFloat(fontSize);
}

function adjustFontSizeIfTooBig(idOfElement)
{
    var oTextBoxOuterDiv;
    var oTextBoxMiddleDiv;
    var oTextBoxInnerDiv;
    var oTextBoxOuterDiv = document.getElementById(idOfElement);
    
    if (oTextBoxOuterDiv)
    {
        oTextBoxMiddleDiv = getChildOfType(oTextBoxOuterDiv, "DIV", 0);
        if (oTextBoxMiddleDiv)
        {
            oTextBoxInnerDiv = getChildOfType(oTextBoxMiddleDiv, "DIV", 0);
            if (oTextBoxInnerDiv)
            {
                var offsetHeight = oTextBoxInnerDiv.offsetHeight;
                var specifiedHeight = offsetHeight;
                if (oTextBoxMiddleDiv.style.height != "")
                {
                    specifiedHeight = parseFloat(oTextBoxMiddleDiv.style.height);
                }
                else if (oTextBoxOuterDiv.style.height != "")
                {
                    specifiedHeight = parseFloat(oTextBoxOuterDiv.style.height);
                }
                if (offsetHeight > specifiedHeight)
                {
                    var smallestFontSize = 200;
                    
                    var aParaChildren = getParaDescendants(oTextBoxInnerDiv);
                    var oneLine = false;
                    for (i = 0; i < aParaChildren.length; i++)
                    {
                        var oParagraphDiv = aParaChildren[i];
                        var lineHeight = elementLineHeight(oParagraphDiv);
                        oneLine = oneLine || (lineHeight * 1.5 >= specifiedHeight);
                        if (oParagraphDiv.nodeName == "DIV")
                        {
                            var fontSize = elementFontSize(oParagraphDiv);
                            smallestFontSize = Math.min( smallestFontSize, fontSize );
                            for (j = 0; j < oParagraphDiv.childNodes.length; j++)
                            {
                                var oSpan = oParagraphDiv.childNodes[j];
                                if ((oSpan.nodeName == "SPAN") || (oSpan.nodeName == "A"))
                                {
                                    fontSize = elementFontSize(oSpan);
                                    smallestFontSize = Math.min( smallestFontSize, fontSize );
                                }
                            }
                        }
                    }
                    var minimum = parseFloat(MINIMUM_FONT);
                    
                    var count = 0
                    while ((smallestFontSize > minimum) && (offsetHeight > specifiedHeight) && (count < 10))
                    {
                        ++ count;
                        if (oneLine)
                        {
                            var oldWidth = parseInt(oTextBoxOuterDiv.style.width);
                            oTextBoxInnerDiv.style.width =
                                "" + oldWidth * Math.pow(1.05, count) + "px";
                        }
                        else
                        {
                            var scale = Math.max(0.95, minimum / smallestFontSize);
                            
                            for (i = 0; i < aParaChildren.length; i++)
                            {
                                var oParagraphDiv = aParaChildren[i];
                                if (oParagraphDiv.nodeName == "DIV")
                                {
                                    var paraFontSize = elementFontSize(oParagraphDiv) * scale;
                                    var paraLineHeight = elementLineHeight(oParagraphDiv) * scale;
                                    for (j = 0; j < oParagraphDiv.childNodes.length; j++)
                                    {
                                        var oSpan = oParagraphDiv.childNodes[j];
                                        if ((oSpan.nodeName == "SPAN") || (oSpan.nodeName == "A"))
                                        {
                                            var spanFontSize = elementFontSize(oSpan) * scale;
                                            var spanLineHeight = elementLineHeight(oSpan) * scale;
                                            oSpan.style.fontSize = spanFontSize + UNITS;
                                            oSpan.style.lineHeight = spanLineHeight + UNITS;
                                            smallestFontSize = Math.min( smallestFontSize, spanFontSize );
                                        }
                                    }
                                    oParagraphDiv.style.fontSize = paraFontSize + UNITS;
                                    oParagraphDiv.style.lineHeight = paraLineHeight + UNITS;
                                    smallestFontSize = Math.min( smallestFontSize, paraFontSize );
                                }
                            }
                        }
                        
                        offsetHeight = oTextBoxInnerDiv.offsetHeight;
                    }
                }
            }
        }
    }
}


function elementLineHeight(element)
{
    var lineHeight = MINIMUM_FONT; 
    
    if (document.defaultView)
    {
        var computedStyle = document.defaultView.getComputedStyle(element, null);
        if (computedStyle)
        {
            lineHeight = computedStyle.getPropertyValue("line-height");
        }
    }
    else if (element.currentStyle)
    {
        lineHeight = element.currentStyle.lineHeight;
    }
    
    if ((UNITS.length == 0) && (lineHeight != MINIMUM_FONT))
    {
        UNITS = lineHeight.substring(lineHeight.length - 2, lineHeight.length)
    }
    
    return parseFloat(lineHeight);
}

function adjustLineHeightIfTooBig(idOfElement)
{
    var oTextBoxOuterDiv;
    var oTextBoxMiddleDiv;
    var oTextBoxInnerDiv;
    var oTextBoxOuterDiv = document.getElementById(idOfElement);
    
    if (oTextBoxOuterDiv)
    {
        oTextBoxMiddleDiv = getChildOfType(oTextBoxOuterDiv, "DIV", 0);
        if (oTextBoxMiddleDiv)
        {
            oTextBoxInnerDiv = getChildOfType(oTextBoxMiddleDiv, "DIV", 0);
            if (oTextBoxInnerDiv)
            {
                var offsetHeight = oTextBoxInnerDiv.offsetHeight;
                var specifiedHeight = offsetHeight;
                if (oTextBoxMiddleDiv.style.height != "")
                {
                    specifiedHeight = parseFloat(oTextBoxMiddleDiv.style.height);
                }
                else if (oTextBoxOuterDiv.style.height != "")
                {
                    specifiedHeight = parseFloat(oTextBoxOuterDiv.style.height);
                }
                if (offsetHeight > specifiedHeight)
                {
                    var adjusted = true;
                    var count = 0;
                    while ((adjusted) && (offsetHeight > specifiedHeight) && (count < 10))
                    {
                        adjusted = false;
                        ++ count;
                        
                        var aParaChildren = getParaDescendants(oTextBoxInnerDiv);
                        for (i = 0; i < aParaChildren.length; i++)
                        {
                            var oParagraphDiv = aParaChildren[i];
                            if (oParagraphDiv.nodeName == "DIV")
                            {
                                var fontSize = elementFontSize(oParagraphDiv);
                                var lineHeight = elementLineHeight(oParagraphDiv) * 0.95;
                                if (lineHeight >= (fontSize * 1.1))
                                {
                                    oParagraphDiv.style.lineHeight = lineHeight + UNITS;
                                    adjusted = true;
                                }
                                
                                
                                
                                for (j = 0; j < oParagraphDiv.childNodes.length; j++)
                                {
                                    var oSpan = oParagraphDiv.childNodes[j];
                                    if ((oSpan.nodeName == "SPAN") || (oSpan.nodeName == "A"))
                                    {
                                        var fontSize = elementFontSize(oSpan);
                                        var lineHeight = elementLineHeight(oSpan) * 0.95;
                                        if (lineHeight >= (fontSize * 1.1))
                                        {
                                            oSpan.style.lineHeight = lineHeight + UNITS;
                                            var adjusted = true;
                                        }
                                    }
                                }
                            }
                        }
                        
                        offsetHeight = oTextBoxInnerDiv.offsetHeight;
                    }
                }
            }
        }
    }
}

var smallTransparentGif = "";
function fixupIEPNG(strImageID, transparentGif) 
{
    smallTransparentGif = transparentGif;
    if (windowsInternetExplorer && (browserVersion < 7))
    {
        var img = document.getElementById(strImageID);
        if (img)
        {
            var src = img.src;
            img.style.filter = "progid:DXImageTransform.Microsoft.AlphaImageLoader(src='" + src + "', sizingMethod='scale')";
            img.src = transparentGif;
            img.attachEvent("onpropertychange", imgPropertyChanged);
        }
    }
}

function fixupIEPNGBG(oBlock) 
{
    if (oBlock)
    {
        var currentBGImage = oBlock.currentStyle.backgroundImage;
        var currentBGRepeat = oBlock.currentStyle.backgroundRepeat;
        var urlStart = currentBGImage.indexOf('url(');
        var urlEnd = currentBGImage.indexOf(')', urlStart);
        var imageURL = currentBGImage.substring(urlStart + 4, urlEnd);

        if (imageURL.charAt(0) == '"')
        {
            imageURL = imageURL.substring(1);
        }
        
        if (imageURL.charAt(imageURL.length - 1) == '"')
        {
            imageURL = imageURL.substring(0, imageURL.length - 1);
        }

        var overrideRepeat = false;

        var filterStyle =
            "progid:DXImageTransform.Microsoft.AlphaImageLoader(src='" +
            imageURL +
            "', sizingMethod='crop');";

        if (RegExp("/C[0-9A-F]{8}.png$").exec(imageURL) != null)
        {
            filterStyle =
                "progid:DXImageTransform.Microsoft.AlphaImageLoader(src='" +
                imageURL +
                "', sizingMethod='scale');";

            overrideRepeat = true;
        }

        var backgroundImage = new Image();
        backgroundImage.src = imageURL;
        var tileWidth = backgroundImage.width;
        var tileHeight = backgroundImage.height; 
        
        var blockWidth = 0;
        var blockHeight = 0;
        if (oBlock.style.width)
        {
            blockWidth = parseInt(oBlock.style.width);
        }
        else
        {
            blockWidth = oBlock.offsetWidth;
        }
        if (oBlock.style.height)
        {
            blockHeight = parseInt(oBlock.style.height);
        }
        else
        {
            blockHeight = oBlock.offsetHeight;
        }

        if ((blockWidth == 0) || (blockHeight == 0))
        {
            return;
        }
        
        var wholeRows = 1;
        var wholeCols = 1;
        var extraHeight = 0;
        var extraWidth = 0;
        
        if ((currentBGRepeat.indexOf("no-repeat") != -1) ||
              ((tileWidth == 0) && (tileHeight == 0)) ||
              overrideRepeat)
        {
            tileWidth = blockWidth;
            tileHeight = blockHeight;

        }
        else if ((currentBGRepeat.indexOf("repeat-x") != -1) ||
              (tileHeight == 0))
        {
            wholeCols = Math.floor(blockWidth / tileWidth);
            extraWidth = blockWidth - (tileWidth * wholeCols);
            tileHeight = blockHeight;

        }
        else if (currentBGRepeat.indexOf("repeat-y") != -1)
        {
            wholeRows = Math.floor(blockHeight / tileHeight);
            extraHeight = blockHeight - (tileHeight * wholeRows);
            tileWidth = blockWidth;

        }
        else
        {
            wholeCols = Math.floor(blockWidth / tileWidth);
            wholeRows = Math.floor(blockHeight / tileHeight);
            extraWidth = blockWidth - (tileWidth * wholeCols);
            extraHeight = blockHeight - (tileHeight * wholeRows);
        }
        
        var wrappedContent = document.createElement("div");
        wrappedContent.style.position = "relative";
        wrappedContent.style.zIndex = "1";
        wrappedContent.style.left = "0px";
        wrappedContent.style.top = "0px";
        if (!isNaN(parseInt(oBlock.style.width)))
        {
            wrappedContent.style.width = "" + blockWidth + "px";
        }
        if (!isNaN(parseInt(oBlock.style.height)))
        {
            wrappedContent.style.height = "" + blockHeight + "px";
        }
        var pngBGFixIsWrappedContentEmpty = true;
        while (oBlock.hasChildNodes())
        {
            if (oBlock.firstChild.nodeType == 3)
            {
                if (RegExp("^ *$").exec(oBlock.firstChild.data) == null)
                {
                    pngBGFixIsWrappedContentEmpty = false;
                }
            }
            else
            {
                pngBGFixIsWrappedContentEmpty = false;
            }
            wrappedContent.appendChild(oBlock.firstChild);
        }
        if (pngBGFixIsWrappedContentEmpty)
        {
            wrappedContent.style.lineHeight = "0px";
        }
        
        var newMarkup = "";
        for (var currentRow = 0; 
             currentRow < wholeRows; 
             currentRow++)
        {
            for (currentCol = 0; 
                 currentCol < wholeCols; 
                 currentCol++)
            {
                newMarkup += "<div style=" +
                        "\"position: absolute; line-height: 0px; " +
                        "width: " + tileWidth + "px; " +
                        "height: " + tileHeight + "px; " +
                        "left:" + currentCol *  tileWidth + "px; " +
                        "top:" + currentRow *  tileHeight + "px; " +
                        "filter:" + filterStyle + 
                        "\" > </div>";
            }
            
            if (extraWidth != 0)
            {
                newMarkup += "<div style=" +
                        "\"position: absolute; line-height: 0px; " +
                        "width: " + extraWidth + "px; " +
                        "height: " + tileHeight + "px; " +
                        "left:" + currentCol *  tileWidth + "px; " +
                        "top:" + currentRow *  tileHeight + "px; " +
                        "filter:" + filterStyle + 
                        "\" > </div>";
            }
        }
        
        if (extraHeight != 0)
        {
            for (currentCol = 0; 
                 currentCol < wholeCols; 
                 currentCol++)
            {
                newMarkup += "<div style=" +
                        "\"position: absolute; line-height: 0px; " +
                        "width: " + tileWidth + "px; " +
                        "height: " + extraHeight + "px; " +
                        "left:" + currentCol *  tileWidth + "px; " +
                        "top:" + currentRow *  tileHeight + "px; " +
                        "filter:" + filterStyle + 
                        "\" > </div>";
            }
            
            if (extraWidth != 0)
            {
                newMarkup += "<div style=" +
                        "\"position: absolute; line-height: 0px; " +
                        "width: " + extraWidth + "px; " +
                        "height: " + extraHeight + "px; " +
                        "left:" + currentCol *  tileWidth + "px; " +
                        "top:" + currentRow *  tileHeight + "px; " +
                        "filter:" + filterStyle + 
                        "\" > </div>";
            }
        }
        oBlock.innerHTML = newMarkup;

        oBlock.appendChild(wrappedContent);
        oBlock.style.background= "";
    }
}

function fixupAllIEPNGBGs()
{
    if (windowsInternetExplorer && (browserVersion < 7))
    {
        try
        {
            var oDivNodes = document.getElementsByTagName('DIV');
            for (var iIndex=0; iIndex<oDivNodes.length; iIndex++)
            {
                var oNode = oDivNodes.item(iIndex);
                if (oNode.currentStyle &&
                    oNode.currentStyle.backgroundImage &&
                    (oNode.currentStyle.backgroundImage.indexOf('url(') != -1) &&
                    (oNode.currentStyle.backgroundImage.indexOf('.png")') != -1))
                {
                    fixupIEPNGBG(oNode);
                }
            }
        }
        catch (e)
        {
        }
    }
}

function getChildOfType(oParent, sNodeName, requestedIndex)
{
    var childrenOfType = oParent.getElementsByTagName(sNodeName);
    return (requestedIndex < childrenOfType.length) ?
           childrenOfType.item(requestedIndex) : null;
}

function getParaDescendants(oAncestor)
{
    var oParaDescendants = new Array();
    var oPotentialParagraphs = oAncestor.getElementsByTagName('DIV');
    for (var iIndex=0; iIndex<oPotentialParagraphs.length; iIndex++)
    {
        var oNode = oPotentialParagraphs.item(iIndex);
        if (oNode.className.lastIndexOf('paragraph') != -1)
        {
            oParaDescendants.push(oNode);
        }
    }
    return oParaDescendants;
}

function onPageLoad()
{
    detectBrowser();
    adjustLineHeightIfTooBig("id1");
    adjustFontSizeIfTooBig("id1");
    adjustLineHeightIfTooBig("id2");
    adjustFontSizeIfTooBig("id2");
    fixupAllIEPNGBGs();
    fixupIEPNG("id3", "You_cant_say_that_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;
    }
}


