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('../Book-shaped_files/UnNamed3.jpg', '489', '500', 'Selection of books hinting at the \nhuge variety available. \n[3303]');
slides[1] = new Slide('../Book-shaped_files/UnNamed2.jpg', '489', '500', 'More variety. An upstate NY bookstore owner friend has more than 100 different book-shaped boxes, \n25 of which I gave him in exchange for the LA ESCEPCION chest seen elsewhere in the NCM.\n[3302]');
slides[2] = new Slide('../Book-shaped_files/UnNamed24.jpg', '500', '313', 'Earliest book in the NCM collection, made in 1876.\nBox is “framed,” a boxmaker term for four wooden sides and cardboard top and bottom. The thinner\ncardboard adds to the realism of the presentation.\n[3324]');
slides[3] = new Slide('../Book-shaped_files/UnNamed25.jpg', '500', '313', 'This type latch is frequently found on early books. Without it, contents would spill out when the \nbox was stood vertically on a shelf.\n[3325]');
slides[4] = new Slide('../Book-shaped_files/UnNamed26.jpg', '308', '500', 'Die-cuts are often integrated into cigar box designs\nin the 19th century. Froude was the cigar maker.\nFactory 408, 2nd District NYC. \n[3326]');
slides[5] = new Slide('../Book-shaped_files/UnNamed27.jpg', '267', '499', 'The cigars sold for 10¢ each, $4.50 a box according to hand-written notations on the Caution Notice.\nThat was fairly pricey at the time, though cigars\nas high as $1.00 each were available.\n[3327]');
slides[6] = new Slide('../Book-shaped_files/dd 9521.jpg', '500', '489', 'Framed box (wooden sides with thin cardboard top and bottom) textured and colored to \nlook like old leather.\n[9521]');
slides[7] = new Slide('../Book-shaped_files/de  9520.jpg', '500', '380', 'Clasp is curved to match the curved “pages” \nand spine. Registered in 1876, sold in 1879 \nby Manhattan’s J. Holzman, an early\ncreative packager of cigars.\n[9520]');
slides[8] = new Slide('../Book-shaped_files/df 9524.jpg', '461', '500', 'The label style is typical of late 1870’s and early 1880’s, with its central square and twin flanking decorative panels. Box is lined with a foil-like paper\noften indicative of Christmas use.\n[9524]');
slides[9] = new Slide('../Book-shaped_files/UnNamed7.jpg', '728', '800', 'The most common book-shaped box, used by cigar makers coast to coast around 1900. My first book-shaped box was a LONGFELLOW discovered in a California bookcase when I was 14. Colorful swirls on the fore edge are common.  [3307]');
slides[10] = new Slide('../Book-shaped_files/UnNamed12.jpg', '500', '300', 'Not all books had latches. This 1885 box exterior is typical of the period, and the earliest example of \na CN printed directly on the box (POB).\nFact. 803, 9th Dist. PA.\n[3312]');
slides[11] = new Slide('../Book-shaped_files/ef 3332.jpg', '293', '500', 'Brand names were frequently missing from inside labels in the 1860’s but unusual to not find\nin boxes as late as 1885. \n[3332]');
slides[12] = new Slide('../Book-shaped_files/UnNamed16.jpg', '500', '474', 'Unusual 1883 book box of 100/26 used by\nVallencia Cigar Factory, 64 Wabash, Chicago\nfor J.I. Meyer & Bro. of St. Louis. \nCigars made in Fact. 638, 1st Illinois.  \n[3316]');
slides[13] = new Slide('../Book-shaped_files/UnNamed17.jpg', '360', '500', 'Great satirical medical label. The Vallencia\nCigar factory had 150 rollers making it Chicago’s largest, almost 3x the third largest. Berriman Bros.\nwith 140 was second largest. \n[3317]');
slides[14] = new Slide('../Book-shaped_files/UnNamed33.jpg', '500', '252', 'Unnamed Christmas box. This is the bottom of the box. Note the cut-out in the center, exposing the legally required Factory ID stamped in the wood.\n[3333]');
slides[15] = new Slide('../Book-shaped_files/UnNamed9.jpg', '500', '338', 'Covering objects with cigar bands was a popular hobby 1900-1920. The label on this Christmas box\nimitated the fad. Fact. 151, 3rd Iowa  c1913.\n[3309]');
slides[16] = new Slide('../Book-shaped_files/UnNamed5.jpg', '500', '411', 'Rare 12/6 featuring a boy peeing his Christmas greetings in the snow.  Cigars by Chas. Specht Noonday Cigar Co., Fact. 505, 1st Missouri, \nSt. Louis, 1904. A curator’s favorite.\n[3305]');
slides[17] = new Slide('../Book-shaped_files/UnNamed8.jpg', '800', '468', 'Not too many books were used for\ncustom brands.  Fact. 481, 1st PA.\nWas this actually sold or given  away \nat the convention?  ¿Quien Sabe?\n[3308]');
slides[18] = new Slide('../Book-shaped_files/UnNamed42.jpg', '500', '316', 'Ordinary looking book, Havana 1910.\nA curator’s favorite.\n[3342]');
slides[19] = new Slide('../Book-shaped_files/UnNamed43.jpg', '412', '500', 'But open it up and find a hidden treasure by\none of Cuba’s most innovative packagers,\nFrancisco Fonseca, 1910.\n[3343');
slides[20] = new Slide('../Book-shaped_files/UnNamed44.jpg', '398', '500', 'The inner label of the box pictures\nF.E. Fonseca, who operated cigar factories\nin Havana and New York City.\n[3344]');
slides[21] = new Slide('../Book-shaped_files/UnNamed39.jpg', '500', '352', 'SUPREME SENSATIONS, a very realistic looking\nbook box from Fonseca’s New York Factory.\nA curator’s favorite.\n[3339]');
slides[22] = new Slide('../Book-shaped_files/UnNamed40.jpg', '500', '332', 'Another view. Thin cardboard covers with a leather feel add to the book illusion. F.E. Fonseca’s\nFactory 206, 2nd Dist New York City, 1926.\nA curator’s favorite.\n[3340]');
slides[23] = new Slide('../Book-shaped_files/UnNamed41.jpg', '350', '500', 'Inside, the box is “Dedicated to J.M. Porter as a special mark of esteem” and personally hand-signed by Fonseca. Factory located at 150 Duane St. NYC.\nTax stamp cancel suggests it was a Christmas gift.\n[3341]');
slides[24] = new Slide('../Book-shaped_files/UnNamed46.jpg', '488', '500', 'Cuban not particularly realistic all wood\ninlaid “book” by Segundo Lopez, \nHavana, Cuba  c1900.\n[3346]');
slides[25] = new Slide('../Book-shaped_files/UnNamed53.jpg', '500', '329', 'Red cedar not particularly realistic box of 100 \nfilled in Factory 45, 1st PA in the 1930’s. These SWEETEST STORY EVER TOLD turn up regularly.\nIn general, book boxes seldom contain 100 cigars.\n[3353]');
slides[26] = new Slide('../Book-shaped_files/UnNamed21.jpg', '500', '345', 'One of history’s all time most popular book boxes with attractive simulated alligator cover. Made by\nCuesta Rey, Fact. 55 Florida in 1939.\n[3321]');
slides[27] = new Slide('../Book-shaped_files/UnNamed20.jpg', '430', '500', 'Elegant Christmas package has a wooden\nflap with a lift tab. Tax stamp used legally\nbut hidden so it didn’t interfere with \ngood looking exterior.\n[3320]');
slides[28] = new Slide('../Book-shaped_files/UnNamed50.jpg', '500', '273', 'PLEASANT MOMENTS 10/5 small redwood book\nby El Monte Cigar Company, Fact. 44, \n6th District of California. 1930’s\n[3350]');
slides[29] = new Slide('../Book-shaped_files/UnNamed51.jpg', '500', '361', 'EL CORT brand produced this Book of Smokes\nin the late 1930’s. Fact. 244, 1st Calif.\nRedwood 10/10.\n[3351]');
slides[30] = new Slide('../Book-shaped_files/UnNamed15.jpg', '500', '299', 'Packaging innovator DUTCH MASTERS brings out a\nmodern cardboard book.\n[3315]');
slides[31] = new Slide('../Book-shaped_files/UnNamed18.jpg', '377', '500', '\n[3318]');
slides[32] = new Slide('../Book-shaped_files/11025.jpg', '800', '440', 'Modern book-shaped box made by Fredman Torres, Boxmaker, for HOYO DE MONTERREY HONDURAS.\n[11025]');
slides[33] = new Slide('../Book-shaped_files/11026.jpg', '760', '800', 'Interior of previous. Note magnetic latch.\nEmbossing on coins is simulated.\n[11026]');
slides[34] = new Slide('../Book-shaped_files/41_1.jpg', '190', '250', 'Selection of four other Torres titles. Any given title may appear in more than one color. The burgandy\nEXCALIBER above, is red here. This assortment of books is not in the NCM collection.\n[w00411]');
slides[35] = new Slide('../Book-shaped_files/UnNamed19.jpg', '500', '400', '5 book set by American Tobacco for its New Jersey made LA CORONA brand, each 10/5 box holding a different frontmark (size) “especially selected from the fine library of La Corona cigars for Mr. Cyril G. Hetsko, Christmas 1970.” Hard to find.   [3319]');
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", "Book-shaped_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;
    }
}

