slideShowURL = 'SlideShow_assets/SlideShow.html';       // paramater from openSlideShowWindow.js
slideShowNS4URL = 'SlideShow_assets/SlideShowNS4.html'; // parameter from openSlideShowWindow.js

slides = new Array();
slides[0] = new Slide('../Photos_files/Nikon 2005-01-27 143622 beatle teeth.jpg', '533', '800', 'Lady in Hanoi, teeth stained with betel nut');
slides[1] = new Slide('../Photos_files/Nikon 2005-01-28 110349 2 ladies.jpg', '533', '800', 'Older ladies');
slides[2] = new Slide('../Photos_files/Nikon 2005-01-28 110312 man w cane.jpg', '533', '800', 'Taking a stroll');
slides[3] = new Slide('../Photos_files/Nikon 2005-01-27 092525 man at ceramics cleaned3.jpg', '533', '800', 'At Ceramic factory');
slides[4] = new Slide('../Photos_files/Nikon 2005-01-28 121722 lady in rice paddy.jpg', '800', '533', 'Smiling lady in rice paddy');
slides[5] = new Slide('../Photos_files/Nikon 2005-01-27 102812 MCH.jpg', '533', '800', 'Mother and child');
slides[6] = new Slide('../Photos_files/Nikon 2005-01-27 110602 sitting baby.jpg', '533', '800', 'Smiling infant');
slides[7] = new Slide('../Photos_files/Nikon 2005-01-28 102554 rice paddy.jpg', '533', '800', 'Rice paddy in North');
slides[8] = new Slide('../Photos_files/Nikon 2005-01-26 161145 man eating.jpg', '533', '800', 'Lunch break');
slides[9] = new Slide('../Photos_files/Nikon 2005-01-27 145427 man w hat.jpg', '533', '800', 'Man in park in Hanoi');
slides[10] = new Slide('../Photos_files/Nikon 2005-01-27 150158 professor.jpg', '533', '800', 'Professor in Hanoi who stopped to talk to me');
slides[11] = new Slide('../Photos_files/Nikon 2005-01-27 154019 lady w hand out.jpg', '533', '800', 'Lady asking me for money');
slides[12] = new Slide('../Photos_files/Nikon 2005-01-28 110330 man w cane.jpg', '533', '800', 'More betel stains');
slides[13] = new Slide('../Photos_files/Nikon 2005-01-28 110405 stained teeth.jpg', '533', '800', 'More teeth stain');
slides[14] = new Slide('../Photos_files/Nikon 2005-01-28 102510 rice paddy.jpg', '533', '800', 'Workers in rice paddy ');
slides[15] = new Slide('../Photos_files/Nikon 2005-01-28 110401 old lady.jpg', '800', '533', 'Old lady');
slides[16] = new Slide('../Photos_files/Nikon 2005-01-28 111819 boat in paddy.jpg', '533', '800', 'Lady in boat in rice paddy');
slides[17] = new Slide('../Photos_files/Nikon 2005-01-28 111950 man net paddy.jpg', '533', '800', 'Man fishing in North');
slides[18] = new Slide('../Photos_files/Nikon 2005-01-28 114100 perfume replace.jpg', '533', '800', 'On way to Perfume Pagoda in North');
slides[19] = new Slide('../Photos_files/Nikon 2005-01-28 115155 lady in boat.jpg', '533', '800', 'Lady in row boat');
slides[20] = new Slide('../Photos_files/Nikon 2005-01-28 115939 paddy vender.jpg', '533', '800', 'Vender along river');
slides[21] = new Slide('../Photos_files/Nikon 2005-01-28 120531 old lady rowing.jpg', '533', '800', 'Along busy waterway');
slides[22] = new Slide('../Photos_files/Nikon 2005-01-28 121714 lady in paddy.jpg', '533', '800', 'Lady working in rice paddy');
slides[23] = new Slide('../Photos_files/Nikon 2005-01-28 121955 paddy fields.jpg', '533', '800', 'Paddy fields');
slides[24] = new Slide('../Photos_files/Nikon 2005-01-28 122448 foot rowing.jpg', '533', '800', 'Lady rowing with her feet');
slides[25] = new Slide('../Photos_files/Nikon 2005-01-28 125205 young lady.jpg', '533', '800', 'Young lady');
slides[26] = new Slide('../Photos_files/Nikon 2005-01-28 142017 scene.jpg', '533', '800', 'Landscape of North');
slides[27] = new Slide('../Photos_files/Nikon 2005-01-28 142304 lady.jpg', '533', '800', 'Roadside vender');
slides[28] = new Slide('../Photos_files/Nikon 2005-01-28 145117 monk.jpg', '533', '800', 'Monk at temple');
slides[29] = new Slide('../Photos_files/Nikon 2005-01-28 145714 lady.jpg', '533', '800', 'Lady in North');
slides[30] = new Slide('../Photos_files/Nikon 2005-01-29 121454 halong bay.jpg', '533', '800', 'Scenic Halong Bay');
slides[31] = new Slide('../Photos_files/Nikon 2005-01-29 124331 halong bay.jpg', '533', '800', 'Halong Bay');
slides[32] = new Slide('../Photos_files/Nikon 2005-01-29 125024 halong bay.jpg', '533', '800', 'Houseboats on Halong Bay');
slides[33] = new Slide('../Photos_files/Nikon 2005-01-29 134243 halong bay.jpg', '533', '800', 'Houseboat Halong Bay');
slides[34] = new Slide('../Photos_files/Nikon 2005-01-29 135005 boat in halong bay v 2.jpg', '532', '800', 'Fishing boat');
slides[35] = new Slide('../Photos_files/Nikon 2005-01-30 095611 sand boat.jpg', '533', '800', 'Dredging sand on Perfume River');
slides[36] = new Slide('../Photos_files/Nikon 2005-01-30 095944 sand boat.jpg', '533', '800', 'Sand boat, owned by a single family');
slides[37] = new Slide('../Photos_files/Nikon 2005-01-30 100110 sand boat.jpg', '533', '800', 'Family dredges 1 boatload daily');
slides[38] = new Slide('../Photos_files/Nikon 2005-01-30 105551 lady w balance2.jpg', '533', '800', 'Lady along banks of Perfume River');
slides[39] = new Slide('../Photos_files/Nikon 2005-01-30 111120 sand boat.jpg', '533', '800', 'Dredging Boat');
slides[40] = new Slide('../Photos_files/Nikon 2005-01-30 113516 2 dredging.jpg', '533', '800', 'Dredging sand (Hue)');
slides[41] = new Slide('../Photos_files/Nikon 2005-01-30 115117 boats at Hue.jpg', '533', '800', 'Boats on Perfume River');
slides[42] = new Slide('../Photos_files/Nikon 2005-01-30 220023 morin hotel.jpg', '533', '800', 'Morin Hotel in Hue');
slides[43] = new Slide('../Photos_files/Nikon 2005-01-30 220134 hue bridge.jpg', '533', '800', 'Bridge (Hue)');
slides[44] = new Slide('../Photos_files/Nikon 2005-01-31 103754_01 beauty.jpg', '533', '800', 'Beautiful girl');
slides[45] = new Slide('../Photos_files/Nikon 2005-01-31 123656 fruit stall.jpg', '533', '800', 'Typical fruit stall');
slides[46] = new Slide('../Photos_files/Nikon 2005-01-31 144620 bok choy lady.jpg', '533', '800', 'Catching a ride');
slides[47] = new Slide('../Photos_files/Nikon 2005-01-31 145648 hats.jpg', '533', '800', 'Hat vender in market (Hue)');
slides[48] = new Slide('../Photos_files/Nikon 2005-01-31 151711 old lady.jpg', '533', '800', 'Old lady in Hue');
slides[49] = new Slide('../Photos_files/Nikon 2005-01-31 151910 face.jpg', '533', '800', 'Giving change');
slides[50] = new Slide('../Photos_files/Nikon 2005-01-31 152159 face.jpg', '533', '800', 'Lady in Hue');
slides[51] = new Slide('../Photos_files/Nikon 2005-01-31 153747 cig dangler.jpg', '533', '800', 'Cigarette dangler');
slides[52] = new Slide('../Photos_files/Nikon 2005-01-31 154145 face mask.jpg', '533', '800', 'Face mask (block the sun)');
slides[53] = new Slide('../Photos_files/Nikon 2005-01-31 154236 face.jpg', '533', '800', 'Vender in Hue');
slides[54] = new Slide('../Photos_files/Nikon 2005-01-31 154351 lady on bridge.jpg', '533', '800', 'Lady carrying goods on bicycle');
slides[55] = new Slide('../Photos_files/Nikon 2005-01-31 155221 cig.jpg', '533', '800', 'Cigarette dangler');
slides[56] = new Slide('../Photos_files/Nikon 2005-01-31 160912 school award.jpg', '800', '533', 'School girl on her way home');
slides[57] = new Slide('../Photos_files/Nikon 2005-01-31 161200 family on cycle.jpg', '533', '800', 'Family on a motorcycle');
slides[58] = new Slide('../Photos_files/Nikon 2005-02-01 075322 chef.jpg', '533', '800', 'Hotel chef');
slides[59] = new Slide('../Photos_files/Nikon 2005-02-01 150337 old man.jpg', '533', '800', 'Elderly gentleman');
slides[60] = new Slide('../Photos_files/Nikon 2005-02-01 150842 pho.jpg', '533', '800', 'Eating pho');
slides[61] = new Slide('../Photos_files/Nikon 2005-02-01 151647 head on cycle.jpg', '533', '800', 'Youngster taking a rest');
slides[62] = new Slide('../Photos_files/Nikon 2005-02-01 151922 lady MORE CONTRAST.jpg', '800', '533', 'Lady in straw hat');
slides[63] = new Slide('../Photos_files/Nikon 2005-02-01 152249 girl w scarf.jpg', '800', '533', 'Making sure skin color as light as possible');
slides[64] = new Slide('../Photos_files/Nikon 2005-02-01 152718 boy.jpg', '800', '533', 'Young boy');
slides[65] = new Slide('../Photos_files/Nikon 2005-02-01 154125 shoe store girl.jpg', '533', '800', 'Salesgirl at show stor');
slides[66] = new Slide('../Photos_files/Nikon 2005-02-01 154707 life resort compu.jpg', '800', '533', 'hotel assistant in Hoi An');
slides[67] = new Slide('../Photos_files/Nikon 2005-02-02 091405 school girls.jpg', '533', '800', 'School girls in uniform');
slides[68] = new Slide('../Photos_files/Nikon 2005-02-02 092731 silk spinner.jpg', '533', '800', 'Lady spinning silk in Hoi An');
slides[69] = new Slide('../Photos_files/Nikon 2005-02-02 115315 kids in window.jpg', '533', '800', 'Kids in window selling whistles');
slides[70] = new Slide('../Photos_files/Nikon 2005-02-02 120021 good teeth.jpg', '533', '800', 'Man with broad grin');
slides[71] = new Slide('../Photos_files/Nikon 2005-02-02 132019 eating seeds.jpg', '533', '800', 'Lady eating seeds at market');
slides[72] = new Slide('../Photos_files/Nikon 2005-02-02 132413 girl w ho chi min.jpg', '533', '800', 'Ho Chi Minh photo at vender stall');
slides[73] = new Slide('../Photos_files/Nikon 2005-02-02 132427 lady.jpg', '533', '800', 'Lady at market');
slides[74] = new Slide('../Photos_files/Nikon 2005-02-02 132527 old lady.jpg', '533', '800', 'Old lady');
slides[75] = new Slide('../Photos_files/Nikon 2005-02-03 155054 nice face.jpg', '533', '800', 'Expressive face');
slides[76] = new Slide('../Photos_files/Nikon 2005-02-04 064229 early am.jpg', '800', '533', 'Sunrise on the Mekong delta');
slides[77] = new Slide('../Photos_files/Nikon 2005-02-04 081807 woman rowing.jpg', '533', '800', 'On the waterways of the  Mekong delta');
slides[78] = new Slide('../Photos_files/Nikon 2005-02-04 081923 fishing.jpg', '533', '800', 'Fishing (Mekong delta)');
slides[79] = new Slide('../Photos_files/Nikon 2005-02-04 082341 floating homes.jpg', '533', '800', 'Floating homes (Mekong delta)');
slides[80] = new Slide('../Photos_files/Nikon 2005-02-04 084234 floating home.jpg', '533', '800', 'Mekong delta');
slides[81] = new Slide('../Photos_files/Nikon 2005-02-04 084612_01 95 yrs.jpg', '800', '533', 'Man 95 years old actively farming');
slides[82] = new Slide('../Photos_files/Nikon 2005-02-04 085123 cham hut.jpg', '800', '533', 'Cham hut in the Mekong delta');
slides[83] = new Slide('../Photos_files/Nikon 2005-02-04 090046 cham lady.jpg', '800', '533', 'Cham lady');
slides[84] = new Slide('../Photos_files/Nikon 2005-02-04 090311 cham lady.jpg', '800', '533', 'Vender selling lettuce in a Cham village');
slides[85] = new Slide('../Photos_files/Nikon 2005-02-04 091621 cham sisters.jpg', '533', '800', '2 sisters (Cham village in Mekng delta)');
slides[86] = new Slide('../Photos_files/Nikon 2005-02-04 091639 cham lady.jpg', '800', '533', 'Lady in Cham village');
slides[87] = new Slide('../Photos_files/Nikon 2005-02-04 092356 eating pho.jpg', '800', '533', 'Eating pho');
slides[88] = new Slide('../Photos_files/Nikon 2005-02-04 105137 school kids.jpg', '533', '800', 'Coming home from school');
slides[89] = new Slide('../Photos_files/Nikon 2005-02-04 105139 school kids.jpg', '533', '800', 'School kids being transported from school');
slides[90] = new Slide('../Photos_files/Nikon 2005-02-04 120848 our boat driver.jpg', '800', '533', 'Our boat driver in the Mekong delta');
slides[91] = new Slide('../Photos_files/Nikon 2005-02-04 121127 stilt house.jpg', '533', '800', 'House on stilts in Mekong delta');
slides[92] = new Slide('../Photos_files/Nikon 2005-02-04 121240 mekong delta.jpg', '533', '800', 'Along a tributary of the Mekong River');
slides[93] = new Slide('../Photos_files/Nikon 2005-02-04 130632 washing clothes.jpg', '533', '800', 'Washing clothes on the river bank');
slides[94] = new Slide('../Photos_files/Nikon 2005-02-04 130821_01 washing hair.jpg', '533', '800', 'Girl washes hair within 100 feet');
slides[95] = new Slide('../Photos_files/Nikon 2005-02-04 130848 kids on pot.jpg', '533', '800', 'of these 2 kids who are on the pot!');
slides[96] = new Slide('../Photos_files/Nikon 2005-02-04 134357 greetings.jpg', '533', '800', 'Mekong delta riverbank resident salutes us');
slides[97] = new Slide('../Photos_files/Nikon 2005-02-04 135708 lady.jpg', '533', '800', 'Lady in Mekong Delta');
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)
    {
        fontSize = document.defaultView.getComputedStyle(element, null).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 oCachedHeight;
                if (windowsInternetExplorer)
                {
                    oCachedHeight = oTextBoxInnerDiv.style.height;
                    oTextBoxInnerDiv.style.height = "100px";
                }
                
                var clientHeight = oTextBoxInnerDiv.clientHeight;
                var specifiedHeight = clientHeight;
                if (oTextBoxMiddleDiv.style.height != "")
                {
                    specifiedHeight = parseFloat(oTextBoxMiddleDiv.style.height);
                }
                else if (oTextBoxOuterDiv.style.height != "")
                {
                    specifiedHeight = parseFloat(oTextBoxOuterDiv.style.height);
                }
                if ((windowsInternetExplorer) && (clientHeight == 100))
                {
                    clientHeight = specifiedHeight;
                }
                if (clientHeight > specifiedHeight)
                {
                    // compute smallest font in text box for scale purposes.
                    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")
                                {
                                    fontSize = elementFontSize(oSpan);
                                    smallestFontSize = Math.min( smallestFontSize, fontSize );
                                }
                            }
                        }
                    }
                    var minimum = parseFloat(MINIMUM_FONT);
                    
                    var count = 0
                    while ((smallestFontSize > minimum) && (clientHeight > 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);
                            
                            // Scale all the fonts in the text box.
                            for (i = 0; i < aParaChildren.length; i++)
                            {
                                var oParagraphDiv = aParaChildren[i];
                                if (oParagraphDiv.nodeName == "DIV")
                                {
                                    var fontSize = elementFontSize(oParagraphDiv) * scale;
                                    oParagraphDiv.style.fontSize = fontSize + UNITS;
                                    oParagraphDiv.style.lineHeight = fontSize + UNITS;
                                    smallestFontSize = Math.min( smallestFontSize, fontSize );
                                    for (j = 0; j < oParagraphDiv.childNodes.length; j++)
                                    {
                                        var oSpan = oParagraphDiv.childNodes[j];
                                        if (oSpan.nodeName == "SPAN")
                                        {
                                            fontSize = elementFontSize(oSpan) * scale;
                                            oSpan.style.fontSize = fontSize + UNITS;
                                            oSpan.style.lineHeight = fontSize + UNITS;
                                            smallestFontSize = Math.min( smallestFontSize, fontSize );
                                        }
                                    }
                                }
                            }
                        }
                        
                        clientHeight = oTextBoxInnerDiv.clientHeight;
                    }
                }
                if (windowsInternetExplorer)
                {
                    oTextBoxInnerDiv.style.height = oCachedHeight;
                }
            }
        }
    }
}


function elementLineHeight(element)
{
    var lineHeight = MINIMUM_FONT; 
    
    if (document.defaultView)
    {
        lineHeight = document.defaultView.getComputedStyle(element, null).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 oCachedHeight;
                if (windowsInternetExplorer)
                {
                    oCachedHeight = oTextBoxInnerDiv.style.height;
                    oTextBoxInnerDiv.style.height = "100px";
                }
                
                var clientHeight = oTextBoxInnerDiv.clientHeight;
                var specifiedHeight = clientHeight;
                if (oTextBoxMiddleDiv.style.height != "")
                {
                    specifiedHeight = parseFloat(oTextBoxMiddleDiv.style.height);
                }
                else if (oTextBoxOuterDiv.style.height != "")
                {
                    specifiedHeight = parseFloat(oTextBoxOuterDiv.style.height);
                }
                if ((windowsInternetExplorer) && (clientHeight == 100))
                {
                    clientHeight = specifiedHeight;
                }
                if (clientHeight > specifiedHeight)
                {
                    var adjusted = true;
                    var count = 0;
                    while ((adjusted) && (clientHeight > specifiedHeight) && (count < 10))
                    {
                        adjusted = false;
                        ++ count;
                        
                        // Scale all the line heights in the text box.
                        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")
                                    {
                                        var fontSize = elementFontSize(oSpan);
                                        var lineHeight = elementLineHeight(oSpan) * 0.95;
                                        if (lineHeight >= (fontSize * 1.1))
                                        {
                                            oSpan.style.lineHeight = lineHeight + UNITS;
                                            var adjusted = true;
                                        }
                                    }
                                }
                            }
                        }
                        
                        clientHeight = oTextBoxInnerDiv.clientHeight;
                    }
                }
                if (windowsInternetExplorer)
                {
                    oTextBoxInnerDiv.style.height = oCachedHeight;
                }
            }
        }
    }
}

function adjustPositioningIfWrongSize(idOfElement, shrinkPadding, shrink)
{
    var oTextBoxOuterDiv;
    var oTextBoxMiddleDiv;
    var oTextBoxInnerDiv;
    var oTextBoxAlternateImage;
    var oImg;
    var adjustPositioning = false;
    var adjustmentPixels = 0;
    var oTextBoxOuterDiv = document.getElementById(idOfElement);
    if (oTextBoxOuterDiv)
    {
        oTextBoxMiddleDiv = getChildOfType(oTextBoxOuterDiv, "DIV", 0);
        if (oTextBoxMiddleDiv)
        {
            oTextBoxInnerDiv = getChildOfType(oTextBoxMiddleDiv, "DIV", 0);
            if (oTextBoxInnerDiv)
            {
                var oCachedHeight;
                if (windowsInternetExplorer)
                {
                    oCachedHeight = oTextBoxInnerDiv.style.height;
                    oTextBoxInnerDiv.style.height = "100px";
                }
                var clientHeight = oTextBoxInnerDiv.clientHeight;
                var specifiedHeight = clientHeight;
                if (oTextBoxMiddleDiv.style.height != "")
                {
                    specifiedHeight = parseFloat(oTextBoxMiddleDiv.style.height);
                }
                else if (oTextBoxOuterDiv.style.height != "")
                {
                    specifiedHeight = parseFloat(oTextBoxOuterDiv.style.height);
                }
                if ((windowsInternetExplorer) && (clientHeight == 100))
                {
                    clientHeight = specifiedHeight;
                }
                if (clientHeight > specifiedHeight || 
                    specifiedHeight > clientHeight + shrinkPadding )
                {
                    adjustPositioning = true;
                    adjustmentPixels = clientHeight - specifiedHeight;
                    if (specifiedHeight > clientHeight)
                    {
                      if (! shrink)
                      {
                          adjustPositioning = false;
                      }
                      else
                      {
                          adjustmentPixels += shrinkPadding;
                      }
                      
                    }
                }
                if (windowsInternetExplorer)
                {
                    oTextBoxInnerDiv.style.height = oCachedHeight;
                }
            }
        }
    }
    
    if (adjustPositioning)
    {
        var currentOuterHeight = parseInt(oTextBoxOuterDiv.style.height);
        var newOuterHeight = currentOuterHeight + adjustmentPixels;
        if( newOuterHeight <= 0 )        {            newOuterHeight = 1;        }        oTextBoxOuterDiv.style.height = "" + newOuterHeight + "px";

        oFooterLayer = document.getElementById("footer_layer");
        if (oFooterLayer)
        {
            var currentYPos = parseInt(oFooterLayer.style.top);
            var newYPos = currentYPos + adjustmentPixels;
            oFooterLayer.style.top = "" + newYPos + "px";
        }

        oBodyLayer = document.getElementById("body_layer");
        if (oBodyLayer)
        {
            var currentBodyLayerHeight = parseInt(oBodyLayer.style.height);
            var newBodyLayerHeight = currentBodyLayerHeight + adjustmentPixels;
            oBodyLayer.style.height = "" + newBodyLayerHeight + "px";
        }

        oBodyContentDiv = document.getElementById("bodyContent");
        if (oBodyContentDiv)
        {
            var currentBodyContentHeight = parseInt(oBodyContentDiv.style.height);
            var newBodyContentHeight = currentBodyContentHeight + adjustmentPixels;
            oBodyContentDiv.style.height = "" + newBodyContentHeight + "px";
        }

        oNavLayer = document.getElementById("nav_layer");
        if(oNavLayer)
        {
            var currentNavLayerHeight = parseInt(oNavLayer.style.height);
            var diff = currentNavLayerHeight - currentBodyContentHeight;
            if ((diff > -10) && (diff < 10))
            {
                var newNavLayerHeight = currentNavLayerHeight + adjustmentPixels;
                oNavLayer.style.height = "" + newNavLayerHeight + "px";

                oNavBG = getChildOfType(oNavLayer, "DIV", 0);
                if (oNavBG)
                {
                    var currentNavBGHeight = parseInt(oNavBG.style.height);
                    var newNavBGHeight = currentNavBGHeight + adjustmentPixels;
                    oNavBG.style.height = "" + newNavBGHeight + "px";
                }
            }
        }

    }
}
var smallTransparentGif = "";
function fixupIEPNG(strImageID, transparentGif) 
{
    smallTransparentGif = transparentGif;
    if (windowsInternetExplorer)
    {
        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(strImageID) 
{
    if (windowsInternetExplorer)
    {
        var oBlock = document.getElementById(strImageID);
        if (oBlock)
        {
            var currentBGStyle = oBlock.style.background;
            var urlStart = currentBGStyle.indexOf("url(");
            var urlEnd = currentBGStyle.indexOf(")", urlStart);
            var imageURL = currentBGStyle.substring(urlStart + 4, urlEnd);
            var filterStyle =
                "progid:DXImageTransform.Microsoft.AlphaImageLoader(src='" +
                imageURL +
                "', sizingMethod='crop');";

            oBlock.style.filter = filterStyle;
            oBlock.style.background = "";
        }
    }
}

function getChildOfType(oParent, sNodeName, requestedIndex)
{
    var index = 0;
    for (i = 0; i < oParent.childNodes.length; i++)
    {
        if (oParent.childNodes[i].nodeName == sNodeName)
        {
            if (index == requestedIndex)
            {
                return oParent.childNodes[i];
            }
            else
            {
                index++;
            }
        }
    }
    return null;
}

function getParaDescendantsRec(oAncestor, aResultArray, index)
{
    if (index == -1)
    {
        if ((oAncestor.nodeName == "DIV") &&
            (oAncestor.className.lastIndexOf("paragraph") != -1))
        {
            aResultArray[aResultArray.length] = oAncestor;
        }
        else if ((oAncestor.nodeName == "DIV") ||
                 (oAncestor.nodeName == "LI") ||
                 (oAncestor.nodeName == "OL") ||
                 (oAncestor.nodeName == "UL"))
        {
            getParaDescendantsRec(oAncestor, aResultArray, 0);
        }
    }
    else
    {
        getParaDescendantsRec(oAncestor.childNodes[index], aResultArray, -1);
        if (index < (oAncestor.childNodes.length - 1))
        {
            getParaDescendantsRec(oAncestor, aResultArray, index + 1);
        }
    }
}

function getParaDescendants(oAncestor)
{
    var aResultArray = new Array();
    getParaDescendantsRec(oAncestor, aResultArray, -1);

    return aResultArray;
}

var windowsInternetExplorer = false;
function detectBrowser()
{
    windowsInternetExplorer = false;
    var appVersion = navigator.appVersion;
    if ((appVersion.indexOf("MSIE") != -1) &&
        (appVersion.indexOf("Macintosh") == -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;
    }
}

function onPageLoad()
{
    detectBrowser();
    fixupIEPNGBG("id1");
    adjustPositioningIfWrongSize("id2", 50, 1);
    adjustLineHeightIfTooBig("id3");
    adjustFontSizeIfTooBig("id3");
    fixupIEPNGBG("id4");
    fixupIEPNGBG("id5");
    fixupIEPNGBG("id6");
    fixupIEPNGBG("id7");
    fixupIEPNGBG("id8");
    fixupIEPNGBG("id9");
    fixupIEPNGBG("id10");
    fixupIEPNGBG("id11");
    fixupIEPNGBG("id12");
    fixupIEPNGBG("id13");
    fixupIEPNGBG("id14");
    fixupIEPNGBG("id15");
    fixupIEPNGBG("id16");
    fixupIEPNGBG("id17");
    fixupIEPNGBG("id18");
    fixupIEPNGBG("id19");
    fixupIEPNGBG("id20");
    fixupIEPNGBG("id21");
    fixupIEPNGBG("id22");
    fixupIEPNGBG("id23");
    fixupIEPNGBG("id24");
    fixupIEPNGBG("id25");
    fixupIEPNGBG("id26");
    fixupIEPNGBG("id27");
    fixupIEPNGBG("id28");
    fixupIEPNGBG("id29");
    fixupIEPNGBG("id30");
    fixupIEPNGBG("id31");
    fixupIEPNGBG("id32");
    fixupIEPNGBG("id33");
    fixupIEPNGBG("id34");
    fixupIEPNGBG("id35");
    fixupIEPNGBG("id36");
    fixupIEPNGBG("id37");
    fixupIEPNGBG("id38");
    fixupIEPNGBG("id39");
    fixupIEPNGBG("id40");
    fixupIEPNGBG("id41");
    fixupIEPNGBG("id42");
    fixupIEPNGBG("id43");
    fixupIEPNGBG("id44");
    fixupIEPNGBG("id45");
    fixupIEPNGBG("id46");
    fixupIEPNGBG("id47");
    fixupIEPNGBG("id48");
    fixupIEPNGBG("id49");
    fixupIEPNGBG("id50");
    fixupIEPNGBG("id51");
    fixupIEPNGBG("id52");
    fixupIEPNGBG("id53");
    fixupIEPNGBG("id54");
    fixupIEPNGBG("id55");
    fixupIEPNGBG("id56");
    fixupIEPNGBG("id57");
    fixupIEPNGBG("id58");
    fixupIEPNGBG("id59");
    fixupIEPNGBG("id60");
    fixupIEPNGBG("id61");
    fixupIEPNGBG("id62");
    fixupIEPNGBG("id63");
    fixupIEPNGBG("id64");
    fixupIEPNGBG("id65");
    fixupIEPNGBG("id66");
    fixupIEPNGBG("id67");
    fixupIEPNGBG("id68");
    fixupIEPNGBG("id69");
    fixupIEPNGBG("id70");
    fixupIEPNGBG("id71");
    fixupIEPNGBG("id72");
    fixupIEPNGBG("id73");
    fixupIEPNGBG("id74");
    fixupIEPNGBG("id75");
    fixupIEPNGBG("id76");
    fixupIEPNGBG("id77");
    fixupIEPNGBG("id78");
    fixupIEPNGBG("id79");
    fixupIEPNGBG("id80");
    fixupIEPNGBG("id81");
    fixupIEPNGBG("id82");
    fixupIEPNGBG("id83");
    fixupIEPNGBG("id84");
    fixupIEPNGBG("id85");
    fixupIEPNGBG("id86");
    fixupIEPNGBG("id87");
    fixupIEPNGBG("id88");
    fixupIEPNGBG("id89");
    fixupIEPNGBG("id90");
    fixupIEPNGBG("id91");
    fixupIEPNGBG("id92");
    fixupIEPNGBG("id93");
    fixupIEPNGBG("id94");
    fixupIEPNGBG("id95");
    fixupIEPNGBG("id96");
    fixupIEPNGBG("id97");
    fixupIEPNGBG("id98");
    fixupIEPNGBG("id99");
    fixupIEPNGBG("id100");
    fixupIEPNGBG("id101");
    fixupIEPNGBG("id102");
    fixupIEPNGBG("id103");
    fixupIEPNGBG("id104");
    fixupIEPNGBG("id105");
    fixupIEPNGBG("id106");
    fixupIEPNGBG("id107");
    fixupIEPNGBG("id108");
    fixupIEPNGBG("id109");
    fixupIEPNGBG("id110");
    fixupIEPNGBG("id111");
    fixupIEPNGBG("id112");
    fixupIEPNGBG("id113");
    fixupIEPNGBG("id114");
    fixupIEPNGBG("id115");
    fixupIEPNGBG("id116");
    fixupIEPNGBG("id117");
    fixupIEPNGBG("id118");
    fixupIEPNGBG("id119");
    fixupIEPNGBG("id120");
    fixupIEPNGBG("id121");
    fixupIEPNGBG("id122");
    fixupIEPNGBG("id123");
    fixupIEPNGBG("id124");
    fixupIEPNGBG("id125");
    fixupIEPNGBG("id126");
    fixupIEPNGBG("id127");
    fixupIEPNGBG("id128");
    fixupIEPNGBG("id129");
    fixupIEPNGBG("id130");
    fixupIEPNGBG("id131");
    fixupIEPNGBG("id132");
    fixupIEPNGBG("id133");
    fixupIEPNGBG("id134");
    fixupIEPNGBG("id135");
    fixupIEPNGBG("id136");
    fixupIEPNGBG("id137");
    fixupIEPNGBG("id138");
    fixupIEPNGBG("id139");
    fixupIEPNGBG("id140");
    fixupIEPNGBG("id141");
    fixupIEPNGBG("id142");
    fixupIEPNGBG("id143");
    fixupIEPNGBG("id144");
    fixupIEPNGBG("id145");
    fixupIEPNGBG("id146");
    fixupIEPNGBG("id147");
    fixupIEPNGBG("id148");
    fixupIEPNGBG("id149");
    fixupIEPNGBG("id150");
    fixupIEPNGBG("id151");
    fixupIEPNGBG("id152");
    fixupIEPNGBG("id153");
    fixupIEPNGBG("id154");
    fixupIEPNGBG("id155");
    fixupIEPNGBG("id156");
    fixupIEPNGBG("id157");
    fixupIEPNGBG("id158");
    fixupIEPNGBG("id159");
    fixupIEPNGBG("id160");
    fixupIEPNGBG("id161");
    fixupIEPNGBG("id162");
    fixupIEPNGBG("id163");
    fixupIEPNGBG("id164");
    fixupIEPNGBG("id165");
    fixupIEPNGBG("id166");
    fixupIEPNGBG("id167");
    fixupIEPNGBG("id168");
    fixupIEPNGBG("id169");
    fixupIEPNGBG("id170");
    fixupIEPNGBG("id171");
    fixupIEPNGBG("id172");
    fixupIEPNGBG("id173");
    fixupIEPNGBG("id174");
    fixupIEPNGBG("id175");
    fixupIEPNGBG("id176");
    fixupIEPNGBG("id177");
    fixupIEPNGBG("id178");
    fixupIEPNGBG("id179");
    fixupIEPNGBG("id180");
    fixupIEPNGBG("id181");
    fixupIEPNGBG("id182");
    fixupIEPNGBG("id183");
    fixupIEPNGBG("id184");
    fixupIEPNGBG("id185");
    fixupIEPNGBG("id186");
    fixupIEPNGBG("id187");
    fixupIEPNGBG("id188");
    fixupIEPNGBG("id189");
    fixupIEPNGBG("id190");
    fixupIEPNGBG("id191");
    fixupIEPNGBG("id192");
    fixupIEPNGBG("id193");
    fixupIEPNGBG("id194");
    fixupIEPNGBG("id195");
    fixupIEPNGBG("id196");
    fixupIEPNGBG("id197");
    fixupIEPNGBG("id198");
    fixupIEPNGBG("id199");
    fixupIEPNG("id200", "Photos_files/transparent.gif");
    fixupIEPNG("id201", "Photos_files/transparent.gif");
    return true;
}


