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

slides = new Array();
slides[0] = new Slide('../Photos/E5D20B14-5F1C-4878-982F-B6B9C10C7058_files/DSC00287.jpg', '600', '800', 'In the airport');
slides[1] = new Slide('../Photos/E5D20B14-5F1C-4878-982F-B6B9C10C7058_files/Juvinal Show.jpg', '480', '640', 'Juvenile show');
slides[2] = new Slide('../Photos/E5D20B14-5F1C-4878-982F-B6B9C10C7058_files/DSC00472.jpg', '600', '800', 'Wroclaw Poland\n');
slides[3] = new Slide('../Photos/E5D20B14-5F1C-4878-982F-B6B9C10C7058_files/DSC00422.jpg', '600', '800', 'Magic trick\n');
slides[4] = new Slide('../Photos/E5D20B14-5F1C-4878-982F-B6B9C10C7058_files/DSC00457.jpg', '600', '800', 'Silly kids watching');
slides[5] = new Slide('../Photos/E5D20B14-5F1C-4878-982F-B6B9C10C7058_files/DSC00458.jpg', '600', '800', 'After the show wrap up');
slides[6] = new Slide('../Photos/E5D20B14-5F1C-4878-982F-B6B9C10C7058_files/DSC00342.jpg', '600', '800', 'Trains in Poland');
slides[7] = new Slide('../Photos/E5D20B14-5F1C-4878-982F-B6B9C10C7058_files/000_0265.jpg', '600', '800', 'The stage on the train');
slides[8] = new Slide('../Photos/E5D20B14-5F1C-4878-982F-B6B9C10C7058_files/DSC00553.jpg', '600', '800', 'Opole Poland');
slides[9] = new Slide('../Photos/E5D20B14-5F1C-4878-982F-B6B9C10C7058_files/DSC00490.jpg', '600', '800', 'Our bags\n');
slides[10] = new Slide('../Photos/E5D20B14-5F1C-4878-982F-B6B9C10C7058_files/DSC00532.jpg', '800', '600', 'Puppets in Krakow');
slides[11] = new Slide('../Photos/E5D20B14-5F1C-4878-982F-B6B9C10C7058_files/DSC00400.jpg', '600', '800', 'Katie and Saul');
slides[12] = new Slide('../Photos/E5D20B14-5F1C-4878-982F-B6B9C10C7058_files/000_0285.jpg', '600', '800', 'waiting...');
slides[13] = new Slide('../Photos/E5D20B14-5F1C-4878-982F-B6B9C10C7058_files/000_0381.jpg', '600', '800', 'Lubiaz Castle, SLOT Fest.');
slides[14] = new Slide('../Photos/E5D20B14-5F1C-4878-982F-B6B9C10C7058_files/DSC00639.jpg', '600', '800', 'The Psycho ward, Poland');
slides[15] = new Slide('../Photos/E5D20B14-5F1C-4878-982F-B6B9C10C7058_files/DSC00646.jpg', '600', '800', 'Story time');
slides[16] = new Slide('../Photos/E5D20B14-5F1C-4878-982F-B6B9C10C7058_files/DSC00877.jpg', '600', '800', 'The Giving Tree Cast');
slides[17] = new Slide('../Photos/E5D20B14-5F1C-4878-982F-B6B9C10C7058_files/DSC00677.jpg', '600', '800', 'Building the G.T. stage');
slides[18] = new Slide('../Photos/E5D20B14-5F1C-4878-982F-B6B9C10C7058_files/DSC00853.jpg', '600', '800', 'G.T. pre show prep');
slides[19] = new Slide('../Photos/E5D20B14-5F1C-4878-982F-B6B9C10C7058_files/shadowtheatre_6.jpg', '800', '536', 'Like this...');
slides[20] = new Slide('../Photos/E5D20B14-5F1C-4878-982F-B6B9C10C7058_files/shadowtheatre_5.jpg', '469', '700', 'Creating shadow theatre');
slides[21] = new Slide('../Photos/E5D20B14-5F1C-4878-982F-B6B9C10C7058_files/DSC00738.jpg', '600', '800', 'Rehearsing the music alone');
slides[22] = new Slide('../Photos/E5D20B14-5F1C-4878-982F-B6B9C10C7058_files/DSC00832.jpg', '600', '800', 'Working it together');
slides[23] = new Slide('../Photos/E5D20B14-5F1C-4878-982F-B6B9C10C7058_files/DSC00834.jpg', '600', '800', 'Getting there...');
slides[24] = new Slide('../Photos/E5D20B14-5F1C-4878-982F-B6B9C10C7058_files/DSC00812.jpg', '600', '800', 'Adding more violins');
slides[25] = new Slide('../Photos/E5D20B14-5F1C-4878-982F-B6B9C10C7058_files/DSC00798.jpg', '600', '800', 'Spotting the G.T. show');
slides[26] = new Slide('../Photos/E5D20B14-5F1C-4878-982F-B6B9C10C7058_files/DSC00833.jpg', '600', '800', 'Adding the music');
slides[27] = new Slide('../Photos/E5D20B14-5F1C-4878-982F-B6B9C10C7058_files/DSC00802.jpg', '600', '800', 'Adding the dialog');
slides[28] = new Slide('../Photos/E5D20B14-5F1C-4878-982F-B6B9C10C7058_files/DSC00820.jpg', '600', '800', 'Our hosts');
slides[29] = new Slide('../Photos/E5D20B14-5F1C-4878-982F-B6B9C10C7058_files/000_0374.jpg', '600', '800', 'SLOT Festival');
slides[30] = new Slide('../Photos/E5D20B14-5F1C-4878-982F-B6B9C10C7058_files/DSC00641.jpg', '600', '800', 'Philip and Patches');
slides[31] = new Slide('../Photos/E5D20B14-5F1C-4878-982F-B6B9C10C7058_files/DSC00827.jpg', '600', '800', 'Show under the Tree at SLOT');
slides[32] = new Slide('../Photos/E5D20B14-5F1C-4878-982F-B6B9C10C7058_files/000_0356 copy.jpg', '600', '800', 'I see dead people');
slides[33] = new Slide('../Photos/E5D20B14-5F1C-4878-982F-B6B9C10C7058_files/DSC01107.jpg', '600', '800', 'Village show, Hungary');
slides[34] = new Slide('../Photos/E5D20B14-5F1C-4878-982F-B6B9C10C7058_files/DSC01032.jpg', '600', '800', 'Kids in Hungary');
slides[35] = new Slide('../Photos/E5D20B14-5F1C-4878-982F-B6B9C10C7058_files/accordian gypsy-cropped.jpg', '232', '176', 'ahh.. the music.');
slides[36] = new Slide('../Photos/E5D20B14-5F1C-4878-982F-B6B9C10C7058_files/IMG_0086.jpg', '534', '800', 'Katie and a new friend');
slides[37] = new Slide('../Photos/E5D20B14-5F1C-4878-982F-B6B9C10C7058_files/DSC01160.jpg', '600', '800', 'Andrew and the girls');
slides[38] = new Slide('../Photos/E5D20B14-5F1C-4878-982F-B6B9C10C7058_files/IMG_0011.jpg', '534', '800', '...for me?');
slides[39] = new Slide('../Photos/E5D20B14-5F1C-4878-982F-B6B9C10C7058_files/IMG_2516.jpg', '600', '800', 'Teaching the Saw n Bow');
slides[40] = new Slide('../Photos/E5D20B14-5F1C-4878-982F-B6B9C10C7058_files/IMG_0044.jpg', '534', '800', 'Praying with the Gypsies');
slides[41] = new Slide('../Photos/E5D20B14-5F1C-4878-982F-B6B9C10C7058_files/IMG_0026.jpg', '534', '800', 'In the Gypsy village');
slides[42] = new Slide('../Photos/E5D20B14-5F1C-4878-982F-B6B9C10C7058_files/IMG_0022.jpg', '534', '800', 'Beautiful Children');
slides[43] = new Slide('../Photos/E5D20B14-5F1C-4878-982F-B6B9C10C7058_files/IMG_0013.jpg', '800', '534', 'Go ahead... try it.');
slides[44] = new Slide('../Photos/E5D20B14-5F1C-4878-982F-B6B9C10C7058_files/DSC01264.jpg', '600', '800', 'Opening the show.');
slides[45] = new Slide('../Photos/E5D20B14-5F1C-4878-982F-B6B9C10C7058_files/IMG_0045.jpg', '534', '800', 'Introducing the stars');
slides[46] = new Slide('../Photos/E5D20B14-5F1C-4878-982F-B6B9C10C7058_files/IMG_0048.jpg', '534', '800', 'Beautiful people');
slides[47] = new Slide('../Photos/E5D20B14-5F1C-4878-982F-B6B9C10C7058_files/000_0451.jpg', '600', '800', 'I wont forget.');
slides[48] = new Slide('../Photos/E5D20B14-5F1C-4878-982F-B6B9C10C7058_files/IMG_0053.jpg', '800', '534', 'Dark eyes');
slides[49] = new Slide('../Photos/E5D20B14-5F1C-4878-982F-B6B9C10C7058_files/DSC01263.jpg', '600', '800', 'There we are.');
slides[50] = new Slide('../Photos/E5D20B14-5F1C-4878-982F-B6B9C10C7058_files/IMG_0003.jpg', '800', '534', 'Setting the market show');
slides[51] = new Slide('../Photos/E5D20B14-5F1C-4878-982F-B6B9C10C7058_files/IMG_0022_2.jpg', '534', '800', 'Intrigued.');
slides[52] = new Slide('../Photos/E5D20B14-5F1C-4878-982F-B6B9C10C7058_files/IMG_0028.jpg', '534', '800', 'Market place show, Romania');
slides[53] = new Slide('../Photos/E5D20B14-5F1C-4878-982F-B6B9C10C7058_files/DSC01299.jpg', '600', '800', 'Our Romania Grandparents');
slides[54] = new Slide('../Photos/E5D20B14-5F1C-4878-982F-B6B9C10C7058_files/IMG_2538.jpg', '800', '600', 'Casa Alba Orphanage, R.O.');
slides[55] = new Slide('../Photos/E5D20B14-5F1C-4878-982F-B6B9C10C7058_files/000_0485.jpg', '600', '800', 'Oh the wonder');
slides[56] = new Slide('../Photos/E5D20B14-5F1C-4878-982F-B6B9C10C7058_files/100_2658.jpg', '600', '800', 'Brans Castle, Transalvania R.O.');
slides[57] = new Slide('../Photos/E5D20B14-5F1C-4878-982F-B6B9C10C7058_files/DSC01513.jpg', '600', '800', 'ooo...  a secret passage!');
slides[58] = new Slide('../Photos/E5D20B14-5F1C-4878-982F-B6B9C10C7058_files/100_2650.jpg', '800', '600', 'Castle Dracula?');
slides[59] = new Slide('../Photos/E5D20B14-5F1C-4878-982F-B6B9C10C7058_files/100_2647.jpg', '600', '800', 'Inside Brans Castle');
slides[60] = new Slide('../Photos/E5D20B14-5F1C-4878-982F-B6B9C10C7058_files/000_0474.jpg', '600', '800', 'View from my window');
slides[61] = new Slide('../Photos/E5D20B14-5F1C-4878-982F-B6B9C10C7058_files/100_2615.jpg', '600', '800', 'The Transalvanian Alps begin');
slides[62] = new Slide('../Photos/E5D20B14-5F1C-4878-982F-B6B9C10C7058_files/000_0479.jpg', '600', '800', 'For the living.');
slides[63] = new Slide('../Photos/E5D20B14-5F1C-4878-982F-B6B9C10C7058_files/DSC01359.jpg', '600', '800', 'Alba Iulia, Romania');
slides[64] = new Slide('../Photos/E5D20B14-5F1C-4878-982F-B6B9C10C7058_files/DSC01668.jpg', '600', '800', 'Our Friends, Alba Iulia R.O.');
slides[65] = new Slide('../Photos/E5D20B14-5F1C-4878-982F-B6B9C10C7058_files/100_2695.jpg', '600', '800', 'Castle Hill Budapest');
slides[66] = new Slide('../Photos/E5D20B14-5F1C-4878-982F-B6B9C10C7058_files/100_2694 copy.jpg', '600', '800', 'Parliament Building Budapest');
slides[67] = new Slide('../Photos/E5D20B14-5F1C-4878-982F-B6B9C10C7058_files/DSC01750.jpg', '600', '800', 'The night life');
slides[68] = new Slide('../Photos/E5D20B14-5F1C-4878-982F-B6B9C10C7058_files/DSC01735.jpg', '600', '800', 'Another traveling puppet show?');
slides[69] = new Slide('../Photos/E5D20B14-5F1C-4878-982F-B6B9C10C7058_files/DSC01734.jpg', '600', '800', 'Our friends, fellow puppet makers');
slides[70] = new Slide('../Photos/E5D20B14-5F1C-4878-982F-B6B9C10C7058_files/DSC01689.jpg', '600', '800', 'A new friend');
slides[71] = new Slide('../Photos/E5D20B14-5F1C-4878-982F-B6B9C10C7058_files/DSC01710.jpg', '600', '800', 'The Danube river, Budapest');
slides[72] = new Slide('../Photos/E5D20B14-5F1C-4878-982F-B6B9C10C7058_files/DSC01862.jpg', '600', '800', 'Land of Chocolate, Switzerland');
slides[73] = new Slide('../Photos/E5D20B14-5F1C-4878-982F-B6B9C10C7058_files/Circus Big Top.jpg', '480', '640', 'Knie Big Top');
slides[74] = new Slide('../Photos/E5D20B14-5F1C-4878-982F-B6B9C10C7058_files/100_2760.jpg', '600', '800', 'The real Sideshow');
slides[75] = new Slide('../Photos/E5D20B14-5F1C-4878-982F-B6B9C10C7058_files/100_2753.jpg', '600', '800', '...for all ages and walks of life.');
slides[76] = new Slide('../Photos/E5D20B14-5F1C-4878-982F-B6B9C10C7058_files/DSC01912.jpg', '600', '800', 'A Swiss Circus');
slides[77] = new Slide('../Photos/E5D20B14-5F1C-4878-982F-B6B9C10C7058_files/DSC01909.jpg', '600', '800', 'Cornelius?');
slides[78] = new Slide('../Photos/E5D20B14-5F1C-4878-982F-B6B9C10C7058_files/DSC01899.jpg', '600', '800', 'Life is good.');
slides[79] = new Slide('../Photos/E5D20B14-5F1C-4878-982F-B6B9C10C7058_files/DSC01885.jpg', '600', '800', 'Biking in Bern');
slides[80] = new Slide('../Photos/E5D20B14-5F1C-4878-982F-B6B9C10C7058_files/DSC01946.jpg', '600', '800', 'A sad place');
slides[81] = new Slide('../Photos/E5D20B14-5F1C-4878-982F-B6B9C10C7058_files/with friends.jpg', '600', '800', 'With friends in Germany');
slides[82] = new Slide('../Photos/E5D20B14-5F1C-4878-982F-B6B9C10C7058_files/better bonhoffer.jpg', '800', '600', 'Dietrich Bonhoeffers church');
slides[83] = new Slide('../Photos/E5D20B14-5F1C-4878-982F-B6B9C10C7058_files/Berlin.jpg', '800', '600', 'Berlin');
slides[84] = new Slide('../Photos/E5D20B14-5F1C-4878-982F-B6B9C10C7058_files/NLM show.jpg', '600', '800', 'No Longer Music Concert');
slides[85] = new Slide('../Photos/E5D20B14-5F1C-4878-982F-B6B9C10C7058_files/in storsge.jpg', '600', '800', 'In storage show');
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 onPageLoad()
{
    detectBrowser();
    adjustLineHeightIfTooBig("id2");
    adjustFontSizeIfTooBig("id2");
    adjustLineHeightIfTooBig("id4");
    adjustFontSizeIfTooBig("id4");
    adjustLineHeightIfTooBig("id6");
    adjustFontSizeIfTooBig("id6");
    adjustLineHeightIfTooBig("id7");
    adjustFontSizeIfTooBig("id7");
    adjustLineHeightIfTooBig("id8");
    adjustFontSizeIfTooBig("id8");
    fixupAllIEPNGBGs();
    fixupIEPNG("id1", "E5D20B14-5F1C-4878-982F-B6B9C10C7058_files/transparent.gif");
    fixupIEPNG("id3", "E5D20B14-5F1C-4878-982F-B6B9C10C7058_files/transparent.gif");
    fixupIEPNG("id5", "E5D20B14-5F1C-4878-982F-B6B9C10C7058_files/transparent.gif");
    return true;
}

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 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;
    }
}

