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('../Vintage Lace Collection_files/DSC02122.jpg', '553', '800', 'Sold, KPD boutique');
slides[1] = new Slide('../Vintage Lace Collection_files/DSC02804.jpg', '616', '800', 'DSC02804.JPG');
slides[2] = new Slide('../Vintage Lace Collection_files/DSC02806.jpg', '592', '800', 'DSC02806.JPG');
slides[3] = new Slide('../Vintage Lace Collection_files/DSC02808.jpg', '600', '800', 'DSC02808.JPG');
slides[4] = new Slide('../Vintage Lace Collection_files/DSC02335.jpg', '595', '800', 'Sold, KPD boutique');
slides[5] = new Slide('../Vintage Lace Collection_files/DSC02810.jpg', '639', '800', 'Sold, KPD boutique');
slides[6] = new Slide('../Vintage Lace Collection_files/DSC02822.jpg', '600', '800', 'DSC02822.JPG');
slides[7] = new Slide('../Vintage Lace Collection_files/DSC02819.jpg', '800', '600', 'DSC02819.JPG');
slides[8] = new Slide('../Vintage Lace Collection_files/DSC02812.jpg', '632', '800', 'DSC02812.JPG');
slides[9] = new Slide('../Vintage Lace Collection_files/DSC02337.jpg', '595', '800', 'Sold, KPD boutique');
slides[10] = new Slide('../Vintage Lace Collection_files/DSC02194.jpg', '800', '618', 'Sold, KPD boutique');
slides[11] = new Slide('../Vintage Lace Collection_files/DSC02289.jpg', '600', '800', 'DSC02289.JPG');
slides[12] = new Slide('../Vintage Lace Collection_files/DSC02113.jpg', '639', '800', 'Sold, KPD boutique');
slides[13] = new Slide('../Vintage Lace Collection_files/DSC01288.jpg', '801', '609', 'Sold Westport Craft Show 2007');
slides[14] = new Slide('../Vintage Lace Collection_files/DSC01476.jpg', '592', '800', 'Sold West Hartford Arts & Craft Show 2007');
slides[15] = new Slide('../Vintage Lace Collection_files/DSC01478.jpg', '586', '800', 'DSC01478.JPG');
slides[16] = new Slide('../Vintage Lace Collection_files/DSC01480.jpg', '590', '800', 'Sold, KPD Boutique');
slides[17] = new Slide('../Vintage Lace Collection_files/DSC01481.jpg', '800', '609', 'Sold, Westport Craft Show');
slides[18] = new Slide('../Vintage Lace Collection_files/DSC01486.jpg', '583', '800', 'DSC01486.JPG');
slides[19] = new Slide('../Vintage Lace Collection_files/DSC01492.jpg', '627', '800', 'DSC01492.JPG');
slides[20] = new Slide('../Vintage Lace Collection_files/DSC01494.jpg', '800', '600', 'DSC01494.JPG');
slides[21] = new Slide('../Vintage Lace Collection_files/DSC01496.jpg', '600', '800', 'Greenport, Inspired by Nature');
slides[22] = new Slide('../Vintage Lace Collection_files/DSC01501.jpg', '600', '800', 'Sold West Hartford Arts & Craft Show 2007');
slides[23] = new Slide('../Vintage Lace Collection_files/DSC01223.jpg', '600', '800', 'Sold, KPD boutique');
slides[24] = new Slide('../Vintage Lace Collection_files/DSC01228.jpg', '600', '800', 'DSC01228.JPG');
slides[25] = new Slide('../Vintage Lace Collection_files/DSC01230.jpg', '600', '800', 'Sold, KPD boutique');
slides[26] = new Slide('../Vintage Lace Collection_files/DSC01234.jpg', '600', '800', 'DSC01234.JPG');
slides[27] = new Slide('../Vintage Lace Collection_files/DSC01237.jpg', '593', '801', 'DSC01237.JPG');
slides[28] = new Slide('../Vintage Lace Collection_files/DSC01238.jpg', '600', '800', 'Donated, Child & Family Services of Southern Maine');
slides[29] = new Slide('../Vintage Lace Collection_files/DSC01244.jpg', '634', '800', 'Sold KPD boutique');
slides[30] = new Slide('../Vintage Lace Collection_files/DSC01246.jpg', '600', '800', 'DSC01246.JPG');
slides[31] = new Slide('../Vintage Lace Collection_files/DSC01249.jpg', '650', '800', 'DSC01249.JPG');
slides[32] = new Slide('../Vintage Lace Collection_files/DSC01251.jpg', '600', '800', 'DSC01251.JPG');
slides[33] = new Slide('../Vintage Lace Collection_files/DSC01256.jpg', '721', '800', 'Donated');
slides[34] = new Slide('../Vintage Lace Collection_files/DSC01259.jpg', '600', '800', 'Donated');
slides[35] = new Slide('../Vintage Lace Collection_files/DSC01262.jpg', '725', '800', 'DSC01262.JPG');
slides[36] = new Slide('../Vintage Lace Collection_files/DSC01265.jpg', '583', '800', 'Sold, Madison Art Show');
slides[37] = new Slide('../Vintage Lace Collection_files/DSC01266.jpg', '801', '651', 'Donated, Musica Festival for the arts, 2008');
slides[38] = new Slide('../Vintage Lace Collection_files/DSC01268.jpg', '599', '800', 'DSC01268.JPG');
slides[39] = new Slide('../Vintage Lace Collection_files/DSC01274.jpg', '800', '615', 'DSC01274.JPG');
slides[40] = new Slide('../Vintage Lace Collection_files/DSC01276.jpg', '600', '800', 'Sold, KPD boutique');
slides[41] = new Slide('../Vintage Lace Collection_files/DSC01287.jpg', '800', '658', 'Sold, Kariann Price Designs Boutique');
slides[42] = new Slide('../Vintage Lace Collection_files/DSC01285.jpg', '600', '800', 'Sold, Kariann Price Designs Boutique');
slides[43] = new Slide('../Vintage Lace Collection_files/DSC01294.jpg', '622', '800', 'Sold, Custom design');
slides[44] = new Slide('../Vintage Lace Collection_files/DSC01297.jpg', '629', '800', 'Sold, KPD boutique');
slides[45] = new Slide('../Vintage Lace Collection_files/DSC01300.jpg', '800', '611', 'Sold, KPD boutique');
slides[46] = new Slide('../Vintage Lace Collection_files/DSC01240.jpg', '660', '801', 'Sold Westport Craft Show 2007');
slides[47] = new Slide('../Vintage Lace Collection_files/DSC01195.jpg', '663', '800', 'Greenport, Ct, Inspired by Nature . . SOLD');
slides[48] = new Slide('../Vintage Lace Collection_files/DSC01106.jpg', '600', '800', 'Sold Westport Craft Show 2007');
slides[49] = new Slide('../Vintage Lace Collection_files/DSC00837.jpg', '790', '800', 'Sold, Brick Gallery, Blossoms in Pink Vintage Lace');
slides[50] = new Slide('../Vintage Lace Collection_files/DSC00828.jpg', '800', '600', 'Sold, Brick Gallery, crystal-gold fireworks Vintage Lace');
slides[51] = new Slide('../Vintage Lace Collection_files/DSC00831.jpg', '800', '617', 'Sold, Brick Gallery, Amethyst glass & crystals & Pearl Vintage lace');
slides[52] = new Slide('../Vintage Lace Collection_files/DSC01068.jpg', '801', '513', 'Sold, Brick Gallery, Rainbow Vintage Lace');
slides[53] = new Slide('../Vintage Lace Collection_files/DSC00961.jpg', '597', '800', 'Sold Westport Craft Show 2007');
slides[54] = new Slide('../Vintage Lace Collection_files/DSC01084.jpg', '600', '800', 'Sold, Hope & Stetson, Mystic, CT');
slides[55] = new Slide('../Vintage Lace Collection_files/DSC01081.jpg', '800', '600', 'Sold, Brick Gallery');
slides[56] = new Slide('../Vintage Lace Collection_files/DSC01146.jpg', '600', '800', 'Sold Brick Gallery');
slides[57] = new Slide('../Vintage Lace Collection_files/DSC01174.jpg', '600', '800', 'DSC01174.JPG');
slides[58] = new Slide('../Vintage Lace Collection_files/DSC01182.jpg', '632', '800', 'DSC01182.JPG');
slides[59] = new Slide('../Vintage Lace Collection_files/DSC01179.jpg', '600', '800', 'Sold, Kariann Price Designs Boutique');
slides[60] = new Slide('../Vintage Lace Collection_files/DSC01176.jpg', '600', '800', 'DSC01176.JPG');
slides[61] = new Slide('../Vintage Lace Collection_files/DSC01185.jpg', '800', '600', 'Sold West Hartford Arts & Craft Show 2007');
slides[62] = new Slide('../Vintage Lace Collection_files/DSC01190.jpg', '600', '800', 'DSC01190.JPG');
slides[63] = new Slide('../Vintage Lace Collection_files/DSC01193.jpg', '600', '800', 'Greenport, CT, Inspired by Nature');
slides[64] = new Slide('../Vintage Lace Collection_files/DSC01109.jpg', '607', '800', 'Sold, KPD boutique');
slides[65] = new Slide('../Vintage Lace Collection_files/DSC01198.jpg', '617', '800', 'Greenport, CT, Inspired by Nature');
slides[66] = new Slide('../Vintage Lace Collection_files/DSC01103.jpg', '600', '800', 'Sold, Kariann Price Designs Boutique');
slides[67] = new Slide('../Vintage Lace Collection_files/DSC01098.jpg', '595', '800', 'Private Collection May 2007');
slides[68] = new Slide('../Vintage Lace Collection_files/DSC01117.jpg', '600', '800', 'Sold, Chester Temple Art show');
slides[69] = new Slide('../Vintage Lace Collection_files/DSC01111.jpg', '599', '800', 'Sold, Aetna Trunk show');
slides[70] = new Slide('../Vintage Lace Collection_files/DSC01115.jpg', '600', '800', 'DSC01115.JPG');
slides[71] = new Slide('../Vintage Lace Collection_files/DSC01105.jpg', '613', '800', 'DSC01105.JPG');
slides[72] = new Slide('../Vintage Lace Collection_files/DSC01125.jpg', '600', '800', 'DSC01125.JPG');
slides[73] = new Slide('../Vintage Lace Collection_files/DSC01128.jpg', '600', '800', 'DSC01128.JPG');
slides[74] = new Slide('../Vintage Lace Collection_files/DSC01149.jpg', '600', '800', ' KPD boutique');
slides[75] = new Slide('../Vintage Lace Collection_files/DSC01144.jpg', '632', '800', 'DSC01144.JPG');
slides[76] = new Slide('../Vintage Lace Collection_files/DSC01119.jpg', '595', '800', 'DSC01119.JPG');
slides[77] = new Slide('../Vintage Lace Collection_files/DSC01135.jpg', '656', '801', 'Sold Brick Gallery');
slides[78] = new Slide('../Vintage Lace Collection_files/DSC01136.jpg', '600', '800', 'Sold, KPD boutique');
slides[79] = new Slide('../Vintage Lace Collection_files/DSC01157.jpg', '655', '800', 'DSC01157.JPG');
slides[80] = new Slide('../Vintage Lace Collection_files/DSC01072.jpg', '706', '800', 'Sold,  KPD boutique');
slides[81] = new Slide('../Vintage Lace Collection_files/DSC01154.jpg', '600', '800', 'Sold, KPD boutique');
slides[82] = new Slide('../Vintage Lace Collection_files/DSC01085.jpg', '800', '600', 'DSC01085');
slides[83] = new Slide('../Vintage Lace Collection_files/DSC01076.jpg', '800', '637', 'DSC01076');
slides[84] = new Slide('../Vintage Lace Collection_files/DSC01090.jpg', '739', '800', 'Sold, Kariann Price Designs Boutique');
slides[85] = new Slide('../Vintage Lace Collection_files/DSC00881.jpg', '685', '800', 'Sold, Aqua, Silver Mohalk Vintage Lace');
slides[86] = new Slide('../Vintage Lace Collection_files/DSC00880.jpg', '597', '800', 'Sold, Turquoise in silver vintage pendants');
slides[87] = new Slide('../Vintage Lace Collection_files/DSC00886.jpg', '800', '600', 'DSC00886.JPG');
slides[88] = new Slide('../Vintage Lace Collection_files/DSC00810.jpg', '732', '800', 'Donated, Sarah Foundation 2007 fundraising event.');
slides[89] = new Slide('../Vintage Lace Collection_files/DSC00885.jpg', '740', '800', 'Sold, Kariann Price Designs Boutique');
slides[90] = new Slide('../Vintage Lace Collection_files/DSC00857.jpg', '800', '716', 'Sold, Brick Gallery');
slides[91] = new Slide('../Vintage Lace Collection_files/DSC00685.jpg', '600', '800', 'Sold, KPD boutique');
slides[92] = new Slide('../Vintage Lace Collection_files/DSC00444.jpg', '800', '600', 'Sold, Kariann Price Designs Boutique');
slides[93] = new Slide('../Vintage Lace Collection_files/DSC00844.jpg', '800', '629', 'Sold, Westport Craft Show 2007');
slides[94] = new Slide('../Vintage Lace Collection_files/DSC00650.jpg', '800', '551', 'Sold, Madison Art Show, Vintage milk glass beads, hand cut & beveled stained glass.  A Baby Blue Vintage lace Wonder!');
slides[95] = new Slide('../Vintage Lace Collection_files/DSC00615.jpg', '800', '600', 'DSC00615.JPG');
slides[96] = new Slide('../Vintage Lace Collection_files/DSC00838.jpg', '800', '657', 'Sold, KPD boutique');
slides[97] = new Slide('../Vintage Lace Collection_files/DSC00449.jpg', '600', '800', 'Sold, vintage button cufflinks!');
slides[98] = new Slide('../Vintage Lace Collection_files/DSC00050.jpg', '801', '539', 'Sold, vintage agate, carnelian & brass hand-wovenin Kariann’s organic lace design with non-tarnishing copper wire.');
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");
    adjustLineHeightIfTooBig("id4");
    adjustFontSizeIfTooBig("id4");
    adjustLineHeightIfTooBig("id6");
    adjustFontSizeIfTooBig("id6");
    adjustLineHeightIfTooBig("id7");
    adjustFontSizeIfTooBig("id7");
    fixupAllIEPNGBGs();
    fixupIEPNG("id3", "Vintage Lace Collection_files/transparent.gif");
    fixupIEPNG("id5", "Vintage Lace Collection_files/transparent.gif");
    fixupIEPNG("id8", "Vintage Lace Collection_files/transparent.gif");
    fixupIEPNG("id9", "Vintage Lace Collection_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;
    }
}


