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('../Photos_files/0049.jpg', '480', '640', '0049');
slides[1] = new Slide('../Photos_files/0048.jpg', '480', '640', '0048');
slides[2] = new Slide('../Photos_files/0050.jpg', '480', '640', '0050');
slides[3] = new Slide('../Photos_files/0508.jpg', '480', '640', '0508');
slides[4] = new Slide('../Photos_files/0620.jpg', '640', '480', '0620');
slides[5] = new Slide('../Photos_files/0619.jpg', '640', '480', '0619');
slides[6] = new Slide('../Photos_files/0624.jpg', '480', '640', '0624');
slides[7] = new Slide('../Photos_files/0507.jpg', '640', '480', '0507');
slides[8] = new Slide('../Photos_files/0081.jpg', '480', '640', '0081');
slides[9] = new Slide('../Photos_files/OM2.jpg', '640', '480', 'OM2');
slides[10] = new Slide('../Photos_files/0094.jpg', '480', '640', '0094');
slides[11] = new Slide('../Photos_files/SC3.jpg', '640', '424', 'SC3');
slides[12] = new Slide('../Photos_files/SC4.jpg', '430', '640', 'SC4');
slides[13] = new Slide('../Photos_files/BTDL01.jpg', '283', '429', 'BTDL01');
slides[14] = new Slide('../Photos_files/BTDL02.jpg', '426', '282', 'BTDL02');
slides[15] = new Slide('../Photos_files/BTDL08TH.jpg', '142', '180', 'BTDL08TH');
slides[16] = new Slide('../Photos_files/BTDL11.jpg', '417', '280', 'BTDL11');
slides[17] = new Slide('../Photos_files/BTDL10.jpg', '257', '423', 'BTDL10');
slides[18] = new Slide('../Photos_files/BTDL13.jpg', '563', '631', 'BTDL13');
slides[19] = new Slide('../Photos_files/BTDL06.jpg', '370', '490', 'BTDL06');
slides[20] = new Slide('../Photos_files/0145.jpg', '480', '640', '0145');
slides[21] = new Slide('../Photos_files/0192.jpg', '480', '640', '0192');
slides[22] = new Slide('../Photos_files/0181.jpg', '480', '640', '0181');
slides[23] = new Slide('../Photos_files/BTDL04.jpg', '445', '357', 'BTDL04');
slides[24] = new Slide('../Photos_files/BTDL05.jpg', '568', '719', 'BTDL05');
slides[25] = new Slide('../Photos_files/BTDL07.jpg', '452', '363', 'BTDL07');
slides[26] = new Slide('../Photos_files/BTDL03A.jpg', '365', '450', 'BTDL03A');
slides[27] = new Slide('../Photos_files/0015.jpg', '480', '640', '0015');
slides[28] = new Slide('../Photos_files/0014.jpg', '640', '480', '0014');
slides[29] = new Slide('../Photos_files/0019.jpg', '480', '640', '0019');
slides[30] = new Slide('../Photos_files/0018.jpg', '640', '480', '0018');
slides[31] = new Slide('../Photos_files/0013.jpg', '480', '640', '0013');
slides[32] = new Slide('../Photos_files/0421.jpg', '480', '640', '0421');
slides[33] = new Slide('../Photos_files/sig.jpg', '800', '566', 'sig');
slides[34] = new Slide('../Photos_files/0432.jpg', '480', '640', '0432');
slides[35] = new Slide('../Photos_files/0445.jpg', '480', '640', '0445');
slides[36] = new Slide('../Photos_files/0483.jpg', '480', '640', '0483');
slides[37] = new Slide('../Photos_files/0848.jpg', '480', '640', '0848');
slides[38] = new Slide('../Photos_files/0044.jpg', '480', '640', '0044');
slides[39] = new Slide('../Photos_files/0040a.jpg', '480', '640', '0040a');
slides[40] = new Slide('../Photos_files/0419.jpg', '480', '640', '0419');
slides[41] = new Slide('../Photos_files/0696.jpg', '240', '320', '0696');
slides[42] = new Slide('../Photos_files/0839.jpg', '640', '480', '0839');
slides[43] = new Slide('../Photos_files/0843.jpg', '480', '640', '0843');
slides[44] = new Slide('../Photos_files/0843_1.jpg', '480', '640', 'Copy of 0843');
slides[45] = new Slide('../Photos_files/0427.jpg', '480', '640', '0427');
slides[46] = new Slide('../Photos_files/0045.jpg', '480', '640', '0045');
slides[47] = new Slide('../Photos_files/0021.jpg', '480', '640', '0021');
slides[48] = new Slide('../Photos_files/0542.jpg', '480', '640', '0542');
slides[49] = new Slide('../Photos_files/0549.jpg', '480', '640', '0549');
slides[50] = new Slide('../Photos_files/0545.jpg', '480', '640', '0545');
slides[51] = new Slide('../Photos_files/0541.jpg', '480', '640', '0541');
slides[52] = new Slide('../Photos_files/0838.jpg', '640', '480', '0838');
slides[53] = new Slide('../Photos_files/0002.jpg', '640', '480', '0002');
slides[54] = new Slide('../Photos_files/0533.jpg', '480', '640', '0533');
slides[55] = new Slide('../Photos_files/0447.jpg', '480', '640', '0447');
slides[56] = new Slide('../Photos_files/0450.jpg', '480', '640', '0450');
slides[57] = new Slide('../Photos_files/0040.jpg', '480', '640', '0040');
slides[58] = new Slide('../Photos_files/0041.jpg', '480', '640', '0041');
slides[59] = new Slide('../Photos_files/DCP_0118.jpg', '600', '800', 'DCP_0118');
slides[60] = new Slide('../Photos_files/DCP_0114.jpg', '800', '600', 'DCP_0114');
slides[61] = new Slide('../Photos_files/DCP_0160.jpg', '529', '800', 'DCP_0160');
slides[62] = new Slide('../Photos_files/sig1.jpg', '378', '526', 'sig1');
slides[63] = new Slide('../Photos_files/DCP_0583.jpg', '529', '800', 'DCP_0583');
slides[64] = new Slide('../Photos_files/DCP_0819.jpg', '529', '800', 'DCP_0819');
slides[65] = new Slide('../Photos_files/DCP_0820.jpg', '529', '800', 'DCP_0820');
slides[66] = new Slide('../Photos_files/DSCF0011.jpg', '600', '800', 'DSCF0011');
slides[67] = new Slide('../Photos_files/DSCF0014.jpg', '600', '800', 'DSCF0014');
slides[68] = new Slide('../Photos_files/DCP_1109.jpg', '529', '800', 'DCP_1109');
slides[69] = new Slide('../Photos_files/DCP_1572.jpg', '529', '800', 'DCP_1572');
slides[70] = new Slide('../Photos_files/a.jpg', '189', '240', 'a');
slides[71] = new Slide('../Photos_files/DCP_0818.jpg', '800', '529', 'DCP_0818');
slides[72] = new Slide('../Photos_files/DCP_1923.jpg', '529', '800', 'DCP_1923');
slides[73] = new Slide('../Photos_files/0035.jpg', '480', '640', '0035');
slides[74] = new Slide('../Photos_files/0042r.jpg', '480', '640', '0042r');
slides[75] = new Slide('../Photos_files/0083.jpg', '480', '640', '0083');
slides[76] = new Slide('../Photos_files/0092.jpg', '640', '480', '0092');
slides[77] = new Slide('../Photos_files/0299.jpg', '640', '480', '0299');
slides[78] = new Slide('../Photos_files/Copy of DCP_0462.jpg', '800', '529', 'Copy of DCP_0462');
slides[79] = new Slide('../Photos_files/DCP_0457.jpg', '529', '800', 'DCP_0457');
slides[80] = new Slide('../Photos_files/DCP_3316.jpg', '529', '800', 'DCP_3316');
slides[81] = new Slide('../Photos_files/Picture from flash drive 007.jpg', '480', '640', 'Picture from flash drive 007');
slides[82] = new Slide('../Photos_files/IMG_1698.jpg', '534', '800', 'IMG_1698');
slides[83] = new Slide('../Photos_files/IMG_1700.jpg', '534', '800', 'IMG_1700');
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("id4");
    adjustFontSizeIfTooBig("id4");
    fixupIEPNG("id2", "Photos_files/transparent.gif");
    fixupIEPNG("id3", "Photos_files/transparent.gif");
    fixupAllIEPNGBGs();
    fixupIEPNG("id5", "Photos_files/transparent.gif");
    fixupIEPNG("id6", "Photos_files/transparent.gif");
    fixupIEPNG("id7", "Photos_files/transparent.gif");
    fixupIEPNG("id8", "Photos_files/transparent.gif");
    fixupIEPNG("id9", "Photos_files/transparent.gif");
    fixupIEPNG("id10", "Photos_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)
        {
        }
    }
}

