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/_DSC0104.jpg', '450', '800', 'The Project\n');
slides[1] = new Slide('../photos_files/Library - 1232.jpg', '532', '800', 'Arrival from Dulles\n\ns\n');
slides[2] = new Slide('../photos_files/Library - 1229.jpg', '532', '800', 'Truitt waits for Natasha to arrive\n');
slides[3] = new Slide('../photos_files/Library - 1242.jpg', '532', '800', 'The crowd at arrival\n');
slides[4] = new Slide('../photos_files/20060615_48.jpg', '480', '640', ' Fiona holing her sign');
slides[5] = new Slide('../photos_files/Library - 1235.jpg', '532', '800', '“Welcome to America... you can call me Koyla...”');
slides[6] = new Slide('../photos_files/waiting for Marina.jpg', '482', '682', 'Waiting for Marina');
slides[7] = new Slide('../photos_files/Library - 1236.jpg', '532', '800', 'Truitt and Tyler wait for Natasha and Staus\n');
slides[8] = new Slide('../photos_files/Library - 1247.jpg', '532', '800', 'As the descend from the escalator\n');
slides[9] = new Slide('../photos_files/Library - 1250.jpg', '532', '800', 'Natasha with her American family\n\n');
slides[10] = new Slide('../photos_files/0406beach 018-1.jpg', '480', '640', '    Yuliya and Katya');
slides[11] = new Slide('../photos_files/0406beach 043-1.jpg', '480', '640', '           Alyona');
slides[12] = new Slide('../photos_files/DSC00202.jpg', '480', '640', 'Katya on the beach\n');
slides[13] = new Slide('../photos_files/0406beach 028-1.jpg', '480', '640', '     Katya and Yulya');
slides[14] = new Slide('../photos_files/DSC00204.jpg', '480', '640', 'Katya\n');
slides[15] = new Slide('../photos_files/IMG_0731.jpg', '427', '640', 'Katya doing the hula');
slides[16] = new Slide('../photos_files/Anastasiya, Nastassia, & Amber.jpg', '600', '800', 'Anastasiya, Nastassia, & Amber');
slides[17] = new Slide('../photos_files/IMG_0723.jpg', '427', '640', 'Zhenya, Yuliya, Maryna, Katya and Alyona\u000dKatya');
slides[18] = new Slide('../photos_files/_DSC0115.jpg', '450', '800', 'Natasha\n');
slides[19] = new Slide('../photos_files/Artom and his dogs.jpg', '525', '800', 'Artom and his dogs');
slides[20] = new Slide('../photos_files/Tina, Natasha, and Jennifer.jpg', '480', '640', 'Tina, Natasha, and Jennifer');
slides[21] = new Slide('../photos_files/Tsimur,Natasha, Maryna,Katya, and Yuliya.jpg', '480', '640', 'Tsimur,Natasha, Maryna,Katya, and Yuliya');
slides[22] = new Slide('../photos_files/Natasha, Lena, and Katya.jpg', '467', '640', 'Natasha, Lena, and Katya');
slides[23] = new Slide('../photos_files/IMG_0277.jpg', '427', '640', '4th of July parade ');
slides[24] = new Slide('../photos_files/IMG_0278.jpg', '427', '640', 'The crowd at 4th of July\n');
slides[25] = new Slide('../photos_files/Truckee 4th July parade.jpg', '410', '800', 'Truckee 4th July parade');
slides[26] = new Slide('../photos_files/Artom and Shane.jpg', '397', '640', 'Artom and Shane');
slides[27] = new Slide('../photos_files/2005 4th of July (8).jpg', '480', '640', '2005 4th of July ');
slides[28] = new Slide('../photos_files/Zhenya with a few of his favorite things.jpg', '531', '800', 'Zhenya with a few of his favorite things');
slides[29] = new Slide('../photos_files/Bowling Prosperity Lanes.jpg', '413', '640', 'Bowling Prosperity Lanes');
slides[30] = new Slide('../photos_files/Clowning around with the friendship club.jpg', '339', '640', 'Clowning around with the friendship club');
slides[31] = new Slide('../photos_files/Anastasiya climbing the rock wall at Stellar Gymnasium.jpg', '640', '422', 'Anastasiya climbing the rock wall at Stellar Gymnasium');
slides[32] = new Slide('../photos_files/bean plant.jpg', '529', '800', 'Marina with \nbean plant');
slides[33] = new Slide('../photos_files/tubing.jpg', '529', '800', 'Marina tubing with her American family\n');
slides[34] = new Slide('../photos_files/it\u0027s all about the ice cream.jpg', '529', '800', 'it\u0027s all about the ice cream');
slides[35] = new Slide('../photos_files/Grace and Artom enjoying nature.jpg', '640', '427', 'Grace and Artom enjoying nature');
slides[36] = new Slide('../photos_files/_DSC0113.jpg', '532', '800', 'Laura Christofferson and Traci Beitz\n');
slides[37] = new Slide('../photos_files/Natasha first week_1.jpg', '534', '800', 'Natasha and Claiborne\n');
slides[38] = new Slide('../photos_files/Natasha first week_13.jpg', '534', '800', 'Carrie Borba with Tyler  and Stauss \n');
slides[39] = new Slide('../photos_files/Natasha first week_17.jpg', '534', '800', 'Natasha, Elizabeth and Lena\n');
slides[40] = new Slide('../photos_files/Natasha first week_18.jpg', '534', '800', 'Natasha and Katya\n\n\n');
slides[41] = new Slide('../photos_files/Natasha first week_21.jpg', '534', '800', 'Vika performs at the welcome party performance\n');
slides[42] = new Slide('../photos_files/Welcome Party.jpg', '410', '576', 'Welcome Party');
slides[43] = new Slide('../photos_files/Library - 1357.jpg', '532', '800', 'Staus at swim party\n');
slides[44] = new Slide('../photos_files/Library - 1358.jpg', '532', '800', 'Olga at swim party\n');
slides[45] = new Slide('../photos_files/Swimming at the Entrekin party.jpg', '468', '640', 'Swimming at the Entrekin party');
slides[46] = new Slide('../photos_files/Tsimur at the Entrekin swim party.jpg', '480', '640', 'Tsimur at the Entrekin swim party');
slides[47] = new Slide('../photos_files/Funny Face Tsimur.jpg', '480', '640', 'Funny Face Tsimur');
slides[48] = new Slide('../photos_files/Library - 1375.jpg', '532', '800', 'Tatiana and Natalia with Staus and Olga\n\n and Olga');
slides[49] = new Slide('../photos_files/Library - 1363.jpg', '532', '800', 'Truitt at swim party\n');
slides[50] = new Slide('../photos_files/Marina and Cars Movie.jpg', '800', '529', 'Marina and Cars Movie');
slides[51] = new Slide('../photos_files/Library - 1356.jpg', '532', '800', 'Lena and Elizabeth\n');
slides[52] = new Slide('../photos_files/7191990-R1-018-7A.jpg', '432', '640', 'Zhenya');
slides[53] = new Slide('../photos_files/Natasha first week_10.jpg', '532', '800', 'Alicia Natasha and Alekzander\n');
slides[54] = new Slide('../photos_files/Natasha first week_6.jpg', '534', '800', 'Natasha boating\n');
slides[55] = new Slide('../photos_files/Library - 1373.jpg', '450', '800', 'Natasha getting brave in the water\n');
slides[56] = new Slide('../photos_files/Bike race.jpg', '800', '529', 'Bike race');
slides[57] = new Slide('../photos_files/First time at Joes pool.jpg', '529', '800', 'First time at Joe’s pool');
slides[58] = new Slide('../photos_files/7208970-R1-044-20A.jpg', '432', '640', 'Zhenya and Zack catch one\n');
slides[59] = new Slide('../photos_files/Library - 1444.jpg', '450', '800', 'Laura drumming up business\n');
slides[60] = new Slide('../photos_files/Library - 1445.jpg', '450', '800', 'Traci at Car Wash\n\n');
slides[61] = new Slide('../photos_files/Library - 1453.jpg', '532', '800', 'Tyler helping the cause\n');
slides[62] = new Slide('../photos_files/Library - 1458.jpg', '450', '800', 'Hard at work\n');
slides[63] = new Slide('../photos_files/Library - 1463.jpg', '450', '800', 'Natasha Claiborne and Truitt at the Zoo\n');
slides[64] = new Slide('../photos_files/DSCN5101.jpg', '480', '640', 'Lena and Truitt at Squaw Ice skating\n\n');
slides[65] = new Slide('../photos_files/Alyona, Vika, and Artom enjoying the ice rink at Squaw Valley.jpg', '480', '640', 'Alyona, Vika, and Artom enjoying the ice rink at Squaw Valley');
slides[66] = new Slide('../photos_files/Chernobyl Chefs at Circus Circus.jpg', '480', '640', 'Chernobyl Chefs at Circus Circus');
slides[67] = new Slide('../photos_files/_DSC0091.jpg', '532', '800', 'Cakes decorated at Circus Circus\n');
slides[68] = new Slide('../photos_files/Artom decorates cakes at Circus Circus.jpg', '524', '800', 'Artom decorates cakes at Circus Circus');
slides[69] = new Slide('../photos_files/Artom, Grace, & Shane.jpg', '494', '800', 'Artom, Grace, & Shane.jpg');
slides[70] = new Slide('../photos_files/Bill and Nastassia.jpg', '600', '800', 'Bill and Nastassia');
slides[71] = new Slide('../photos_files/Joe\u0027s Fans.jpg', '530', '800', 'Joe\u0027s Fans');
slides[72] = new Slide('../photos_files/Nastassia and friend.jpg', '600', '800', 'Nastassia and friend');
slides[73] = new Slide('../photos_files/Natasha, Lena, Natasha, and Tatiana.jpg', '600', '800', 'Natasha, Lena, Natasha, and Tatiana');
slides[74] = new Slide('../photos_files/Scott, Zhenya, Becca, and James.jpg', '523', '800', 'Scott, Zhenya, Becca, and James');
slides[75] = new Slide('../photos_files/Tina and Krystsina.jpg', '522', '800', 'Tina and Krystsina');
slides[76] = new Slide('../photos_files/_DSC0116.jpg', '532', '800', 'Darek\n Borba host parent for Staus \n');
slides[77] = new Slide('../photos_files/_DSC0110.jpg', '532', '800', 'Chernobyl Children pose at farewell party\n');
slides[78] = new Slide('../photos_files/_DSC0090.jpg', '451', '800', 'Signing the umbrella');
slides[79] = new Slide('../photos_files/_DSC0097.jpg', '532', '800', 'Carrie Borba and Traci Beitz\n');
slides[80] = new Slide('../photos_files/_DSC0095.jpg', '532', '800', 'Alekzander Alicia and Alex \n');
slides[81] = new Slide('../photos_files/Last Roll - 03.jpg', '532', '800', 'A clown looking at two clowns\n');
slides[82] = new Slide('../photos_files/_DSC0117.jpg', '450', '800', 'Alex and Natasha');
slides[83] = new Slide('../photos_files/Rosalee and Vika.jpg', '467', '640', 'Rosalee and Vika');
slides[84] = new Slide('../photos_files/_DSC0100.jpg', '532', '800', 'Parents watch Children being photographed');
slides[85] = new Slide('../photos_files/DSC00006.jpg', '480', '640', 'Farewell party pic\n');
slides[86] = new Slide('../photos_files/packing for home.jpg', '800', '529', 'Marina packing for home');
slides[87] = new Slide('../photos_files/Packed and read to go.jpg', '480', '640', 'Packed and read to go');
slides[88] = new Slide('../photos_files/Farewell tears.jpg', '466', '640', 'Farewell tears');
slides[89] = new Slide('../photos_files/good-bye Marina.jpg', '800', '529', 'good-bye Marina');
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("id13");
    adjustFontSizeIfTooBig("id13");
    fixupAllIEPNGBGs();
    fixupIEPNG("id2", "photos_files/transparent.gif");
    fixupIEPNG("id3", "photos_files/transparent.gif");
    fixupIEPNG("id4", "photos_files/transparent.gif");
    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");
    fixupIEPNG("id11", "photos_files/transparent.gif");
    fixupIEPNG("id12", "photos_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;
    }
}

