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('../Hinges_and_Clasps_files/aa0000.jpg', '205', '459', 'Standard hinge used on all NWH\ncigar boxes.');
slides[1] = new Slide('../Hinges_and_Clasps_files/aa15.jpg', '256', '283', 'The earliest “clasp” was string, tied and sealed with wax. 1830’s to 1880’s.');
slides[2] = new Slide('../Hinges_and_Clasps_files/cp2556.jpg', '314', '256', 'Clasps with moving parts are called ‘mechanicals’ and are not common\nas they required precision to install.\n[2556]');
slides[3] = new Slide('../Hinges_and_Clasps_files/latch 4214.jpg', '288', '256', 'Hole on top slips over a \nprotrusion on the bottom.\n[4214]');
slides[4] = new Slide('../Hinges_and_Clasps_files/cb2493.jpg', '337', '255', 'Bottom inserts into top which\nmust be pre-drilled.\n[2493]');
slides[5] = new Slide('../Hinges_and_Clasps_files/cd4115.jpg', '256', '301', 'Clasps that require cutting, notching, slicing or otherwise messing with the box were time consuming and added expense. [4115]');
slides[6] = new Slide('../Hinges_and_Clasps_files/9258.jpg', '256', '280', '[9258]');
slides[7] = new Slide('../Hinges_and_Clasps_files/ar2448.jpg', '347', '255', 'Clasps that require cutting, notching, slicing or otherwise messing with the box were time consuming and added expense. [2448]');
slides[8] = new Slide('../Hinges_and_Clasps_files/ck2596.jpg', '364', '256', 'Hole on top slips over a \nprotrusion on the bottom.\n[2596]');
slides[9] = new Slide('../Hinges_and_Clasps_files/cm2449.jpg', '346', '256', 'View of previous style clasp closed.\n[2449]');
slides[10] = new Slide('../Hinges_and_Clasps_files/aq2594.jpg', '347', '256', 'Clasps that require cutting, notching, slicing or otherwise messing with the box were time consuming and added expense. [2594]');
slides[11] = new Slide('../Hinges_and_Clasps_files/as4190.jpg', '321', '256', 'Clasps that require cutting, notching, slicing or otherwise messing with the box were time consuming and added expense.  [4190]');
slides[12] = new Slide('../Hinges_and_Clasps_files/am2510.jpg', '359', '256', 'Clasps that require cutting, notching, slicing or otherwise messing with the box were time consuming and added expense. This type seldom seen. [2510]');
slides[13] = new Slide('../Hinges_and_Clasps_files/cf2540.jpg', '414', '256', 'Upper hook-over didn’t hold well.\n[2540]');
slides[14] = new Slide('../Hinges_and_Clasps_files/dc2670.jpg', '287', '256', 'Not as popular as might be expected given that it’s a one piece clasp.\n[2670]');
slides[15] = new Slide('../Hinges_and_Clasps_files/at7905.jpg', '256', '267', 'Nailed to inside lid, clasp catches on nail. \u2028Requires precision. Very uncommon. [7905]');
slides[16] = new Slide('../Hinges_and_Clasps_files/hd0000.jpg', '289', '255', '1870’s mechanical latch on novelty box.\nHole on hinged top piece slips over turning latch. Uncommon.');
slides[17] = new Slide('../Hinges_and_Clasps_files/hf0000.jpg', '276', '256', '1870’s mechanical latch on novelty box.\nHole on top slips over turning latch. Top catch not hinged, requires bending to work. Impractical and uncommon.');
slides[18] = new Slide('../Hinges_and_Clasps_files/hh4303.jpg', '256', '430', 'Mechanical clasp similar to previous two but top of catch is U not hole. Eccentric shape presses on top eye when button is turned. 1880’s. [4303]');
slides[19] = new Slide('../Hinges_and_Clasps_files/ak2595.jpg', '349', '256', 'Very rare complex mechanical catch involving turning the round button to grab a protruding hook on top. \nUsed on 1871 cardboard box. [2595]');
slides[20] = new Slide('../Hinges_and_Clasps_files/ad2593.jpg', '348', '256', 'Unusual 1870’s catch that must have been difficult to install.\n[2593]');
slides[21] = new Slide('../Hinges_and_Clasps_files/ad7529.jpg', '256', '430', 'View of preceding catch closed. What went through the protruding hole?\nUnpopular. Made boxes hard to stack.\n[7529]');
slides[22] = new Slide('../Hinges_and_Clasps_files/ag2506.jpg', '378', '256', 'Another bad idea from the 1870’s.\n[2506]');
slides[23] = new Slide('../Hinges_and_Clasps_files/az2550.jpg', '363', '255', 'One of the more popular styles.\nTop hole catches on round-head nail.\n[2550]');
slides[24] = new Slide('../Hinges_and_Clasps_files/fc3390.jpg', '256', '412', 'Hook and nail type catches are first found in the 1880’s.\n[3390]');
slides[25] = new Slide('../Hinges_and_Clasps_files/fd4273.jpg', '256', '267', 'Slightly different hook with longer shank used to hold both sides of a double lidded NWHC box.\n[4273]');
slides[26] = new Slide('../Hinges_and_Clasps_files/fh4239.jpg', '275', '256', 'Hook and eye catches are more rare than hook and nail.\n[4239]');
slides[27] = new Slide('../Hinges_and_Clasps_files/hc3462.jpg', '256', '352', 'Hasp type latch fits over very small eye which appears to have been threaded with string when new. 1880’s novelty.\n[3462]');
slides[28] = new Slide('../Hinges_and_Clasps_files/hp3356.jpg', '363', '256', 'Hasp and lock type catch from 1930’s novelty box.\n[3356]');
slides[29] = new Slide('../Hinges_and_Clasps_files/ho4301from.jpg', '349', '255', 'Hasp and lock type catch from 1920’s\nBN style box.\n[4301]');
slides[30] = new Slide('../Hinges_and_Clasps_files/hq4304from.jpg', '323', '256', 'Hasp and hook and eye combination found on fancy novelty chest c1910.\n[4304]');
slides[31] = new Slide('../Hinges_and_Clasps_files/tb7908.jpg', '294', '256', 'Rare loop type catch found on tin lunchbox c1910.\n[7908]');
slides[32] = new Slide('../Hinges_and_Clasps_files/hm2555.jpg', '256', '364', 'Type II catch for BN box. Nailed. \nCommon. [2555]');
slides[33] = new Slide('../Hinges_and_Clasps_files/kd2857.jpg', '256', '435', 'Type III catch for BN box. Nailed.\nVery common.  [2857]');
slides[34] = new Slide('../Hinges_and_Clasps_files/kh0000.jpg', '256', '434', 'Type IV catch for BN box. Stapled.\nCommon 1930’s forward.');
slides[35] = new Slide('../Hinges_and_Clasps_files/kf2773.jpg', '250', '459', 'Rare variant catch for BN box. Nailed.\n[2773]');
slides[36] = new Slide('../Hinges_and_Clasps_files/hg00001.jpg', '170', '459', 'Unusual hasp and button catch coupled with matching hinges on CASIMIR, an unusual folding salesman’s sample box.');
slides[37] = new Slide('../Hinges_and_Clasps_files/casimir00002.jpg', '170', '459', 'CASIMIR hinges');
slides[38] = new Slide('../Hinges_and_Clasps_files/bb2511.jpg', '389', '255', 'Rare type hinge for trimmed box. Label covers most of the hinge normally.\n[2511]');
slides[39] = new Slide('../Hinges_and_Clasps_files/be2512.jpg', '389', '255', 'Previous hinge as normally seen\nwith inner label covering it.\n[2512]');
slides[40] = new Slide('../Hinges_and_Clasps_files/kn4302from.jpg', '256', '346', 'Rare variant catch for BN box. Stapled.\n[4302]');
slides[41] = new Slide('../Hinges_and_Clasps_files/bg2513.jpg', '256', '304', 'Rare 1870’s hinge.\n[2513]');
slides[42] = new Slide('../Hinges_and_Clasps_files/dc6186.jpg', '256', '369', 'Patented one-nail (on each side) hinge.\n1920’s  [6186]');
slides[43] = new Slide('../Hinges_and_Clasps_files/NWH4277.jpg', '256', '362', 'Rare staple driven NWH hinge from 1920’s. [4277]');
slides[44] = new Slide('../Hinges_and_Clasps_files/ef2777.jpg', '255', '340', 'Machine stapled NW hinge from 1930’s.\n[2777]');
slides[45] = new Slide('../Hinges_and_Clasps_files/de3372.jpg', '256', '263', 'Seldom seen corner latch to hold a drop-front closed. 1890’s.  [3372]');
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", "Hinges_and_Clasps_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;
    }
}


