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('../Solar Initiation at Lake Titicaca_files/P1000097.jpg', '600', '800', 'Angelika and Michael arrive early & await group');
slides[1] = new Slide('../Solar Initiation at Lake Titicaca_files/P1000520.jpg', '600', '800', 'Hugo, Luis & Michael at play');
slides[2] = new Slide('../Solar Initiation at Lake Titicaca_files/P1000183.jpg', '600', '800', 'Retreat begins in highest city in the world, La Paz');
slides[3] = new Slide('../Solar Initiation at Lake Titicaca_files/P1000187.jpg', '600', '800', 'View driving into the city -  the altitude is 13,500 ft');
slides[4] = new Slide('../Solar Initiation at Lake Titicaca_files/P1000497.jpg', '600', '800', 'Cathedral a short walk from our 5 star hotel');
slides[5] = new Slide('../Solar Initiation at Lake Titicaca_files/P1000498.jpg', '800', '600', 'Michael at artisan market in front of Cathedral');
slides[6] = new Slide('../Solar Initiation at Lake Titicaca_files/P1000502.jpg', '600', '800', 'School playground in \nLa Paz');
slides[7] = new Slide('../Solar Initiation at Lake Titicaca_files/P1000180.jpg', '600', '800', 'Parade in Altiplano on way  to countryside ');
slides[8] = new Slide('../Solar Initiation at Lake Titicaca_files/P1000181.jpg', '600', '800', 'Everyone is having fun!');
slides[9] = new Slide('../Solar Initiation at Lake Titicaca_files/P1000196.jpg', '600', '800', 'Oliver gets coca leaves & fresh popcorn in Altiplano');
slides[10] = new Slide('../Solar Initiation at Lake Titicaca_files/P1000194.jpg', '600', '800', 'Luis chats with group members');
slides[11] = new Slide('../Solar Initiation at Lake Titicaca_files/P1000195.jpg', '600', '800', 'Jean-Luc tries the local popcorn');
slides[12] = new Slide('../Solar Initiation at Lake Titicaca_files/P1000190.jpg', '600', '800', '80% of the people of Bolivia are indigenous');
slides[13] = new Slide('../Solar Initiation at Lake Titicaca_files/P1000192.jpg', '600', '800', 'Soda is clearly a favorite drink for everyone');
slides[14] = new Slide('../Solar Initiation at Lake Titicaca_files/P1000193.jpg', '600', '800', 'Aymara woman dressed in traditional style');
slides[15] = new Slide('../Solar Initiation at Lake Titicaca_files/P1000202.jpg', '600', '800', 'Learning how to chew the coca leaves');
slides[16] = new Slide('../Solar Initiation at Lake Titicaca_files/P1000203.jpg', '600', '800', 'Oliver teaches us a coca leaf ceremony');
slides[17] = new Slide('../Solar Initiation at Lake Titicaca_files/P1000200.jpg', '600', '800', 'View of the countryside');
slides[18] = new Slide('../Solar Initiation at Lake Titicaca_files/P1000207.jpg', '600', '800', 'Tiahuanaco, a significant archeological site ');
slides[19] = new Slide('../Solar Initiation at Lake Titicaca_files/P1000204.jpg', '800', '600', 'We first pass an important doorway - the “Star Gate”');
slides[20] = new Slide('../Solar Initiation at Lake Titicaca_files/P1000206.jpg', '600', '800', 'Sign below doorway reads - “Star Gate”');
slides[21] = new Slide('../Solar Initiation at Lake Titicaca_files/P1000215.jpg', '600', '800', 'Oliver gives us a brief history lesson');
slides[22] = new Slide('../Solar Initiation at Lake Titicaca_files/P1000212.jpg', '600', '800', 'Oliver explains the 3 worlds represented by site');
slides[23] = new Slide('../Solar Initiation at Lake Titicaca_files/P1000213.jpg', '600', '800', 'Upper, lower and middle world depicted');
slides[24] = new Slide('../Solar Initiation at Lake Titicaca_files/P1000216.jpg', '600', '800', 'Only 5% of site has been excavated');
slides[25] = new Slide('../Solar Initiation at Lake Titicaca_files/P1000218.jpg', '600', '800', 'P1000218.JPG');
slides[26] = new Slide('../Solar Initiation at Lake Titicaca_files/P1000220.jpg', '600', '800', 'Our guide Oliver explains the significance of symbols');
slides[27] = new Slide('../Solar Initiation at Lake Titicaca_files/P1000221.jpg', '600', '800', 'P1000221.JPG');
slides[28] = new Slide('../Solar Initiation at Lake Titicaca_files/P1000223.jpg', '600', '800', 'Michael ');
slides[29] = new Slide('../Solar Initiation at Lake Titicaca_files/P1000224.jpg', '600', '800', 'P1000224.JPG');
slides[30] = new Slide('../Solar Initiation at Lake Titicaca_files/P1000225.jpg', '600', '800', 'P1000225.JPG');
slides[31] = new Slide('../Solar Initiation at Lake Titicaca_files/P1000226.jpg', '600', '800', 'P1000226.JPG');
slides[32] = new Slide('../Solar Initiation at Lake Titicaca_files/P1000228.jpg', '600', '800', 'Kathy & Ken feel the energy in the stones');
slides[33] = new Slide('../Solar Initiation at Lake Titicaca_files/P1000229.jpg', '600', '800', 'P1000229.JPG');
slides[34] = new Slide('../Solar Initiation at Lake Titicaca_files/P1000230.jpg', '600', '800', 'P1000230.JPG');
slides[35] = new Slide('../Solar Initiation at Lake Titicaca_files/P1000232.jpg', '600', '800', 'Kathy');
slides[36] = new Slide('../Solar Initiation at Lake Titicaca_files/P1000233.jpg', '600', '800', 'Group exploring many levels of Tiahuanaco');
slides[37] = new Slide('../Solar Initiation at Lake Titicaca_files/P1000234.jpg', '600', '800', 'Kathy, Lynn & Ken ');
slides[38] = new Slide('../Solar Initiation at Lake Titicaca_files/P1000236.jpg', '600', '800', 'Oliver and a sacred symbol ');
slides[39] = new Slide('../Solar Initiation at Lake Titicaca_files/P1000238.jpg', '600', '800', 'Luis');
slides[40] = new Slide('../Solar Initiation at Lake Titicaca_files/P1000239.jpg', '600', '800', 'P1000239.JPG');
slides[41] = new Slide('../Solar Initiation at Lake Titicaca_files/P1000241.jpg', '600', '800', 'P1000241.JPG');
slides[42] = new Slide('../Solar Initiation at Lake Titicaca_files/P1000246.jpg', '600', '800', 'P1000246.JPG');
slides[43] = new Slide('../Solar Initiation at Lake Titicaca_files/P1000248.jpg', '600', '800', 'P1000248.JPG');
slides[44] = new Slide('../Solar Initiation at Lake Titicaca_files/P1000252.jpg', '600', '800', 'Allison and the room of faces');
slides[45] = new Slide('../Solar Initiation at Lake Titicaca_files/P1000261.jpg', '600', '800', 'Gallery of faces from the stars');
slides[46] = new Slide('../Solar Initiation at Lake Titicaca_files/P1000254.jpg', '600', '800', 'P1000254.JPG');
slides[47] = new Slide('../Solar Initiation at Lake Titicaca_files/P1000255.jpg', '600', '800', 'P1000255.JPG');
slides[48] = new Slide('../Solar Initiation at Lake Titicaca_files/P1000256.jpg', '600', '800', 'P1000256.JPG');
slides[49] = new Slide('../Solar Initiation at Lake Titicaca_files/P1000258.jpg', '600', '800', 'P1000258.JPG');
slides[50] = new Slide('../Solar Initiation at Lake Titicaca_files/P1000260.jpg', '600', '800', 'P1000260.JPG');
slides[51] = new Slide('../Solar Initiation at Lake Titicaca_files/P1000263.jpg', '600', '800', 'P1000263.JPG');
slides[52] = new Slide('../Solar Initiation at Lake Titicaca_files/P1000272.jpg', '600', '800', 'P1000272.JPG');
slides[53] = new Slide('../Solar Initiation at Lake Titicaca_files/P1000267.jpg', '600', '800', 'P1000267.JPG');
slides[54] = new Slide('../Solar Initiation at Lake Titicaca_files/P1000274.jpg', '800', '600', 'Guardian at center of gallery');
slides[55] = new Slide('../Solar Initiation at Lake Titicaca_files/P1000273.jpg', '800', '600', 'P1000273.JPG');
slides[56] = new Slide('../Solar Initiation at Lake Titicaca_files/P1000275.jpg', '600', '800', 'Kathy, Luis & Lynn pose with the star nations');
slides[57] = new Slide('../Solar Initiation at Lake Titicaca_files/P1000276.jpg', '600', '800', 'Kathy, Luis & Lynn');
slides[58] = new Slide('../Solar Initiation at Lake Titicaca_files/P1000278.jpg', '600', '800', 'P1000278.JPG');
slides[59] = new Slide('../Solar Initiation at Lake Titicaca_files/P1000282.jpg', '600', '800', 'Gateway incorrectly carved & fixed - machined?');
slides[60] = new Slide('../Solar Initiation at Lake Titicaca_files/P1000285.jpg', '600', '800', 'Sun Carving');
slides[61] = new Slide('../Solar Initiation at Lake Titicaca_files/P1000286.jpg', '600', '800', 'Ken on plateau of ‘middle world’ structure');
slides[62] = new Slide('../Solar Initiation at Lake Titicaca_files/P1000098.jpg', '600', '800', 'On drive to Urmiri, mt peak rises above clouds');
slides[63] = new Slide('../Solar Initiation at Lake Titicaca_files/P1000114.jpg', '600', '800', 'Hot mineral spring resort at sacred Urmiri');
slides[64] = new Slide('../Solar Initiation at Lake Titicaca_files/P1000122.jpg', '600', '800', 'Outlook overlooking two converging streams');
slides[65] = new Slide('../Solar Initiation at Lake Titicaca_files/P1000124.jpg', '600', '800', 'Angelika with stunning view');
slides[66] = new Slide('../Solar Initiation at Lake Titicaca_files/P1000298.jpg', '600', '800', 'Luis gets ready to lead a meditation');
slides[67] = new Slide('../Solar Initiation at Lake Titicaca_files/P1000292.jpg', '600', '800', 'Connecting with the elements');
slides[68] = new Slide('../Solar Initiation at Lake Titicaca_files/P1000294.jpg', '600', '800', 'Sally looking so serene');
slides[69] = new Slide('../Solar Initiation at Lake Titicaca_files/P1000296.jpg', '600', '800', 'Hugo is always so relaxed');
slides[70] = new Slide('../Solar Initiation at Lake Titicaca_files/P1000295.jpg', '600', '800', 'Joan and her great pink cap');
slides[71] = new Slide('../Solar Initiation at Lake Titicaca_files/P1000300.jpg', '600', '800', 'Hugo and  our interpreter ');
slides[72] = new Slide('../Solar Initiation at Lake Titicaca_files/P1000302.jpg', '600', '800', 'Initiates ready for a water ceremony');
slides[73] = new Slide('../Solar Initiation at Lake Titicaca_files/P1000303.jpg', '800', '600', 'Jean-Luc');
slides[74] = new Slide('../Solar Initiation at Lake Titicaca_files/P1000314.jpg', '600', '800', 'A healing mineral hot pool with waterfall');
slides[75] = new Slide('../Solar Initiation at Lake Titicaca_files/P1000317.jpg', '600', '800', 'Luis & Michael as brothers');
slides[76] = new Slide('../Solar Initiation at Lake Titicaca_files/P1000304.jpg', '600', '800', 'Kathy & Lynn before...');
slides[77] = new Slide('../Solar Initiation at Lake Titicaca_files/P1000320.jpg', '600', '800', 'Transformation');
slides[78] = new Slide('../Solar Initiation at Lake Titicaca_files/P1000308.jpg', '600', '800', 'Lynn tries secret plankton beauty treatment');
slides[79] = new Slide('../Solar Initiation at Lake Titicaca_files/P1000316.jpg', '600', '800', 'More plankton poses -Sally, Hugo & Isabella ');
slides[80] = new Slide('../Solar Initiation at Lake Titicaca_files/P1000307.jpg', '600', '800', 'Green is beautiful');
slides[81] = new Slide('../Solar Initiation at Lake Titicaca_files/P1000310.jpg', '600', '800', 'Sally, green and proud, with Hugo');
slides[82] = new Slide('../Solar Initiation at Lake Titicaca_files/P1000305.jpg', '600', '800', 'Ken and his symphony of flowers');
slides[83] = new Slide('../Solar Initiation at Lake Titicaca_files/P1000134.jpg', '600', '800', 'Angelika with steam rising in background');
slides[84] = new Slide('../Solar Initiation at Lake Titicaca_files/P1000133.jpg', '600', '800', 'Michael with waterfall');
slides[85] = new Slide('../Solar Initiation at Lake Titicaca_files/P1000321.jpg', '600', '800', 'Hugo, Joan, Luis & Allison');
slides[86] = new Slide('../Solar Initiation at Lake Titicaca_files/P1000103.jpg', '600', '800', 'Little Chapel');
slides[87] = new Slide('../Solar Initiation at Lake Titicaca_files/P1000155.jpg', '600', '800', 'Guardian of Urmiri');
slides[88] = new Slide('../Solar Initiation at Lake Titicaca_files/P1000112.jpg', '600', '800', 'Manicured gardens everywhere');
slides[89] = new Slide('../Solar Initiation at Lake Titicaca_files/P1000150.jpg', '600', '800', 'Two lively parrots of Urmiri');
slides[90] = new Slide('../Solar Initiation at Lake Titicaca_files/P1000157.jpg', '600', '800', 'Our in-room Jacuzzi big enough to fit 4');
slides[91] = new Slide('../Solar Initiation at Lake Titicaca_files/P1000144.jpg', '600', '800', 'Michael ready for laps in mineral swimming pool');
slides[92] = new Slide('../Solar Initiation at Lake Titicaca_files/P1000114_1.jpg', '600', '800', 'New sauna being build for next time we come');
slides[93] = new Slide('../Solar Initiation at Lake Titicaca_files/P1000324.jpg', '600', '800', 'Group photo #1 in front of hot pool');
slides[94] = new Slide('../Solar Initiation at Lake Titicaca_files/P1000325.jpg', '600', '800', 'Group photo #2 in front of hot pool');
slides[95] = new Slide('../Solar Initiation at Lake Titicaca_files/P1000326.jpg', '600', '800', 'Group photo #3 in front of hot pool');
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("id4");
    adjustFontSizeIfTooBig("id4");
    fixupIEPNG("id2", "Solar Initiation at Lake Titicaca_files/transparent.gif");
    fixupIEPNG("id3", "Solar Initiation at Lake Titicaca_files/transparent.gif");
    fixupAllIEPNGBGs();
    fixupIEPNG("id5", "Solar Initiation at Lake Titicaca_files/transparent.gif");
    fixupIEPNG("id6", "Solar Initiation at Lake Titicaca_files/transparent.gif");
    fixupIEPNG("id7", "Solar Initiation at Lake Titicaca_files/transparent.gif");
    fixupIEPNG("id8", "Solar Initiation at Lake Titicaca_files/transparent.gif");
    fixupIEPNG("id9", "Solar Initiation at Lake Titicaca_files/transparent.gif");
    fixupIEPNG("id10", "Solar Initiation at Lake Titicaca_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;
    }
}


