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('../CA_to-done_files/RandysDonuts1.jpg', '533', '800', 'Complete pilgrimage to Giant Donut.');
slides[1] = new Slide('../CA_to-done_files/DSCF0132.jpg', '600', '800', 'Find Grandma Finley\u0027s property in the desert outside Barstow. \u000d');
slides[2] = new Slide('../CA_to-done_files/DSCF0141.jpg', '600', '800', 'Eat at oldest remaining Del Taco. \u000d');
slides[3] = new Slide('../CA_to-done_files/IMG_0878.jpg', '800', '534', 'Get on front page of the UCLA newspaper. \u000d');
slides[4] = new Slide('../CA_to-done_files/StoneCanyonCreek-071.jpg', '800', '534', 'Help restore a secret creek on UCLA campus.');
slides[5] = new Slide('../CA_to-done_files/StoneCanyonCreek-001.jpg', '800', '534', 'Help restore a secret creek on UCLA campus.');
slides[6] = new Slide('../CA_to-done_files/IMG_1233.jpg', '534', '800', 'Participate in a war protest.');
slides[7] = new Slide('../CA_to-done_files/IMG_1239.jpg', '534', '800', 'Participate in a war protest.');
slides[8] = new Slide('../CA_to-done_files/DSCF0012.jpg', '600', '800', 'Grow a beard.');
slides[9] = new Slide('../CA_to-done_files/IMG_1346.jpg', '800', '534', 'Whoop ass.');
slides[10] = new Slide('../CA_to-done_files/DSCF0055.jpg', '600', '800', 'Photograph awesome stuff at mom’s house');
slides[11] = new Slide('../CA_to-done_files/IMG_1464.jpg', '534', '800', 'Exchange ugly X-mas ornaments with Robertson family.');
slides[12] = new Slide('../CA_to-done_files/IMG_1675.jpg', '534', '800', 'Be the First to Find a new geocache.');
slides[13] = new Slide('../CA_to-done_files/IMG_1888.jpg', '534', '800', 'Watch UCLA beat USC at men’s baskteball.');
slides[14] = new Slide('../CA_to-done_files/IMG_2103.jpg', '534', '800', 'Sell old computers n’ junk.');
slides[15] = new Slide('../CA_to-done_files/DSCN5285.jpg', '600', '800', 'Conduct a campus-wide bird count. (pictured: the bad boys of birding)');
slides[16] = new Slide('../CA_to-done_files/DSCN5297.jpg', '600', '800', 'Conduct a campus-wide bird count. (thanks Joy for the pics)');
slides[17] = new Slide('../CA_to-done_files/IMG_1872.jpg', '480', '640', 'See L.A. from above, on a rare/unusual day.');
slides[18] = new Slide('../CA_to-done_files/IMG_1895.jpg', '480', '640', 'Get a dude from the internet to take our picture up there (Bill, Devin, Jason).');
slides[19] = new Slide('../CA_to-done_files/IMG_3198.jpg', '534', '800', 'Beat Double Dungeons (TG-16)  after 10 YEARS! (Randy & Jason)');
slides[20] = new Slide('../CA_to-done_files/IMG_3675.jpg', '534', '800', 'See grunions come up onto the beach at night to mate.');
slides[21] = new Slide('../CA_to-done_files/IMG_3712.jpg', '534', '800', 'OMG!!!');
slides[22] = new Slide('../CA_to-done_files/IMG_4544.jpg', '534', '800', 'Help out at Earth Day.');
slides[23] = new Slide('../CA_to-done_files/IMGP0034.jpg', '600', '800', 'Help out at a Pow-wow.');
slides[24] = new Slide('../CA_to-done_files/CA_to-done-25.jpg', '476', '636', 'Venice Beach.  ‘nuff said.');
slides[25] = new Slide('../CA_to-done_files/IMGP0085.jpg', '800', '600', 'Venice Beach.  ‘nuff said.');
slides[26] = new Slide('../CA_to-done_files/IMGP0097.jpg', '600', '800', 'Visit Santa Monica beach/pier.');
slides[27] = new Slide('../CA_to-done_files/IMG_5495_2.jpg', '783', '800', 'Photograph rare bird in botanical garden! (Pacific Slope Flycatcher - only rare for UCLA campus really, but still!)');
slides[28] = new Slide('../CA_to-done_files/IMGP0126.jpg', '600', '800', 'Find Oki Dog.');
slides[29] = new Slide('../CA_to-done_files/IMGP0125.jpg', '600', '800', 'Eat Oki Dog.');
slides[30] = new Slide('../CA_to-done_files/IMG_5617.jpg', '534', '800', 'Get into E3: Electronic Entertainment Expo (thanks Mike!)');
slides[31] = new Slide('../CA_to-done_files/IMG_5595.jpg', '534', '800', 'Document the madness at E3.');
slides[32] = new Slide('../CA_to-done_files/IMG_5634.jpg', '534', '800', 'Buy & eat German Chocolate Cake from Ralph’s.');
slides[33] = new Slide('../CA_to-done_files/IMGP0177.jpg', '600', '800', 'Make one last run of flower deliveries.');
slides[34] = new Slide('../CA_to-done_files/IMGP0203.jpg', '600', '800', 'Give Mr. Wiggles a bath.');
slides[35] = new Slide('../CA_to-done_files/IMGP0244.jpg', '600', '800', 'Drink some really good tequila. (Devin, Jason, Randy)');
slides[36] = new Slide('../CA_to-done_files/IMGP0245.jpg', '600', '800', 'Crazy go nuts.');
slides[37] = new Slide('../CA_to-done_files/IMGP0265.jpg', '800', '600', 'Go to planetarium show.');
slides[38] = new Slide('../CA_to-done_files/IMGP0325.jpg', '600', '800', 'Cruise Santa Monica 3rd St. Promenade.');
slides[39] = new Slide('../CA_to-done_files/IMGP0345.jpg', '600', '800', 'Go to oldest remaining Bob’s Big Boy. (Chris, Bill, Devin, Jason, Pete)');
slides[40] = new Slide('../CA_to-done_files/IMGP0355.jpg', '600', '800', 'Devour big boy burger.');
slides[41] = new Slide('../CA_to-done_files/IMGP0365_2.jpg', '600', '800', 'Dominate the city from above.');
slides[42] = new Slide('../CA_to-done_files/IMGP0370.jpg', '600', '800', 'Gaze over the Griffith Observatory (Chris, Jason, Pete).');
slides[43] = new Slide('../CA_to-done_files/IMGP0442.jpg', '600', '800', 'Shop at Whimsic Alley, the Harry Potter store.');
slides[44] = new Slide('../CA_to-done_files/IMGP0464.jpg', '600', '800', 'Hand paint a D&D mini figure.');
slides[45] = new Slide('../CA_to-done_files/IMGP0158.jpg', '600', '800', 'Play D&D. (Dario, Devin, Bill, Laurel, Jason)');
slides[46] = new Slide('../CA_to-done_files/IMGP0590.jpg', '600', '800', 'See & hear John Wooden, all-time greatest basketball coach.');
slides[47] = new Slide('../CA_to-done_files/IMG_6065.jpg', '534', '800', 'See frickin condors!!!');
slides[48] = new Slide('../CA_to-done_files/IMGP0671.jpg', '800', '600', 'See frickin condors!!!');
slides[49] = new Slide('../CA_to-done_files/IMGP0690.jpg', '600', '800', 'Climb Saddleback Mountain.  (Jason, Chris, Pete)');
slides[50] = new Slide('../CA_to-done_files/IMGP0792.jpg', '600', '800', 'Climb Saddleback Mountain. ');
slides[51] = new Slide('../CA_to-done_files/IMGP0794.jpg', '600', '800', 'Climb Saddleback Mountain. ');
slides[52] = new Slide('../CA_to-done_files/IMGP0863.jpg', '600', '800', 'Attend LA Audubon meeting.');
slides[53] = new Slide('../CA_to-done_files/IMGP0917.jpg', '600', '800', 'Go to L.A. Fashion District.');
slides[54] = new Slide('../CA_to-done_files/IMGP1001.jpg', '600', '800', 'Get pic taken w/ the first computer of the internet.');
slides[55] = new Slide('../CA_to-done_files/IMGP0994.jpg', '600', '800', 'Get pic taken w/ the first computer of the internet.');
slides[56] = new Slide('../CA_to-done_files/IMGP1014.jpg', '600', '800', 'Find taco truck, eat the best tacos I have ever had');
slides[57] = new Slide('../CA_to-done_files/IMGP1015.jpg', '600', '800', 'Find taco truck, eat the best tacos I have ever had');
slides[58] = new Slide('../CA_to-done_files/IMGP1164.jpg', '800', '600', 'See movie at famous Mann Chinese Theater.');
slides[59] = new Slide('../CA_to-done_files/IMGP1169.jpg', '600', '800', 'See movie at famous Mann Chinese Theater.');
slides[60] = new Slide('../CA_to-done_files/IMGP1545.jpg', '600', '800', 'See (& wield) Lord Byron’s sword in UCLA Library Special Collections (thanks Kelly!)\n');
slides[61] = new Slide('../CA_to-done_files/IMGP1778.jpg', '600', '800', 'Return to Huntington Garden');
slides[62] = new Slide('../CA_to-done_files/IMGP1636.jpg', '600', '800', 'Get friends to help drink 8 years of surplus booze!');
slides[63] = new Slide('../CA_to-done_files/IMGP1637.jpg', '600', '800', 'Get friends to help drink 8 years of surplus booze!');
slides[64] = new Slide('../CA_to-done_files/IMGP1723.jpg', '600', '800', 'Wait ‘til it’s hot enough to finally go swimming.');
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");
    fixupAllIEPNGBGs();
    fixupIEPNG("id2", "CA_to-done_files/transparent.gif");
    fixupIEPNG("id3", "CA_to-done_files/transparent.gif");
    fixupIEPNG("id4", "CA_to-done_files/transparent.gif");
    fixupIEPNG("id5", "CA_to-done_files/transparent.gif");
    fixupIEPNG("id6", "CA_to-done_files/transparent.gif");
    fixupIEPNG("id7", "CA_to-done_files/transparent.gif");
    fixupIEPNG("id8", "CA_to-done_files/transparent.gif");
    fixupIEPNG("id9", "CA_to-done_files/transparent.gif");
    fixupIEPNG("id10", "CA_to-done_files/transparent.gif");
    fixupIEPNG("id11", "CA_to-done_files/transparent.gif");
    fixupIEPNG("id12", "CA_to-done_files/transparent.gif");
    fixupIEPNG("id13", "CA_to-done_files/transparent.gif");
    fixupIEPNG("id14", "CA_to-done_files/transparent.gif");
    fixupIEPNG("id15", "CA_to-done_files/transparent.gif");
    fixupIEPNG("id16", "CA_to-done_files/transparent.gif");
    fixupIEPNG("id17", "CA_to-done_files/transparent.gif");
    fixupIEPNG("id18", "CA_to-done_files/transparent.gif");
    fixupIEPNG("id19", "CA_to-done_files/transparent.gif");
    fixupIEPNG("id20", "CA_to-done_files/transparent.gif");
    fixupIEPNG("id21", "CA_to-done_files/transparent.gif");
    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;
    }
}


