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('../Displays_files/Foam-Sculpture-Movie-Prop-Display.jpg', '430', '800', 'A themed facade, created from hard-coated hand-carved foam for a lightweight but realistic rock look.  This piece completes the "Tree of Death" prop display from the film 300');
slides[1] = new Slide('../Displays_files/Custom-Star-Trek-Movie-Prop-Wardrobe-Mannequins.jpg', '743', '690', 'Original Star Trek movie costumes displayed by TSD. Spock(c) & Kirk(r) displays are customized mannequins, McCoy(l) is a completely scratch-built form, tailored to his thin build.  ');
slides[2] = new Slide('../Displays_files/Movie-Prop-Braveheart-Costume-Display.jpg', '720', '720', 'A custom themed base and customized torso created to display an original kilt costume from the movie Braveheart.  The rocks are all coated-foam sculptures and painted extremely realistically,');
slides[3] = new Slide('../Displays_files/Themed-Droid-Base-Home-Theater-Prop.jpg', '800', '609', 'A custom themed display base created for a client\u0027s Sideshow Star Wars R2-D2 & C-3PO statues.  Merging sculpture & display, this diorama captures the feel of the film, dramatically setting the scene!');
slides[4] = new Slide('../Displays_files/Ninja_Turtle_DISPLAY_1.jpg', '720', '800', 'Custom mannequin & display base created for an original TMNT costume. Pads & belt were recreated to complete the display. TSD also restored the suit- more pics in our RESTORATION section');
slides[5] = new Slide('../Displays_files/Terminator-Movie-Wardrobe-Custom-Mannequin.jpg', '720', '727', 'Original Terminator 3 wardrobe display.  We created a customized mannequin and battle-scene base and performed paint, eye & hair work on the resin head, sourced from a scan of Schwarzenegger.');
slides[6] = new Slide('../Displays_files/BlackHoleWEB.jpg', '640', '800', 'Custom acrylic display stand designed for a screen used prop mask from The Black Hole.  Provides the proper support  for this latex piece and looks great too!');
slides[7] = new Slide('../Displays_files/SnagglequinWEB.jpg', '616', '800', 'A display created for the original Star Wars Snaggletooth costume. TSD custom created the head and hunch backed mannequin, adding reproduction boots and hands finish the display');
slides[8] = new Slide('../Displays_files/T2-custom-film-wardrobe-display.jpg', '700', '800', 'A stylized movie prop display for this original Arnold chestpiece from Terminator 2.  The client wanted something that looked "complete" but allowed the prop to remain the focus.');
slides[9] = new Slide('../Displays_files/Silent-Hill-Nurse-Wardrobe-display-mannequin-A.jpg', '680', '800', 'Original Dark Nurse costume displayed on a customized mannequin that captures the "creepy/sexy" look from the film Silent Hill.  The heavily weathered base reinforces the eerie atmosphere.');
slides[10] = new Slide('../Displays_files/Silent-Hill-Pyramid-Film-Wardrobe-mannequin2.jpg', '800', '672', '"Red Pyramid" or "Pyramid Head" from Silent Hill.  The left side pic shows what TSD received and the pic on the right is the completed display with our added elements.');
slides[11] = new Slide('../Displays_files/Silent-Hill-Pyramid-Film-Wardrobe-mannequin.jpg', '800', '742', 'The skirt was created with a leathery feel and heavily distressed to match the look seen in the film.  A base hidden beneath the skirt holds the top-heavy statue upright.');
slides[12] = new Slide('../Displays_files/Silent-Hill-Movie-Costume-Mannequin-Display-web3.jpg', '680', '800', 'A "Miner" from Silent Hill.  We created a custom mannequin and themed base for the detailed, heavy costume as well as a realistic insert to give the appearance of bloody, terrified eyes beneath the mask.');
slides[13] = new Slide('../Displays_files/13Ghosts-FBS-Film-Wardrobe-Display.jpg', '700', '800', 'Custom mannequin, base & head, created to display the film used wardrobe of "the First Born Son" from 13 Ghosts.  For a closer look at the head sculpture, please visit our SCULPTURE page.');
slides[14] = new Slide('../Displays_files/HammerDisplayWEB.jpg', '529', '801', '"The Hammer" - TSD created this imposing display for a screen used costume from the movie "Thirteen Ghosts."  ');
slides[15] = new Slide('../Displays_files/HammerCU3web.jpg', '800', '799', 'In addition to creating a customized mannequin to support the foam latex muscle suit, TSD performed repairs and created a highly accurate head sculpt to complete this impressive display!');
slides[16] = new Slide('../Displays_files/jugdisplayweb.jpg', '572', '800', '"The Juggernaut" - TSD created this towering, 6 foot 8 inch tall display for a screen used costume from the movie "Thirteen Ghosts."  ');
slides[17] = new Slide('../Displays_files/Jugb4afterweb.jpg', '706', '800', 'A custom mannequin supports the foam latex muscle suit, hands were added, blended and color matched.  A highly accurate head sculpt with custom eyes completes this menacing display!');
slides[18] = new Slide('../Displays_files/Film-Wardrobe-Display-Underworld-Lycan.jpg', '700', '800', 'Custom mannequin and base created to display this complex Lycan costume from Underworld 3, Rise of the Lycans.  It features poseable arms and fingers and stands over 7.5 feet tall');
slides[19] = new Slide('../Displays_files/Zaius-Movie-Prop-Wardrobe-Display.jpg', '800', '800', 'Our custom mannequin for an original Zaius costume from Beneath the Planet of the Apes.  We also modified the head (which client provided) & created the bench & towel to enhance the display');
slides[20] = new Slide('../Displays_files/Predator-custom-mannequin-costume-display1.jpg', '792', '759', 'A towering display for a client\u0027s repro AVP Predator costume. We created a faux stone base & custom posed mannequin to properly support the suit.  A speared alien head tops it off!');
slides[21] = new Slide('../Displays_files/NemesisDisplayWEB.jpg', '592', '800', 'Custom 6\u0027 10" display created for the massive Nemesis costume used in Resident Evil: Apocalypse.  Strength and stability were the challenge, as the costume alone weighed nearly 100 lbs!');
slides[22] = new Slide('../Displays_files/headless-horseman-custom-mannequin.jpg', '720', '774', 'Kelly Delcambre created this custom mannequin for an original Headless Horseman costume from "Sleepy Hollow" for a client of ours. Fabricated boots, spurs and axes complete the display.');
slides[23] = new Slide('../Displays_files/cerebus1.jpg', '561', '779', 'This lighted rock formation completes this diorama of Cerberus for a museum.  Both the display base and creature were created by Richard Riley');
slides[24] = new Slide('../Displays_files/LightBase1_1.jpg', '406', '800', 'Custom lighted bases created to enhance the display of a private collector\u0027s statues.');
slides[25] = new Slide('../Displays_files/100_7226.jpg', '674', '800', 'Custom display bust with costume elements and base created by artist Kelly Delcambre. The ultimate way to enhance and display your screen used or rare masks!');
slides[26] = new Slide('../Displays_files/ugdisplay1.jpg', '800', '705', 'Custom display bust with costume and base created to enhance a recent restoration project.  A custom-fit head supports the film-used mask for which the display was created.');
slides[27] = new Slide('../Displays_files/LordoftheRingsOrcmask1.jpg', '661', '800', 'We customized one of out Deluxe Display Heads (available in the SHOP) for this screen used Lord of the Rings Orc Mask. TSD also provided restoration services (see Restoration link above) ');
slides[28] = new Slide('../Displays_files/EwokDisplay1.jpg', '800', '681', 'Custom formed face support for foam latex prosthetic with acrylic riser. A great way to display (and help preserve) your foam latex appliances! ');
slides[29] = new Slide('../Displays_files/DisplayFaceWEB.jpg', '593', '800', 'Another example of a custom formed display stand with an acrylic riser.');
slides[30] = new Slide('../Displays_files/DisplayCaseSampleGreedoHands.jpg', '576', '490', 'A sample of the high-quality acrylic display cases we can have made for your collectibles. We can design table mount or wall-mount cases, with white, black or clear bases or backing.');
isPureISOLatin1 = true;
contentEncodingConstant = 4;
feedbackURL = "TODO";
showFeedbackButton = false;
feedbackEnabled = 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;
    }
}

function onPageLoad()
{
    detectBrowser();
    adjustLineHeightIfTooBig("id1");
    adjustFontSizeIfTooBig("id1");
    adjustLineHeightIfTooBig("id3");
    adjustFontSizeIfTooBig("id3");
    adjustLineHeightIfTooBig("id5");
    adjustFontSizeIfTooBig("id5");
    adjustLineHeightIfTooBig("id6");
    adjustFontSizeIfTooBig("id6");
    adjustLineHeightIfTooBig("id7");
    adjustFontSizeIfTooBig("id7");
    adjustLineHeightIfTooBig("id8");
    adjustFontSizeIfTooBig("id8");
    adjustLineHeightIfTooBig("id9");
    adjustFontSizeIfTooBig("id9");
    adjustLineHeightIfTooBig("id10");
    adjustFontSizeIfTooBig("id10");
    adjustLineHeightIfTooBig("id11");
    adjustFontSizeIfTooBig("id11");
    adjustLineHeightIfTooBig("id12");
    adjustFontSizeIfTooBig("id12");
    adjustLineHeightIfTooBig("id14");
    adjustFontSizeIfTooBig("id14");
    adjustLineHeightIfTooBig("id15");
    adjustFontSizeIfTooBig("id15");
    adjustLineHeightIfTooBig("id17");
    adjustFontSizeIfTooBig("id17");
    adjustLineHeightIfTooBig("id19");
    adjustFontSizeIfTooBig("id19");
    adjustLineHeightIfTooBig("id21");
    adjustFontSizeIfTooBig("id21");
    adjustLineHeightIfTooBig("id22");
    adjustFontSizeIfTooBig("id22");
    adjustLineHeightIfTooBig("id23");
    adjustFontSizeIfTooBig("id23");
    adjustLineHeightIfTooBig("id24");
    adjustFontSizeIfTooBig("id24");
    adjustLineHeightIfTooBig("id25");
    adjustFontSizeIfTooBig("id25");
    adjustLineHeightIfTooBig("id27");
    adjustFontSizeIfTooBig("id27");
    adjustLineHeightIfTooBig("id28");
    adjustFontSizeIfTooBig("id28");
    fixupIEPNG("id2", "Displays_files/transparent.gif");
    fixupIEPNG("id4", "Displays_files/transparent.gif");
    fixupAllIEPNGBGs();
    fixupIEPNG("id13", "Displays_files/transparent.gif");
    fixupIEPNG("id16", "Displays_files/transparent.gif");
    fixupIEPNG("id18", "Displays_files/transparent.gif");
    fixupIEPNG("id20", "Displays_files/transparent.gif");
    fixupIEPNG("id26", "Displays_files/transparent.gif");
    return 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;
    }
}

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;
}

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;
                    }
                }
            }
        }
    }
}

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

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)
        {
        }
    }
}

